signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class TriggerManager { /** * Returns a consolidated trigger to call for load operations , or null if
* none . If not null , the consolidated trigger is not a snapshot - - it will
* change as the set of triggers in this manager changes .
* @ since 1.2 */
public Trigger < ? super S > getLoadTrigger ( ) { } } | ForLoad < S > forLoad = mForLoad ; return forLoad . isEmpty ( ) ? null : forLoad ; |
public class ModelConstraints { /** * Checks whether the given field definition is used as the primary key of a class referenced by
* a reference .
* @ param modelDef The model
* @ param fieldDef The current field descriptor def
* @ return The reference that uses the field or < code > null < / code > if the field is not used in this way */
private ReferenceDescriptorDef usedByReference ( ModelDef modelDef , FieldDescriptorDef fieldDef ) { } } | String ownerClassName = ( ( ClassDescriptorDef ) fieldDef . getOwner ( ) ) . getQualifiedName ( ) ; ClassDescriptorDef classDef ; ReferenceDescriptorDef refDef ; String targetClassName ; // only relevant for primarykey fields
if ( PropertyHelper . toBoolean ( fieldDef . getProperty ( PropertyHelper . OJB_PROPERTY_PRIMARYKEY ) , false ) ) { for ( Iterator classIt = modelDef . getClasses ( ) ; classIt . hasNext ( ) ; ) { classDef = ( ClassDescriptorDef ) classIt . next ( ) ; for ( Iterator refIt = classDef . getReferences ( ) ; refIt . hasNext ( ) ; ) { refDef = ( ReferenceDescriptorDef ) refIt . next ( ) ; targetClassName = refDef . getProperty ( PropertyHelper . OJB_PROPERTY_CLASS_REF ) . replace ( '$' , '.' ) ; if ( ownerClassName . equals ( targetClassName ) ) { // the field is a primary key of the class referenced by this reference descriptor
return refDef ; } } } } return null ; |
public class Clause { /** * setter for rule - sets
* @ generated
* @ param v value to set into the feature */
public void setRule ( String v ) { } } | if ( Clause_Type . featOkTst && ( ( Clause_Type ) jcasType ) . casFeat_rule == null ) jcasType . jcas . throwFeatMissing ( "rule" , "com.digitalpebble.rasp.Clause" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Clause_Type ) jcasType ) . casFeatCode_rule , v ) ; |
public class Reaction { /** * Adds a reactant to this reaction with a stoichiometry coefficient .
* @ param reactant Molecule added as reactant to this reaction
* @ param coefficient Stoichiometry coefficient for this molecule
* @ see # getReactants */
@ Override public void addReactant ( IAtomContainer reactant , Double coefficient ) { } } | reactants . addAtomContainer ( reactant , coefficient ) ; notifyChanged ( ) ; |
public class SchedulerDriver { /** * Retain the complete evaluators submitting another task
* until there is no need to reuse them . */
private synchronized void retainEvaluator ( final ActiveContext context ) { } } | if ( scheduler . hasPendingTasks ( ) ) { scheduler . submitTask ( context ) ; } else if ( nActiveEval > 1 ) { nActiveEval -- ; context . close ( ) ; } else { state = State . READY ; waitForCommands ( context ) ; } |
public class SurvivalInfoHelper { /** * If any not numeric value then categorical
* @ param values
* @ return */
private static boolean isCategorical ( LinkedHashMap < String , Double > values ) { } } | try { for ( String value : values . keySet ( ) ) { Double . parseDouble ( value ) ; } return false ; } catch ( Exception e ) { return true ; } |
public class DateInterval { /** * / * [ deutsch ]
* < p > Erzeugt einen { @ code Stream } , der jeweils ein Kalenderdatum als Vielfaches der Dauer angewandt auf
* den Start und bis zum Ende dieses Intervalls geht . < / p >
* @ param duration duration which has to be added to the start multiple times
* @ throws IllegalArgumentException if the duration is not positive
* @ throws IllegalStateException if this interval is infinite or if there is no canonical form
* @ return stream consisting of distinct dates which are the result of adding the duration to the start
* @ see # toCanonical ( )
* @ see # stream ( Duration , PlainDate , PlainDate )
* @ since 4.18 */
public Stream < PlainDate > stream ( Duration < CalendarUnit > duration ) { } } | if ( this . isEmpty ( ) && duration . isPositive ( ) ) { return Stream . empty ( ) ; } DateInterval interval = this . toCanonical ( ) ; PlainDate start = interval . getStartAsCalendarDate ( ) ; PlainDate end = interval . getEndAsCalendarDate ( ) ; if ( ( start == null ) || ( end == null ) ) { throw new IllegalStateException ( "Streaming is not supported for infinite intervals." ) ; } return DateInterval . stream ( duration , start , end ) ; |
public class FessMessages { /** * Add the created action message for the key ' constraints . NotEmpty . message ' with parameters .
* < pre >
* message : { item } may not be empty .
* < / pre >
* @ param property The property name for the message . ( NotNull )
* @ return this . ( NotNull ) */
public FessMessages addConstraintsNotEmptyMessage ( String property ) { } } | assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( CONSTRAINTS_NotEmpty_MESSAGE ) ) ; return this ; |
public class ArmeriaAutoConfiguration { /** * Create a started { @ link Server } bean . */
@ Bean @ Nullable public Server armeriaServer ( ArmeriaSettings armeriaSettings , Optional < MeterRegistry > meterRegistry , Optional < MeterIdPrefixFunctionFactory > meterIdPrefixFunctionFactory , Optional < List < HealthChecker > > healthCheckers , Optional < List < ArmeriaServerConfigurator > > armeriaServerConfigurators , Optional < List < ThriftServiceRegistrationBean > > thriftServiceRegistrationBeans , Optional < List < HttpServiceRegistrationBean > > httpServiceRegistrationBeans , Optional < List < AnnotatedServiceRegistrationBean > > annotatedServiceRegistrationBeans ) throws InterruptedException { } } | if ( ! armeriaServerConfigurators . isPresent ( ) && ! thriftServiceRegistrationBeans . isPresent ( ) && ! httpServiceRegistrationBeans . isPresent ( ) && ! annotatedServiceRegistrationBeans . isPresent ( ) ) { // No services to register , no need to start up armeria server .
return null ; } final MeterIdPrefixFunctionFactory meterIdPrefixFuncFactory = armeriaSettings . isEnableMetrics ( ) ? meterIdPrefixFunctionFactory . orElse ( DEFAULT ) : null ; final ServerBuilder server = new ServerBuilder ( ) ; final List < Port > ports = armeriaSettings . getPorts ( ) ; if ( ports . isEmpty ( ) ) { server . port ( new ServerPort ( DEFAULT_PORT . getPort ( ) , DEFAULT_PORT . getProtocols ( ) ) ) ; } else { configurePorts ( server , ports ) ; } configureThriftServices ( server , thriftServiceRegistrationBeans . orElseGet ( Collections :: emptyList ) , meterIdPrefixFuncFactory , armeriaSettings . getDocsPath ( ) ) ; configureHttpServices ( server , httpServiceRegistrationBeans . orElseGet ( Collections :: emptyList ) , meterIdPrefixFuncFactory ) ; configureAnnotatedHttpServices ( server , annotatedServiceRegistrationBeans . orElseGet ( Collections :: emptyList ) , meterIdPrefixFuncFactory ) ; configureServerWithArmeriaSettings ( server , armeriaSettings , meterRegistry . orElse ( Metrics . globalRegistry ) , healthCheckers . orElseGet ( Collections :: emptyList ) ) ; armeriaServerConfigurators . ifPresent ( configurators -> configurators . forEach ( configurator -> configurator . configure ( server ) ) ) ; final Server s = server . build ( ) ; s . start ( ) . handle ( ( result , t ) -> { if ( t != null ) { throw new IllegalStateException ( "Armeria server failed to start" , t ) ; } return result ; } ) . join ( ) ; logger . info ( "Armeria server started at ports: {}" , s . activePorts ( ) ) ; return s ; |
public class PrettySharedPreferences { /** * Call to get a { @ link com . tale . prettysharedpreferences . LongEditor } object for the specific
* key . < code > NOTE : < / code > There is a unique { @ link com . tale . prettysharedpreferences . TypeEditor }
* object for a unique key .
* @ param key The name of the preference .
* @ return { @ link com . tale . prettysharedpreferences . LongEditor } object to be store or retrieve
* a { @ link java . lang . Long } value . */
protected LongEditor getLongEditor ( String key ) { } } | TypeEditor typeEditor = TYPE_EDITOR_MAP . get ( key ) ; if ( typeEditor == null ) { typeEditor = new LongEditor ( this , sharedPreferences , key ) ; TYPE_EDITOR_MAP . put ( key , typeEditor ) ; } else if ( ! ( typeEditor instanceof LongEditor ) ) { throw new IllegalArgumentException ( String . format ( "key %s is already used for other type" , key ) ) ; } return ( LongEditor ) typeEditor ; |
public class JVMLauncher { /** * Get a process loader for a JVM . The class path for the JVM
* is computed based on the class loaders for the main class .
* @ param mainClass Fully qualified class name of the main class
* @ param args Additional command line parameters
* @ return ProcessBuilder that has not been started .
* @ deprecated This acquires the mainClass class by using the
* { @ link Thread # getContextClassLoader ( ) thread context class loader }
* or this class ' s class loader . Depending on where mainClass
* was loaded from neither of these may work .
* @ see # getProcessBuilder ( Class , String [ ] ) */
@ Deprecated public static ProcessBuilder getProcessBuilder ( String mainClass , String ... args ) throws LauncherException { } } | return getProcessBuilder ( findClass ( mainClass ) , Arrays . asList ( args ) ) ; |
public class JsonConversionUtils { /** * Converts a collection of { @ link SpanData } to a Collection of json string .
* @ param appName the name of app to include in traces .
* @ param spanDataList Collection of { @ code SpanData } to be converted to json .
* @ return Collection of { @ code SpanData } converted to JSON to be indexed . */
static List < String > convertToJson ( String appName , Collection < SpanData > spanDataList ) { } } | List < String > spanJson = new ArrayList < String > ( ) ; if ( spanDataList == null ) { return spanJson ; } StringBuilder sb = new StringBuilder ( ) ; for ( final SpanData span : spanDataList ) { final SpanContext spanContext = span . getContext ( ) ; final SpanId parentSpanId = span . getParentSpanId ( ) ; final Timestamp startTimestamp = span . getStartTimestamp ( ) ; final Timestamp endTimestamp = span . getEndTimestamp ( ) ; final Status status = span . getStatus ( ) ; if ( endTimestamp == null ) { continue ; } sb . append ( '{' ) ; sb . append ( "\"appName\":\"" ) . append ( appName ) . append ( "\"," ) ; sb . append ( "\"spanId\":\"" ) . append ( encodeSpanId ( spanContext . getSpanId ( ) ) ) . append ( "\"," ) ; sb . append ( "\"traceId\":\"" ) . append ( encodeTraceId ( spanContext . getTraceId ( ) ) ) . append ( "\"," ) ; if ( parentSpanId != null ) { sb . append ( "\"parentId\":\"" ) . append ( encodeSpanId ( parentSpanId ) ) . append ( "\"," ) ; } sb . append ( "\"timestamp\":" ) . append ( toMillis ( startTimestamp ) ) . append ( ',' ) ; sb . append ( "\"duration\":" ) . append ( toMillis ( startTimestamp , endTimestamp ) ) . append ( ',' ) ; sb . append ( "\"name\":\"" ) . append ( toSpanName ( span ) ) . append ( "\"," ) ; sb . append ( "\"kind\":\"" ) . append ( toSpanKind ( span ) ) . append ( "\"," ) ; sb . append ( "\"dateStarted\":\"" ) . append ( formatDate ( startTimestamp ) ) . append ( "\"," ) ; sb . append ( "\"dateEnded\":\"" ) . append ( formatDate ( endTimestamp ) ) . append ( '"' ) ; if ( status == null ) { sb . append ( ",\"status\":" ) . append ( "\"ok\"" ) ; } else if ( ! status . isOk ( ) ) { sb . append ( ",\"error\":" ) . append ( "true" ) ; } Map < String , AttributeValue > attributeMap = span . getAttributes ( ) . getAttributeMap ( ) ; if ( attributeMap . size ( ) > 0 ) { StringBuilder builder = new StringBuilder ( ) ; builder . append ( '{' ) ; for ( Entry < String , AttributeValue > entry : attributeMap . entrySet ( ) ) { if ( builder . length ( ) > 1 ) { builder . append ( ',' ) ; } builder . append ( "\"" ) . append ( entry . getKey ( ) ) . append ( "\":\"" ) . append ( attributeValueToString ( entry . getValue ( ) ) ) . append ( "\"" ) ; } builder . append ( '}' ) ; sb . append ( ",\"data\":" ) . append ( builder ) ; } sb . append ( '}' ) ; spanJson . add ( sb . toString ( ) ) ; } return spanJson ; |
public class BufferUtil { /** * Simple StaticBuffer construction */
public static final StaticBuffer getIntBuffer ( int id ) { } } | ByteBuffer buffer = ByteBuffer . allocate ( intSize ) ; buffer . putInt ( id ) ; byte [ ] arr = buffer . array ( ) ; Preconditions . checkArgument ( arr . length == intSize ) ; return StaticArrayBuffer . of ( arr ) ; |
public class LazyTreeReader { /** * Should be called only from containers ( lists , maps , structs , unions ) since for these tree
* readers the number of rows does not correspond to the number of values ( e . g . there may
* be many more if it contains the entries in lists with more than one element , or much less
* if it is the fields in a struct where every other struct is null )
* @ param previous
* @ return
* @ throws IOException */
public Object getInComplexType ( Object previous , long row ) throws IOException { } } | if ( nextIsNullInComplexType ( ) ) { return null ; } previousRow = row ; return next ( previous ) ; |
public class JettyFactoryImpl { /** * { @ inheritDoc } */
@ Override public ServerConnector createConnector ( final Server server , final String name , final int port , int securePort , final String host , final Boolean checkForwaredHeaders ) { } } | HttpConfiguration httpConfig = getHttpConfiguration ( securePort , checkForwaredHeaders , server ) ; ConnectionFactory factory = null ; if ( alpnCLassesAvailable ( ) ) { log . info ( "HTTP/2 available, adding HTTP/2 to connector" ) ; // SPDY connector
// ServerConnector spdy ;
try { // Class < ? > loadClass = bundle . loadClass ( " org . eclipse . jetty . spdy . server . http . HTTPSPDYServerConnector " ) ;
// Constructor < ? > [ ] constructors = loadClass . getConstructors ( ) ;
// for ( Constructor < ? > constructor : constructors ) {
// Class < ? > [ ] parameterTypes = constructor . getParameterTypes ( ) ;
// if ( parameterTypes . length = = 1 & & parameterTypes [ 0 ] . equals ( Server . class ) ) {
// spdy = ( ServerConnector ) constructor . newInstance ( server ) ;
// spdy . setPort ( port ) ;
// spdy . setName ( name ) ;
// spdy . setHost ( host ) ;
// spdy . setIdleTimeout ( 500000 ) ;
// return spdy ;
Class < ? > loadClass = bundle . loadClass ( "org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory" ) ; factory = ( ConnectionFactory ) ConstructorUtils . invokeConstructor ( loadClass , httpConfig ) ; } catch ( ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | NoSuchMethodException | InvocationTargetException e ) { // TODO Auto - generated catch block
e . printStackTrace ( ) ; } } else { log . info ( "HTTP/2 not available, creating standard ServerConnector for Http" ) ; factory = new HttpConnectionFactory ( httpConfig ) ; } // HTTP connector
ServerConnector http = new ServerConnector ( server ) ; http . addConnectionFactory ( factory ) ; http . setPort ( port ) ; http . setHost ( host ) ; http . setName ( name ) ; http . setIdleTimeout ( 30000 ) ; return http ; |
public class Crawler { /** * Enters the form data . First , the related input elements ( if any ) to the eventable are filled
* in and then it tries to fill in the remaining input elements .
* @ param eventable the eventable element . */
private void handleInputElements ( Eventable eventable ) { } } | CopyOnWriteArrayList < FormInput > formInputs = eventable . getRelatedFormInputs ( ) ; for ( FormInput formInput : formHandler . getFormInputs ( ) ) { if ( ! formInputs . contains ( formInput ) ) { formInputs . add ( formInput ) ; } } formHandler . handleFormElements ( formInputs ) ; |
public class LeaderboardsHandler { /** * Return all the Leaderboards . */
@ SuppressWarnings ( "unused" ) // called through reflection by RequestServer
public water . automl . api . schemas3 . LeaderboardsV99 list ( int version , water . automl . api . schemas3 . LeaderboardsV99 s ) { } } | Leaderboards m = s . createAndFillImpl ( ) ; m . leaderboards = Leaderboards . fetchAll ( ) ; return s . fillFromImpl ( m ) ; |
public class ApiOvhXdsl { /** * List available WLAN channel for this modem
* REST : GET / xdsl / { serviceName } / modem / availableWLANChannel
* @ param frequency [ required ] WLAN frequency you want to retrieve channels
* @ param serviceName [ required ] The internal name of your XDSL offer */
public ArrayList < Long > serviceName_modem_availableWLANChannel_GET ( String serviceName , OvhWLANFrequencyEnum frequency ) throws IOException { } } | String qPath = "/xdsl/{serviceName}/modem/availableWLANChannel" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "frequency" , frequency ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t15 ) ; |
public class SingleUnitTimeSpan { /** * / * [ deutsch ]
* < p > Liefert eine Kopie mit dem addierten Betrag . < / p >
* @ param amount the amount to be added
* @ return result of addition as immutable copy
* @ throws ArithmeticException if numeric overflow occurs */
public D plus ( int amount ) { } } | if ( amount == 0 ) { return this . self ( ) ; } long value = this . amount ; return this . with ( MathUtils . safeCast ( value + amount ) ) ; |
public class Nd4jEnvironment { /** * Load an { @ link Nd4jEnvironment } from
* the properties returned from { @ link org . nd4j . linalg . api . ops . executioner . OpExecutioner # getEnvironmentInformation ( ) }
* derived from { @ link Nd4j # getExecutioner ( ) }
* @ return the environment representing the system the nd4j
* backend is running on . */
public static Nd4jEnvironment getEnvironment ( ) { } } | Properties envInfo = Nd4j . getExecutioner ( ) . getEnvironmentInformation ( ) ; Nd4jEnvironment ret = Nd4jEnvironment . builder ( ) . numCores ( getIntOrZero ( CPU_CORES_KEY , envInfo ) ) . ram ( getLongOrZero ( HOST_TOTAL_MEMORY_KEY , envInfo ) ) . os ( envInfo . get ( OS_KEY ) . toString ( ) ) . blasVendor ( envInfo . get ( BLAS_VENDOR_KEY ) . toString ( ) ) . blasThreads ( getLongOrZero ( BLAS_THREADS_KEY , envInfo ) ) . ompThreads ( getIntOrZero ( OMP_THREADS_KEY , envInfo ) ) . numGpus ( getIntOrZero ( CUDA_NUM_GPUS_KEY , envInfo ) ) . build ( ) ; if ( envInfo . containsKey ( CUDA_DEVICE_INFORMATION_KEY ) ) { List < Map < String , Object > > deviceInfo = ( List < Map < String , Object > > ) envInfo . get ( CUDA_DEVICE_INFORMATION_KEY ) ; List < Long > gpuRam = new ArrayList < > ( ) ; for ( Map < String , Object > info : deviceInfo ) { gpuRam . add ( Long . parseLong ( info . get ( Nd4jEnvironment . CUDA_TOTAL_MEMORY_KEY ) . toString ( ) ) ) ; } ret . setGpuRam ( gpuRam ) ; } return ret ; |
public class EJBProcessor { /** * d429866 */
@ Override public void processXML ( ) throws InjectionException { } } | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "processXML : " + this ) ; List < ? extends EJBRef > ejbRefs = ivNameSpaceConfig . getJNDIEnvironmentRefs ( EJBRef . class ) ; if ( ejbRefs != null ) { for ( EJBRef ejbRef : ejbRefs ) { // If XML has previously been read and an injection binding with the same
// jndi name has been created , get the current injection binding and merge
// the new EJB Ref into it .
String jndiName = ejbRef . getName ( ) ; InjectionBinding < EJB > injectionBinding = ivAllAnnotationsCollection . get ( jndiName ) ; if ( injectionBinding != null ) { ( ( EJBInjectionBinding ) injectionBinding ) . merge ( ejbRef ) ; } else { List < Description > descs = ejbRef . getDescriptions ( ) ; String lookupName = ejbRef . getLookupName ( ) ; EJB ejbAnnotation = new EJBImpl ( ejbRef . getName ( ) , null , ejbRef . getLink ( ) , ejbRef . getMappedName ( ) , descs . isEmpty ( ) ? null : descs . get ( 0 ) . getValue ( ) , lookupName != null ? lookupName . trim ( ) : null ) ; // F743-21028.4
EJBInjectionBinding ejbBinding = new EJBInjectionBinding ( ejbAnnotation , ejbRef , ivNameSpaceConfig ) ; // Process any injection - targets that may be specified . d429866.1
// Add all of those found to the EJBInjectionBinding . d432816
List < InjectionTarget > targets = ejbRef . getInjectionTargets ( ) ; if ( ! targets . isEmpty ( ) ) { for ( InjectionTarget target : targets ) { Class < ? > injectionType = ejbBinding . getInjectionClassTypeWithException ( ) ; String injectionName = target . getInjectionTargetName ( ) ; String injectionClassName = target . getInjectionTargetClassName ( ) ; ejbBinding . addInjectionTarget ( injectionType , // d446474
injectionName , injectionClassName ) ; } } // TODO : Support method injection and type compatibility
addInjectionBinding ( ejbBinding ) ; } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "processXML : " + this ) ; |
public class Distance { /** * Square of the distance between two points */
public static double getSquaredDistanceToPoint ( final double pFromX , final double pFromY , final double pToX , final double pToY ) { } } | final double dX = pFromX - pToX ; final double dY = pFromY - pToY ; return dX * dX + dY * dY ; |
public class TemplateMatching { /** * Performs template matching . */
public void process ( ) { } } | // compute match intensities
if ( mask == null ) match . process ( template ) ; else match . process ( template , mask ) ; GrayF32 intensity = match . getIntensity ( ) ; int offsetX = 0 ; int offsetY = 0 ; // adjust intensity image size depending on if there is a border or not
if ( ! match . isBorderProcessed ( ) ) { int x0 = match . getBorderX0 ( ) ; int x1 = imageWidth - ( template . width - x0 ) ; int y0 = match . getBorderY0 ( ) ; int y1 = imageHeight - ( template . height - y0 ) ; intensity = intensity . subimage ( x0 , y0 , x1 , y1 , null ) ; } else { offsetX = match . getBorderX0 ( ) ; offsetY = match . getBorderY0 ( ) ; } // find local peaks in intensity image
candidates . reset ( ) ; extractor . process ( intensity , null , null , null , candidates ) ; // select the best matches
if ( scores . length < candidates . size ) { scores = new float [ candidates . size ] ; indexes = new int [ candidates . size ] ; } for ( int i = 0 ; i < candidates . size ; i ++ ) { Point2D_I16 p = candidates . get ( i ) ; scores [ i ] = - intensity . get ( p . x , p . y ) ; } int N = Math . min ( maxMatches , candidates . size ) ; QuickSelect . selectIndex ( scores , N , candidates . size , indexes ) ; // save the results
results . reset ( ) ; for ( int i = 0 ; i < N ; i ++ ) { Point2D_I16 p = candidates . get ( indexes [ i ] ) ; Match m = results . grow ( ) ; m . score = - scores [ indexes [ i ] ] ; m . set ( p . x - offsetX , p . y - offsetY ) ; } |
public class POJOService { /** * adds getter for field to class
* @ param classBuilder class to modify
* @ param attributeName name of attribute to be referenced
* @ param type type of attribue to be referenced */
private void addGetter ( final TypeSpec . Builder classBuilder , final String attributeName , final TypeName type ) { } } | final String getterMethodName = "get" + attributeName . substring ( 0 , 1 ) . toUpperCase ( ) + attributeName . substring ( 1 ) ; final MethodSpec . Builder getterBuilder = MethodSpec . methodBuilder ( getterMethodName ) ; getterBuilder . returns ( type ) ; getterBuilder . addModifiers ( Modifier . PUBLIC ) ; getterBuilder . addCode ( "return this." + attributeName + ";" ) ; classBuilder . addMethod ( getterBuilder . build ( ) ) ; |
public class CircularList { /** * Inserts a collection of elements , looping on them .
* @ param newElements Collection of elements to add
* @ return Always true */
@ Override public boolean addAll ( Collection < ? extends T > newElements ) { } } | for ( T newElement : newElements ) { add ( newElement ) ; } return true ; |
public class CmsFlexController { /** * Returns the combined " expires " date for all resources read during this request . < p >
* @ return the combined " expires " date for all resources read during this request */
public long getDateExpires ( ) { } } | int pos = m_flexContextInfoList . size ( ) - 1 ; if ( pos < 0 ) { // ensure a valid position is used
return CmsResource . DATE_EXPIRED_DEFAULT ; } return ( m_flexContextInfoList . get ( pos ) ) . getDateExpires ( ) ; |
public class DataUtil { /** * Creates a random string , suitable for use as a mime boundary */
static String mimeBoundary ( ) { } } | final StringBuilder mime = StringUtil . borrowBuilder ( ) ; final Random rand = new Random ( ) ; for ( int i = 0 ; i < boundaryLength ; i ++ ) { mime . append ( mimeBoundaryChars [ rand . nextInt ( mimeBoundaryChars . length ) ] ) ; } return StringUtil . releaseBuilder ( mime ) ; |
public class EmbeddedNeo4jDialect { /** * It will remove a property from an embedded node if it exists .
* After deleting the property , if the node does not have any more properties and relationships ( except for an incoming one ) ,
* it will delete the embedded node as well . */
private void removePropertyForEmbedded ( Node embeddedNode , String [ ] embeddedColumnSplit , int i ) { } } | if ( i == embeddedColumnSplit . length - 1 ) { // Property
String property = embeddedColumnSplit [ embeddedColumnSplit . length - 1 ] ; if ( embeddedNode . hasProperty ( property ) ) { embeddedNode . removeProperty ( property ) ; } } else { Iterator < Relationship > iterator = embeddedNode . getRelationships ( Direction . OUTGOING , withName ( embeddedColumnSplit [ i ] ) ) . iterator ( ) ; if ( iterator . hasNext ( ) ) { removePropertyForEmbedded ( iterator . next ( ) . getEndNode ( ) , embeddedColumnSplit , i + 1 ) ; } } if ( ! embeddedNode . getPropertyKeys ( ) . iterator ( ) . hasNext ( ) ) { // Node without properties
Iterator < Relationship > iterator = embeddedNode . getRelationships ( ) . iterator ( ) ; if ( iterator . hasNext ( ) ) { Relationship relationship = iterator . next ( ) ; if ( ! iterator . hasNext ( ) ) { // Node with only one relationship and no properties ,
// we can remove it :
// It means we have removed all the properties from the embedded node
// and it is NOT an intermediate node like
// ( entity ) - - > ( embedded1 ) - - > ( embedded2)
relationship . delete ( ) ; embeddedNode . delete ( ) ; } } } |
public class StatsCollector { /** * Clears a tag added using { @ link # addExtraTag addExtraTag } .
* @ param name The name of the tag to remove from the set of extra
* tags .
* @ throws IllegalStateException if there ' s no extra tag currently
* recorded .
* @ throws IllegalArgumentException if the given name isn ' t in the
* set of extra tags currently recorded .
* @ see # addExtraTag */
public final void clearExtraTag ( final String name ) { } } | if ( extratags == null ) { throw new IllegalStateException ( "no extra tags added" ) ; } if ( extratags . get ( name ) == null ) { throw new IllegalArgumentException ( "tag '" + name + "' not in" + extratags ) ; } extratags . remove ( name ) ; |
public class WebPage { /** * Recursively gets the most recent modification time of a file or directory . */
public static long getLastModifiedRecursive ( File file ) { } } | long time = file . lastModified ( ) ; if ( file . isDirectory ( ) ) { String [ ] list = file . list ( ) ; if ( list != null ) { int len = list . length ; for ( int c = 0 ; c < len ; c ++ ) { long time2 = getLastModifiedRecursive ( new File ( file , list [ c ] ) ) ; if ( time2 > time ) time = time2 ; } } } return time ; |
public class DefaultURLTemplatesFactory { /** * Loads the template reference groups from a URL template config document .
* @ param parent */
private void loadTemplateRefGroups ( Element parent ) { } } | // Load template refs
List templateRefGroups = DomUtils . getChildElementsByName ( parent , URL_TEMPLATE_REF_GROUP ) ; ; for ( int i = 0 ; i < templateRefGroups . size ( ) ; i ++ ) { Element refGroupElement = ( Element ) templateRefGroups . get ( i ) ; String refGroupName = getElementText ( refGroupElement , NAME ) ; if ( refGroupName == null ) { _log . error ( "Malformed URL template descriptor in " + _configFilePath + ". The url-template-ref-group name is missing." ) ; continue ; } HashMap refGroup = new HashMap ( ) ; List templateRefs = DomUtils . getChildElementsByName ( refGroupElement , URL_TEMPLATE_REF ) ; ; for ( int j = 0 ; j < templateRefs . size ( ) ; j ++ ) { Element templateRefElement = ( Element ) templateRefs . get ( j ) ; String key = getElementText ( templateRefElement , KEY ) ; if ( key == null ) { _log . error ( "Malformed URL template descriptor in " + _configFilePath + ". The url-template-ref key is missing in url-template-ref-group " + refGroupName ) ; continue ; } String name = getElementText ( templateRefElement , TEMPLATE_NAME ) ; if ( name != null ) { refGroup . put ( key , name ) ; if ( _log . isDebugEnabled ( ) ) { _log . debug ( "[" + refGroupName + " URLTemplate] " + key + " = " + name ) ; } } else { _log . error ( "Malformed URL template descriptor in " + _configFilePath + ". The url-template-ref template-name is missing in url-template-ref-group " + refGroupName ) ; } } if ( refGroup . size ( ) != 0 ) { _urlTemplates . addTemplateRefGroup ( refGroupName , refGroup ) ; } } |
public class ServiceCall { /** * Creates new { @ link ServiceCall } ' s definition with a given router .
* @ param routerType given class of the router .
* @ return new { @ link ServiceCall } instance . */
public ServiceCall router ( Class < ? extends Router > routerType ) { } } | ServiceCall target = new ServiceCall ( this ) ; target . router = Routers . getRouter ( routerType ) ; return target ; |
public class InstantiationUtil { /** * Checks , whether the given class has a public nullary constructor .
* @ param clazz The class to check .
* @ return True , if the class has a public nullary constructor , false if not . */
public static boolean hasPublicNullaryConstructor ( Class < ? > clazz ) { } } | Constructor < ? > [ ] constructors = clazz . getConstructors ( ) ; for ( Constructor < ? > constructor : constructors ) { if ( constructor . getParameterTypes ( ) . length == 0 && Modifier . isPublic ( constructor . getModifiers ( ) ) ) { return true ; } } return false ; |
public class LogValueMapping { /** * ~ Methods * * * * * */
@ Override public Map < Long , Double > mapping ( Map < Long , Double > originalDatapoints ) { } } | List < String > constants = new ArrayList < String > ( ) ; constants . add ( "10" ) ; return mapping ( originalDatapoints , constants ) ; |
public class CmsHighlightingBorder { /** * Sets the border position . < p >
* @ param position the position data */
public void setPosition ( CmsPositionBean position ) { } } | setPosition ( position . getHeight ( ) , position . getWidth ( ) , position . getLeft ( ) , position . getTop ( ) ) ; |
public class PodsConfig { /** * public void addPodImpl ( PodConfig pod )
* Objects . requireNonNull ( pod ) ;
* _ podMap . put ( pod . getName ( ) , pod ) ;
* public Collection < PodConfig > getPods ( )
* return _ podMap . values ( ) ; */
public void setConfigException ( Exception e ) { } } | log . log ( Level . FINER , e . toString ( ) , e ) ; |
public class Equ { /** * gatherVariables .
* @ param tokens a { @ link java . util . Collection } object .
* @ return a { @ link java . util . Set } object . */
static public Set < String > gatherVariables ( final List < EquPart > tokens ) { } } | final Set < String > vars = new HashSet < > ( ) ; for ( final EquPart token : tokens ) if ( token instanceof TokVariable ) vars . add ( ( ( TokVariable ) token ) . getValue ( ) . toString ( ) ) ; return vars ; |
public class ArchiveBase { /** * Provides typesafe covariant return of this instance */
protected final T covariantReturn ( ) { } } | try { return this . getActualClass ( ) . cast ( this ) ; } catch ( final ClassCastException cce ) { log . log ( Level . SEVERE , "The class specified by getActualClass is not a valid assignment target for this instance;" + " developer error" ) ; throw cce ; } |
public class WebUtils { /** * Locates the ApplicationContext , returns null if not found
* @ param servletContext The servlet context
* @ return The ApplicationContext */
public static ApplicationContext findApplicationContext ( ServletContext servletContext ) { } } | if ( servletContext == null ) { return ContextLoader . getCurrentWebApplicationContext ( ) ; } return WebApplicationContextUtils . getWebApplicationContext ( servletContext ) ; |
public class SharedObject { /** * { @ inheritDoc } */
@ Override public boolean setAttributes ( Map < String , Object > values ) { } } | int successes = 0 ; if ( values != null ) { beginUpdate ( ) ; try { for ( Map . Entry < String , Object > entry : values . entrySet ( ) ) { if ( setAttribute ( entry . getKey ( ) , entry . getValue ( ) ) ) { successes ++ ; } } } finally { endUpdate ( ) ; } } // expect every value to have been added
return ( successes == values . size ( ) ) ; |
public class GetMetricStatisticsRequest { /** * The percentile statistics . Specify values between p0.0 and p100 . When calling < code > GetMetricStatistics < / code > ,
* you must specify either < code > Statistics < / code > or < code > ExtendedStatistics < / code > , but not both . Percentile
* statistics are not available for metrics when any of the metric values are negative numbers .
* @ param extendedStatistics
* The percentile statistics . Specify values between p0.0 and p100 . When calling
* < code > GetMetricStatistics < / code > , you must specify either < code > Statistics < / code > or
* < code > ExtendedStatistics < / code > , but not both . Percentile statistics are not available for metrics when
* any of the metric values are negative numbers . */
public void setExtendedStatistics ( java . util . Collection < String > extendedStatistics ) { } } | if ( extendedStatistics == null ) { this . extendedStatistics = null ; return ; } this . extendedStatistics = new com . amazonaws . internal . SdkInternalList < String > ( extendedStatistics ) ; |
public class ParamConvertUtils { /** * Creates a converter function that converts value into primitive type .
* @ return A converter function or { @ code null } if the given type is not primitive type or boxed type */
@ Nullable private static Converter < List < String > , Object > createPrimitiveTypeConverter ( final Class < ? > resultClass ) { } } | Object defaultValue = defaultValue ( resultClass ) ; if ( defaultValue == null ) { // For primitive type , the default value shouldn ' t be null
return null ; } return new BasicConverter ( defaultValue ) { @ Override protected Object convert ( String value ) throws Exception { return valueOf ( value , resultClass ) ; } } ; |
public class AbstractPrintQuery { /** * Method to get an table index from { @ link # sqlTable2Index } .
* @ param _ tableName tablename the index is wanted for
* @ param _ column name of the column , used for the relation
* @ param _ relIndex relation the table is used in
* @ param _ clazzId optional id of the classification
* @ return index of the table or null if not found */
public Integer getTableIndex ( final String _tableName , final String _column , final int _relIndex , final Long _clazzId ) { } } | return this . sqlTable2Index . get ( _relIndex + "__" + _tableName + "__" + _column + ( _clazzId == null ? "" : "__" + _clazzId ) ) ; |
public class Operation { /** * Learn whether { @ code operator } seems to implement { @ code this } .
* @ param operator to check
* @ return boolean */
public boolean matches ( Operator < ? > operator ) { } } | final Type expectedType = TypeUtils . unrollVariables ( TypeUtils . getTypeArguments ( operator . getClass ( ) , Operator . class ) , Operator . class . getTypeParameters ( ) [ 0 ] ) ; if ( ! TypeUtils . isInstance ( this , expectedType ) ) { return false ; } final Map < TypeVariable < ? > , Type > typeArguments = TypeUtils . getTypeArguments ( expectedType , Operation . class ) ; for ( Class < ? > c : ClassUtils . hierarchy ( TypeUtils . getRawType ( expectedType , operator . getClass ( ) ) ) ) { if ( c . equals ( Operation . class ) ) { break ; } for ( TypeVariable < ? > var : c . getTypeParameters ( ) ) { Type type = Types . resolveAt ( this , var , typeArguments ) ; if ( type == null || typeArguments == null ) { continue ; } if ( type instanceof Class < ? > && ( ( Class < ? > ) type ) . isPrimitive ( ) ) { type = ClassUtils . primitiveToWrapper ( ( Class < ? > ) type ) ; } if ( ! TypeUtils . isAssignable ( type , TypeUtils . unrollVariables ( typeArguments , var ) ) ) { return false ; } } } return true ; |
public class ListRepositoriesRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListRepositoriesRequest listRepositoriesRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listRepositoriesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listRepositoriesRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listRepositoriesRequest . getSortBy ( ) , SORTBY_BINDING ) ; protocolMarshaller . marshall ( listRepositoriesRequest . getOrder ( ) , ORDER_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class PairSet { /** * { @ inheritDoc } */
@ Override public int differenceSize ( Collection < ? extends Pair < T , I > > other ) { } } | return other == null ? ( int ) size ( ) : ( int ) matrix . differenceSize ( convert ( other ) . matrix ) ; |
public class DoubleStreamEx { /** * Folds the elements of this stream using the provided seed object and
* accumulation function , going left to right . This is equivalent to :
* < pre >
* { @ code
* double result = identity ;
* for ( double element : this stream )
* result = accumulator . apply ( result , element )
* return result ;
* < / pre >
* This is a terminal operation .
* This method cannot take all the advantages of parallel streams as it must
* process elements strictly left to right . If your accumulator function is
* associative , consider using { @ link # reduce ( double , DoubleBinaryOperator ) }
* method .
* For parallel stream it ' s not guaranteed that accumulator will always be
* executed in the same thread .
* @ param seed the starting value
* @ param accumulator a
* < a href = " package - summary . html # NonInterference " > non - interfering
* < / a > , < a href = " package - summary . html # Statelessness " > stateless < / a >
* function for incorporating an additional element into a result
* @ return the result of the folding
* @ see # reduce ( double , DoubleBinaryOperator )
* @ see # foldLeft ( DoubleBinaryOperator )
* @ since 0.4.0 */
public double foldLeft ( double seed , DoubleBinaryOperator accumulator ) { } } | double [ ] box = new double [ ] { seed } ; forEachOrdered ( t -> box [ 0 ] = accumulator . applyAsDouble ( box [ 0 ] , t ) ) ; return box [ 0 ] ; |
public class AxiomAssign { /** * An Ontology :
* - has always an URI as an attribute
* - may have an URI as ontologyLanguage
* - may have a naturalLanguage referenced as a literal
* - may have a versionNumber , as a literal
* may have N concepts as contained elements
* may have N instances as contained elements */
public boolean assignParsedElement ( Ontology parsedOntology , String syntaxElementName , ISyntaxElement syntaxElement ) throws ModelException { } } | if ( syntaxElementName . equalsIgnoreCase ( XMLSyntax . URI ( ) ) && syntaxElement instanceof SemanticIdentifier ) { parsedOntology . setSemanticIdentifier ( ( SemanticIdentifier ) syntaxElement ) ; return true ; } if ( syntaxElementName . equalsIgnoreCase ( XMLSyntax . ONTOLOGY_LANGUAGE ( ) ) && syntaxElement instanceof SemanticIdentifier ) { parsedOntology . setOntologyLanguage ( new MetaPropertyOntologyLanguage ( ( SemanticIdentifier ) syntaxElement ) ) ; return true ; } if ( syntaxElementName . equalsIgnoreCase ( XMLSyntax . NATURAL_LANGUAGE ( ) ) && syntaxElement instanceof SimpleProperty ) { parsedOntology . setNaturalLanguage ( new MetaPropertyNaturalLanguage ( ( ( SimpleProperty ) syntaxElement ) . getValue ( ) . toString ( ) ) ) ; return true ; } if ( syntaxElementName . equalsIgnoreCase ( XMLSyntax . VERSION_NUMBER ( ) ) && syntaxElement instanceof SimpleProperty ) { parsedOntology . setVersionNumber ( new MetaPropertyVersion ( ( ( SimpleProperty ) syntaxElement ) . getValue ( ) . toString ( ) ) ) ; return true ; } if ( syntaxElement instanceof Concept || syntaxElement instanceof Instance ) { ( ( SemanticAxiom ) syntaxElement ) . setOntology ( bsdlRegistry , parsedOntology . getSemanticIdentifier ( ) ) ; return true ; } return false ; |
public class CollectionUtil { /** * Returns an empty Collection if argument is null . * */
public static < T > Collection < T > nullToEmpty ( Collection < T > collection ) { } } | return collection == null ? Collections . < T > emptyList ( ) : collection ; |
public class hostcpu { /** * < pre >
* Performs generic data validation for the operation to be performed
* < / pre > */
protected void validate ( String operationType ) throws Exception { } } | super . validate ( operationType ) ; MPSString id_validator = new MPSString ( ) ; id_validator . setConstraintIsReq ( MPSConstants . DELETE_CONSTRAINT , true ) ; id_validator . setConstraintIsReq ( MPSConstants . MODIFY_CONSTRAINT , true ) ; id_validator . validate ( operationType , id , "\"id\"" ) ; MPSString uuid_validator = new MPSString ( ) ; uuid_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; uuid_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; uuid_validator . validate ( operationType , uuid , "\"uuid\"" ) ; MPSInt number_validator = new MPSInt ( ) ; number_validator . validate ( operationType , number , "\"number\"" ) ; MPSDouble cpu_usage_validator = new MPSDouble ( ) ; cpu_usage_validator . validate ( operationType , cpu_usage , "\"cpu_usage\"" ) ; MPSString vendor_validator = new MPSString ( ) ; vendor_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; vendor_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; vendor_validator . validate ( operationType , vendor , "\"vendor\"" ) ; MPSInt speed_validator = new MPSInt ( ) ; speed_validator . validate ( operationType , speed , "\"speed\"" ) ; MPSString modelname_validator = new MPSString ( ) ; modelname_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; modelname_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; modelname_validator . validate ( operationType , modelname , "\"modelname\"" ) ; MPSInt family_validator = new MPSInt ( ) ; family_validator . validate ( operationType , family , "\"family\"" ) ; MPSInt model_validator = new MPSInt ( ) ; model_validator . validate ( operationType , model , "\"model\"" ) ; MPSString stepping_validator = new MPSString ( ) ; stepping_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; stepping_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; stepping_validator . validate ( operationType , stepping , "\"stepping\"" ) ; MPSString flags_validator = new MPSString ( ) ; flags_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 512 ) ; flags_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; flags_validator . validate ( operationType , flags , "\"flags\"" ) ; MPSString features_validator = new MPSString ( ) ; features_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; features_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; features_validator . validate ( operationType , features , "\"features\"" ) ; |
public class TimeCategory { /** * Return a Duration representing the DST difference ( if any ) between two
* dates . i . e . if one date is before the DST changeover , and the other
* date is after , the resulting duration will represent the DST offset .
* @ param self a Date
* @ param other another Date
* @ return a Duration */
public static Duration getRelativeDaylightSavingsOffset ( Date self , Date other ) { } } | Duration d1 = getDaylightSavingsOffset ( self ) ; Duration d2 = getDaylightSavingsOffset ( other ) ; return new TimeDuration ( 0 , 0 , 0 , ( int ) ( d2 . toMilliseconds ( ) - d1 . toMilliseconds ( ) ) ) ; |
public class AmazonTextractClient { /** * Analyzes an input document for relationships between detected items .
* The types of information returned are as follows :
* < ul >
* < li >
* Words and lines that are related to nearby lines and words . The related information is returned in two
* < a > Block < / a > objects each of type < code > KEY _ VALUE _ SET < / code > : a KEY Block object and a VALUE Block object . For
* example , < i > Name : Ana Silva Carolina < / i > contains a key and value . < i > Name : < / i > is the key . < i > Ana Silva
* Carolina < / i > is the value .
* < / li >
* < li >
* Table and table cell data . A TABLE Block object contains information about a detected table . A CELL Block object
* is returned for each cell in a table .
* < / li >
* < li >
* Selectable elements such as checkboxes and radio buttons . A SELECTION _ ELEMENT Block object contains information
* about a selectable element .
* < / li >
* < li >
* Lines and words of text . A LINE Block object contains one or more WORD Block objects .
* < / li >
* < / ul >
* You can choose which type of analysis to perform by specifying the < code > FeatureTypes < / code > list .
* The output is returned in a list of < code > BLOCK < / code > objects .
* < code > AnalyzeDocument < / code > is a synchronous operation . To analyze documents asynchronously , use
* < a > StartDocumentAnalysis < / a > .
* For more information , see < a
* href = " https : / / docs . aws . amazon . com / textract / latest / dg / how - it - works - analyzing . html " > Document Text Analysis < / a > .
* @ param analyzeDocumentRequest
* @ return Result of the AnalyzeDocument operation returned by the service .
* @ throws InvalidParameterException
* An input parameter violated a constraint . For example , in synchronous operations , an
* < code > InvalidParameterException < / code > exception occurs when neither of the < code > S3Object < / code > or
* < code > Bytes < / code > values are supplied in the < code > Document < / code > request parameter . Validate your
* parameter before calling the API operation again .
* @ throws InvalidS3ObjectException
* Amazon Textract is unable to access the S3 object that ' s specified in the request .
* @ throws UnsupportedDocumentException
* The format of the input document isn ' t supported . Amazon Textract supports documents that are . png or
* . jpg format .
* @ throws DocumentTooLargeException
* The document can ' t be processed because it ' s too large . The maximum document size for synchronous
* operations 5 MB . The maximum document size for asynchronous operations is 500 MB for PDF format files .
* @ throws BadDocumentException
* Amazon Textract isn ' t able to read the document .
* @ throws AccessDeniedException
* You aren ' t authorized to perform the action .
* @ throws ProvisionedThroughputExceededException
* The number of requests exceeded your throughput limit . If you want to increase this limit , contact Amazon
* Textract .
* @ throws InternalServerErrorException
* Amazon Textract experienced a service issue . Try your call again .
* @ throws ThrottlingException
* Amazon Textract is temporarily unable to process the request . Try your call again .
* @ sample AmazonTextract . AnalyzeDocument
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / textract - 2018-06-27 / AnalyzeDocument " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public AnalyzeDocumentResult analyzeDocument ( AnalyzeDocumentRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeAnalyzeDocument ( request ) ; |
public class IniFile { /** * Sets the comments associated with a section .
* @ param pstrSection the section name
* @ param pstrComments the comments . */
public void addSection ( String pstrSection , String pstrComments ) { } } | INISection objSec = null ; objSec = ( INISection ) this . mhmapSections . get ( pstrSection ) ; if ( objSec == null ) { objSec = new INISection ( pstrSection ) ; this . mhmapSections . put ( pstrSection , objSec ) ; } objSec . setSecComments ( delRemChars ( pstrComments ) ) ; objSec = null ; |
public class WsAddressingHeaders { /** * Sets the message id from uri string .
* @ param messageId the messageId to set */
public void setMessageId ( String messageId ) { } } | try { this . messageId = new URI ( messageId ) ; } catch ( URISyntaxException e ) { throw new CitrusRuntimeException ( "Invalid messageId uri" , e ) ; } |
public class TagWizardController { /** * Add a tag for a single attribute
* @ param request the { @ link AddTagRequest } containing the entityTypeId , attributeName ,
* relationIRI and ontologyTermIRIs */
@ PostMapping ( "/tagattribute" ) public @ ResponseBody OntologyTag addTagAttribute ( @ Valid @ RequestBody AddTagRequest request ) { } } | return ontologyTagService . addAttributeTag ( request . getEntityTypeId ( ) , request . getAttributeName ( ) , request . getRelationIRI ( ) , request . getOntologyTermIRIs ( ) ) ; |
public class AccountManager { /** * Returns the instructions for creating a new account , or < tt > null < / tt > if there
* are no instructions . If present , instructions should be displayed to the end - user
* that will complete the registration process .
* @ return the account creation instructions , or < tt > null < / tt > if there are none .
* @ throws XMPPErrorException
* @ throws NoResponseException
* @ throws NotConnectedException
* @ throws InterruptedException */
public String getAccountInstructions ( ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { } } | if ( info == null ) { getRegistrationInfo ( ) ; } return info . getInstructions ( ) ; |
public class Indexer { /** * Gets the fully - qualified index metrics table name for the given table .
* @ param schema Schema name
* @ param table Table name
* @ return Qualified index metrics table name */
public static String getMetricsTableName ( String schema , String table ) { } } | return schema . equals ( "default" ) ? table + "_idx_metrics" : schema + '.' + table + "_idx_metrics" ; |
public class FromString { /** * Parses a string representing a type , that must be aligned with the current context .
* For example , < i > " List & lt ; T & gt ; " < / i > must be converted into the appropriate ClassNode
* for which < i > T < / i > matches the appropriate placeholder .
* @ param option a string representing a type
* @ param sourceUnit the source unit ( of the file being compiled )
* @ param compilationUnit the compilation unit ( of the file being compiled )
* @ param mn the method node
* @ param usage
* @ return a class node if it could be parsed and resolved , null otherwise */
private static ClassNode [ ] parseOption ( final String option , final SourceUnit sourceUnit , final CompilationUnit compilationUnit , final MethodNode mn , final ASTNode usage ) { } } | return GenericsUtils . parseClassNodesFromString ( option , sourceUnit , compilationUnit , mn , usage ) ; |
public class NormalizationChecker { /** * Returns < code > true < / code > if the argument starts with a composing
* character and < code > false < / code > otherwise .
* @ param str a string
* @ return < code > true < / code > if the argument starts with a composing
* character and < code > false < / code > otherwise .
* @ throws SAXException on malformed UTF - 16 */
public static boolean startsWithComposingChar ( String str ) throws SAXException { } } | if ( str . length ( ) == 0 ) { return false ; } int first32 ; char first = str . charAt ( 0 ) ; if ( UCharacter . isHighSurrogate ( first ) ) { try { char second = str . charAt ( 1 ) ; first32 = UCharacter . getCodePoint ( first , second ) ; } catch ( StringIndexOutOfBoundsException e ) { throw new SAXException ( "Malformed UTF-16!" ) ; } catch ( IllegalArgumentException e ) { // com . ibm . icu . lang . UCharacter . getCodePoint throws
// IllegalArgumentException if illegal surrogates found
throw new SAXException ( e . getMessage ( ) ) ; } } else { first32 = first ; } return isComposingChar ( first32 ) ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public PGDXpgBase createPGDXpgBaseFromString ( EDataType eDataType , String initialValue ) { } } | PGDXpgBase result = PGDXpgBase . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class CmsMultiDialog { /** * Returns the resources that are defined for the dialog operation . < p >
* For single resource operations , the list contains one item : the resource name found
* in the request parameter value of the " resource " parameter . < p >
* @ return the resources that are defined for the dialog operation */
public List < String > getResourceList ( ) { } } | if ( m_resourceList == null ) { // use lazy initializing
if ( getParamResourcelist ( ) != null ) { // found the resourcelist parameter
m_resourceList = CmsStringUtil . splitAsList ( getParamResourcelist ( ) , DELIMITER_RESOURCES , true ) ; Collections . sort ( m_resourceList ) ; } else { // this is a single resource operation , create list containing the resource name
m_resourceList = new ArrayList < String > ( 1 ) ; m_resourceList . add ( getParamResource ( ) ) ; } } return m_resourceList ; |
public class ConceptMention { /** * indexed getter for resourceEntryList - gets an indexed value -
* @ generated
* @ param i index in the array to get
* @ return value of the element at index i */
public ResourceEntry getResourceEntryList ( int i ) { } } | if ( ConceptMention_Type . featOkTst && ( ( ConceptMention_Type ) jcasType ) . casFeat_resourceEntryList == null ) jcasType . jcas . throwFeatMissing ( "resourceEntryList" , "de.julielab.jules.types.ConceptMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ConceptMention_Type ) jcasType ) . casFeatCode_resourceEntryList ) , i ) ; return ( ResourceEntry ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( ConceptMention_Type ) jcasType ) . casFeatCode_resourceEntryList ) , i ) ) ) ; |
public class DeviceStatus { /** * Checks whether there ' s a network connection .
* @ param context Context to use
* @ return true if there ' s an active network connection , false otherwise */
public static boolean isOnline ( Context context ) { } } | ConnectivityManager cm = ( ConnectivityManager ) context . getSystemService ( Context . CONNECTIVITY_SERVICE ) ; if ( cm == null ) { return false ; } NetworkInfo info = cm . getActiveNetworkInfo ( ) ; return info != null && info . isConnectedOrConnecting ( ) ; |
public class XmlEscape { /** * Perform a ( configurable ) XML 1.1 < strong > escape < / strong > operation on a < tt > String < / tt > input .
* This method will perform an escape operation according to the specified
* { @ link org . unbescape . xml . XmlEscapeType } and { @ link org . unbescape . xml . XmlEscapeLevel }
* argument values .
* All other < tt > String < / tt > - based < tt > escapeXml11 * ( . . . ) < / tt > methods call this one with preconfigured
* < tt > type < / tt > and < tt > level < / tt > values .
* This method is < strong > thread - safe < / strong > .
* @ param text the < tt > String < / tt > to be escaped .
* @ param type the type of escape operation to be performed , see { @ link org . unbescape . xml . XmlEscapeType } .
* @ param level the escape level to be applied , see { @ link org . unbescape . xml . XmlEscapeLevel } .
* @ return The escaped result < tt > String < / tt > . As a memory - performance improvement , will return the exact
* same object as the < tt > text < / tt > input argument if no escaping modifications were required ( and
* no additional < tt > String < / tt > objects will be created during processing ) . Will
* return < tt > null < / tt > if input is < tt > null < / tt > . */
public static String escapeXml11 ( final String text , final XmlEscapeType type , final XmlEscapeLevel level ) { } } | return escapeXml ( text , XmlEscapeSymbols . XML11_SYMBOLS , type , level ) ; |
public class SwitchPreference { /** * Obtains the text , which should be displayed on the preference ' s switch , when it is checked ,
* from a specific typed array .
* @ param typedArray
* The typed array , the text should be obtained from , as an instance of the class { @ link
* TypedArray } . The typed array may not be null */
private void obtainSwitchTextOn ( @ NonNull final TypedArray typedArray ) { } } | setSwitchTextOn ( typedArray . getText ( R . styleable . SwitchPreference_android_switchTextOn ) ) ; |
public class CommandLineArgumentParser { /** * Read an argument file and return a list of the args contained in it
* A line that starts with { @ link # ARGUMENT _ FILE _ COMMENT } is ignored .
* @ param argumentsFile a text file containing args
* @ return false if a fatal error occurred */
private List < String > loadArgumentsFile ( final String argumentsFile ) { } } | List < String > args = new ArrayList < > ( ) ; try ( BufferedReader reader = new BufferedReader ( new FileReader ( argumentsFile ) ) ) { String line ; while ( ( line = reader . readLine ( ) ) != null ) { if ( ! line . startsWith ( ARGUMENT_FILE_COMMENT ) && ! line . trim ( ) . isEmpty ( ) ) { args . addAll ( Arrays . asList ( StringUtils . split ( line ) ) ) ; } } } catch ( final IOException e ) { throw new CommandLineException ( "I/O error loading arguments file:" + argumentsFile , e ) ; } return args ; |
public class Utils { /** * Executes a command in another process and check for its execution result .
* @ param args array representation of the command to execute
* @ return { @ link ProcessExecutionResult } including the process ' s exit value , output and error */
public static ProcessExecutionResult getResultFromProcess ( String [ ] args ) { } } | try { Process process = Runtime . getRuntime ( ) . exec ( args ) ; StringBuilder outputSb = new StringBuilder ( ) ; try ( BufferedReader processOutputReader = new BufferedReader ( new InputStreamReader ( process . getInputStream ( ) ) ) ) { String line ; while ( ( line = processOutputReader . readLine ( ) ) != null ) { outputSb . append ( line ) ; outputSb . append ( LINE_SEPARATOR ) ; } } StringBuilder errorSb = new StringBuilder ( ) ; try ( BufferedReader processErrorReader = new BufferedReader ( new InputStreamReader ( process . getErrorStream ( ) ) ) ) { String line ; while ( ( line = processErrorReader . readLine ( ) ) != null ) { errorSb . append ( line ) ; errorSb . append ( LINE_SEPARATOR ) ; } } process . waitFor ( ) ; return new ProcessExecutionResult ( process . exitValue ( ) , outputSb . toString ( ) . trim ( ) , errorSb . toString ( ) . trim ( ) ) ; } catch ( IOException e ) { System . err . println ( "Failed to execute command." ) ; return new ProcessExecutionResult ( 1 , "" , e . getMessage ( ) ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; System . err . println ( "Interrupted." ) ; return new ProcessExecutionResult ( 1 , "" , e . getMessage ( ) ) ; } |
public class NBTrainingEngine { /** * Assume labels have equal probability . Not depends on the training data size . */
public void calculateLabelPrior ( ) { } } | double prior = 1D / model . labelIndexer . getLabelSize ( ) ; model . labelIndexer . getIndexSet ( ) . forEach ( labelIndex -> model . labelPrior . put ( labelIndex , prior ) ) ; |
public class DbEntityManager { /** * returns the object in the cache . if this object was loaded before ,
* then the original object is returned . */
protected DbEntity cacheFilter ( DbEntity persistentObject ) { } } | DbEntity cachedPersistentObject = dbEntityCache . get ( persistentObject . getClass ( ) , persistentObject . getId ( ) ) ; if ( cachedPersistentObject != null ) { return cachedPersistentObject ; } else { return persistentObject ; } |
public class ZonesInner { /** * Creates or updates a DNS zone . Does not modify DNS records within the zone .
* @ param resourceGroupName The name of the resource group .
* @ param zoneName The name of the DNS zone ( without a terminating dot ) .
* @ param parameters Parameters supplied to the CreateOrUpdate operation .
* @ param ifMatch The etag of the DNS zone . Omit this value to always overwrite the current zone . Specify the last - seen etag value to prevent accidentally overwritting any concurrent changes .
* @ param ifNoneMatch Set to ' * ' to allow a new DNS zone to be created , but to prevent updating an existing zone . Other values will be ignored .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < ZoneInner > createOrUpdateAsync ( String resourceGroupName , String zoneName , ZoneInner parameters , String ifMatch , String ifNoneMatch , final ServiceCallback < ZoneInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , zoneName , parameters , ifMatch , ifNoneMatch ) , serviceCallback ) ; |
public class NodeWriteTrx { /** * Setting a new name in the metapage .
* @ param pName
* to be set
* @ throws TTException */
private int insertName ( final String pName ) throws TTException { } } | final String string = ( pName == null ? "" : pName ) ; final int nameKey = NamePageHash . generateHashForString ( string ) ; NodeMetaPageFactory . MetaKey key = new NodeMetaPageFactory . MetaKey ( nameKey ) ; NodeMetaPageFactory . MetaValue value = new NodeMetaPageFactory . MetaValue ( string ) ; getPageWtx ( ) . getMetaBucket ( ) . put ( key , value ) ; return nameKey ; |
public class WriterFactoryImpl { /** * { @ inheritDoc } */
@ Override public AnnotationTypeWriter getAnnotationTypeWriter ( TypeElement annotationType , TypeMirror prevType , TypeMirror nextType ) { } } | return new AnnotationTypeWriterImpl ( configuration , annotationType , prevType , nextType ) ; |
public class ResourceFinder { /** * Reads the contents of the found URLs as a list of { @ link String } ' s and returns them .
* @ param uri
* @ return a list of the content of each resource URL found
* @ throws IOException if any of the found URLs are unable to be read . */
public List < String > findAllStrings ( String uri ) throws IOException { } } | String fulluri = path + uri ; List < String > strings = new ArrayList < > ( ) ; Enumeration < URL > resources = getResources ( fulluri ) ; while ( resources . hasMoreElements ( ) ) { URL url = resources . nextElement ( ) ; String string = readContents ( url ) ; strings . add ( string ) ; } return strings ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertPPORGObjTypeToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class Uploader { /** * Test this class by uploading the given file three times . First , with the
* provided credentials , as an InputStream . Second , with the provided
* credentials , as a File . Third , with bogus credentials , as a File . */
public static void main ( String [ ] args ) { } } | try { if ( args . length == 5 || args . length == 6 ) { String protocol = args [ 0 ] ; int port = Integer . parseInt ( args [ 1 ] ) ; String user = args [ 2 ] ; String password = args [ 3 ] ; String fileName = args [ 4 ] ; String context = Constants . FEDORA_DEFAULT_APP_CONTEXT ; if ( args . length == 6 && ! args [ 5 ] . isEmpty ( ) ) { context = args [ 5 ] ; } Uploader uploader = new Uploader ( protocol , port , context , user , password ) ; File f = new File ( fileName ) ; System . out . println ( uploader . upload ( new FileInputStream ( f ) ) ) ; System . out . println ( uploader . upload ( f ) ) ; uploader = new Uploader ( protocol , port , context , user + "test" , password ) ; System . out . println ( uploader . upload ( f ) ) ; } else { System . err . println ( "Usage: Uploader host port user password file [context]" ) ; } } catch ( Exception e ) { System . err . println ( "ERROR: " + e . getMessage ( ) ) ; } |
public class SvnWorkspaceProviderImpl { /** * Deletes all of the Directories in root that match the FileFilter
* @ param root
* @ param filter */
private static void deleteUserDirectories ( final File root , final FileFilter filter ) { } } | final File [ ] dirs = root . listFiles ( filter ) ; LOGGER . info ( "Identified (" + dirs . length + ") directories to delete" ) ; for ( final File dir : dirs ) { LOGGER . info ( "Deleting " + dir ) ; if ( ! FileUtils . deleteQuietly ( dir ) ) { LOGGER . info ( "Failed to delete directory " + dir ) ; } } |
public class BinaryValue { /** * Create a BinaryValue containing a copy of the supplied string
* encoded using the supplied Charset .
* @ param data the data to copy
* @ param charset the charset to use for encoding
* @ return a new { @ code BinaryValue } */
public static BinaryValue create ( String data , Charset charset ) { } } | byte [ ] bytes = null ; if ( data != null ) { bytes = data . getBytes ( charset ) ; } return new BinaryValue ( bytes ) ; |
public class CPDefinitionVirtualSettingModelImpl { /** * Converts the soap model instances into normal model instances .
* @ param soapModels the soap model instances to convert
* @ return the normal model instances */
public static List < CPDefinitionVirtualSetting > toModels ( CPDefinitionVirtualSettingSoap [ ] soapModels ) { } } | if ( soapModels == null ) { return null ; } List < CPDefinitionVirtualSetting > models = new ArrayList < CPDefinitionVirtualSetting > ( soapModels . length ) ; for ( CPDefinitionVirtualSettingSoap soapModel : soapModels ) { models . add ( toModel ( soapModel ) ) ; } return models ; |
public class WsFederationResponseValidator { /** * Validate ws federation authentication request event .
* @ param context the context */
public void validateWsFederationAuthenticationRequest ( final RequestContext context ) { } } | val service = wsFederationCookieManager . retrieve ( context ) ; LOGGER . debug ( "Retrieved service [{}] from the session cookie" , service ) ; val request = WebUtils . getHttpServletRequestFromExternalWebflowContext ( context ) ; val wResult = request . getParameter ( WRESULT ) ; LOGGER . debug ( "Parameter [{}] received: [{}]" , WRESULT , wResult ) ; if ( StringUtils . isBlank ( wResult ) ) { LOGGER . error ( "No [{}] parameter is found" , WRESULT ) ; throw new IllegalArgumentException ( "Missing parameter " + WRESULT ) ; } LOGGER . debug ( "Attempting to create an assertion from the token parameter" ) ; val rsToken = wsFederationHelper . getRequestSecurityTokenFromResult ( wResult ) ; val assertion = wsFederationHelper . buildAndVerifyAssertion ( rsToken , configurations ) ; if ( assertion == null ) { LOGGER . error ( "Could not validate assertion via parsing the token from [{}]" , WRESULT ) ; throw new IllegalArgumentException ( "Could not validate assertion via the provided token" ) ; } LOGGER . debug ( "Attempting to validate the signature on the assertion" ) ; if ( ! wsFederationHelper . validateSignature ( assertion ) ) { val msg = "WS Requested Security Token is blank or the signature is not valid." ; LOGGER . error ( msg ) ; throw new IllegalArgumentException ( msg ) ; } buildCredentialsFromAssertion ( context , assertion , service ) ; |
public class IntHashSet { /** * { @ inheritDoc } */
@ SuppressWarnings ( "unchecked" ) public < T > T [ ] toArray ( final T [ ] a ) { } } | final Class < ? > componentType = a . getClass ( ) . getComponentType ( ) ; if ( ! componentType . isAssignableFrom ( Integer . class ) ) { throw new ArrayStoreException ( "cannot store Integers in array of type " + componentType ) ; } @ DoNotSub final int size = size ( ) ; final T [ ] arrayCopy = a . length >= size ? a : ( T [ ] ) Array . newInstance ( componentType , size ) ; copyValues ( arrayCopy ) ; return arrayCopy ; |
public class JCudnn { /** * Fused conv / bias / activation operation : y = Act ( alpha1 * conv ( x ) + alpha2 * z + bias ) */
public static int cudnnConvolutionBiasActivationForward ( cudnnHandle handle , Pointer alpha1 , cudnnTensorDescriptor xDesc , Pointer x , cudnnFilterDescriptor wDesc , Pointer w , cudnnConvolutionDescriptor convDesc , int algo , Pointer workSpace , long workSpaceSizeInBytes , Pointer alpha2 , cudnnTensorDescriptor zDesc , Pointer z , cudnnTensorDescriptor biasDesc , Pointer bias , cudnnActivationDescriptor activationDesc , cudnnTensorDescriptor yDesc , Pointer y ) { } } | return checkResult ( cudnnConvolutionBiasActivationForwardNative ( handle , alpha1 , xDesc , x , wDesc , w , convDesc , algo , workSpace , workSpaceSizeInBytes , alpha2 , zDesc , z , biasDesc , bias , activationDesc , yDesc , y ) ) ; |
public class TwoPhaseCommitSinkFunction { /** * Enables logging of warnings if a transaction ' s elapsed time reaches a specified ratio of
* the < code > transactionTimeout < / code > .
* If < code > warningRatio < / code > is 0 , a warning will be always logged when committing the
* transaction .
* @ param warningRatio A value in the range [ 0,1 ] .
* @ return */
protected TwoPhaseCommitSinkFunction < IN , TXN , CONTEXT > enableTransactionTimeoutWarnings ( double warningRatio ) { } } | checkArgument ( warningRatio >= 0 && warningRatio <= 1 , "warningRatio must be in range [0,1]" ) ; this . transactionTimeoutWarningRatio = warningRatio ; return this ; |
public class FlowTriggerScheduler { /** * Unschedule all possible flows in a project */
public void unschedule ( final Project project ) throws SchedulerException { } } | for ( final Flow flow : project . getFlows ( ) ) { if ( ! flow . isEmbeddedFlow ( ) ) { try { if ( this . scheduler . unscheduleJob ( FlowTriggerQuartzJob . JOB_NAME , generateGroupName ( flow ) ) ) { logger . info ( "Flow {}.{} unregistered from scheduler" , project . getName ( ) , flow . getId ( ) ) ; } } catch ( final SchedulerException e ) { logger . error ( "Fail to unregister flow from scheduler {}.{}" , project . getName ( ) , flow . getId ( ) , e ) ; throw e ; } } } |
public class FastdfsService { /** * 下载文件
* @ param fullFilename 文件路径
* @ return */
public byte [ ] downLoadFile ( String fullFilename ) { } } | byte [ ] data = null ; TrackerServer trackerServer = null ; StorageClient1 storageClient1 = null ; try { trackerServer = fastDfsClientPool . borrowObject ( ) ; storageClient1 = new StorageClient1 ( trackerServer , null ) ; data = storageClient1 . downloadFile1 ( fullFilename ) ; } catch ( Exception e ) { throw Lang . makeThrow ( "[FastdfsService] download file error : %s" , e . getMessage ( ) ) ; } finally { if ( trackerServer != null ) fastDfsClientPool . returnObject ( trackerServer ) ; storageClient1 = null ; } return data ; |
public class StreamProjection { /** * Projects a { @ link Tuple } { @ link DataStream } to the previously selected fields .
* @ return The projected DataStream .
* @ see Tuple
* @ see DataStream */
public < T0 , T1 , T2 , T3 , T4 , T5 > SingleOutputStreamOperator < Tuple6 < T0 , T1 , T2 , T3 , T4 , T5 > > projectTuple6 ( ) { } } | TypeInformation < ? > [ ] fTypes = extractFieldTypes ( fieldIndexes , dataStream . getType ( ) ) ; TupleTypeInfo < Tuple6 < T0 , T1 , T2 , T3 , T4 , T5 > > tType = new TupleTypeInfo < Tuple6 < T0 , T1 , T2 , T3 , T4 , T5 > > ( fTypes ) ; return dataStream . transform ( "Projection" , tType , new StreamProject < IN , Tuple6 < T0 , T1 , T2 , T3 , T4 , T5 > > ( fieldIndexes , tType . createSerializer ( dataStream . getExecutionConfig ( ) ) ) ) ; |
public class GenomicsUtils { /** * Gets the ReferenceSetId for a given readGroupSetId using the Genomics API .
* @ param readGroupSetId The id of the readGroupSet to query .
* @ param auth The OfflineAuth for the API request .
* @ return The referenceSetId for the redGroupSet ( which may be null ) .
* @ throws IOException */
public static String getReferenceSetId ( String readGroupSetId , OfflineAuth auth ) throws IOException { } } | Genomics genomics = GenomicsFactory . builder ( ) . build ( ) . fromOfflineAuth ( auth ) ; ReadGroupSet readGroupSet = genomics . readgroupsets ( ) . get ( readGroupSetId ) . setFields ( "referenceSetId" ) . execute ( ) ; return readGroupSet . getReferenceSetId ( ) ; |
public class AWSCostExplorerClient { /** * Retrieves a forecast for how much Amazon Web Services predicts that you will spend over the forecast time period
* that you select , based on your past costs .
* @ param getCostForecastRequest
* @ return Result of the GetCostForecast operation returned by the service .
* @ throws LimitExceededException
* You made too many calls in a short period of time . Try again later .
* @ throws DataUnavailableException
* The requested data is unavailable .
* @ sample AWSCostExplorer . GetCostForecast
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ce - 2017-10-25 / GetCostForecast " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public GetCostForecastResult getCostForecast ( GetCostForecastRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeGetCostForecast ( request ) ; |
public class DelegatedClientFactory { /** * Build set of clients configured .
* @ return the set */
public Set < BaseClient > build ( ) { } } | val clients = new LinkedHashSet < BaseClient > ( ) ; configureCasClient ( clients ) ; configureFacebookClient ( clients ) ; configureOidcClient ( clients ) ; configureOAuth20Client ( clients ) ; configureSamlClient ( clients ) ; configureTwitterClient ( clients ) ; configureDropBoxClient ( clients ) ; configureFoursquareClient ( clients ) ; configureGitHubClient ( clients ) ; configureGoogleClient ( clients ) ; configureWindowsLiveClient ( clients ) ; configureYahooClient ( clients ) ; configureLinkedInClient ( clients ) ; configurePayPalClient ( clients ) ; configureWordPressClient ( clients ) ; configureBitBucketClient ( clients ) ; configureOrcidClient ( clients ) ; configureHiOrgServerClient ( clients ) ; return clients ; |
public class ExchangeUtils { /** * Copies variables from Camel into the process engine .
* This method will conditionally copy the Camel body to the " camelBody "
* variable if it is of type java . lang . String , OR it will copy the Camel
* body to individual variables within the process engine if it is of type
* Map < String , Object > . If the copyVariablesFromProperties parameter is set
* on the endpoint , the properties are copied instead
* @ param exchange
* The Camel Exchange object
* @ param parameters
* @ return A Map < String , Object > containing all of the variables to be used
* in the process engine */
@ SuppressWarnings ( "rawtypes" ) public static Map < String , Object > prepareVariables ( Exchange exchange , Map < String , Object > parameters ) { } } | Map < String , Object > processVariables = new HashMap < String , Object > ( ) ; Object camelBody = exchange . getIn ( ) . getBody ( ) ; if ( camelBody instanceof String ) { // If the COPY _ MESSAGE _ BODY _ AS _ PROCESS _ VARIABLE _ PARAMETER was passed
// the value of it
// is taken as variable to store the ( string ) body in
String processVariableName = "camelBody" ; if ( parameters . containsKey ( CamundaBpmConstants . COPY_MESSAGE_BODY_AS_PROCESS_VARIABLE_PARAMETER ) ) { processVariableName = ( String ) parameters . get ( CamundaBpmConstants . COPY_MESSAGE_BODY_AS_PROCESS_VARIABLE_PARAMETER ) ; } processVariables . put ( processVariableName , camelBody ) ; } else if ( camelBody instanceof Map < ? , ? > ) { Map < ? , ? > camelBodyMap = ( Map < ? , ? > ) camelBody ; for ( Map . Entry e : camelBodyMap . entrySet ( ) ) { if ( e . getKey ( ) instanceof String ) { processVariables . put ( ( String ) e . getKey ( ) , e . getValue ( ) ) ; } } } else if ( camelBody != null ) { log . log ( Level . WARNING , "unkown type of camel body - not handed over to process engine: " + camelBody . getClass ( ) ) ; } return processVariables ; |
public class InternalPureXbaseParser { /** * $ ANTLR start synpred1 _ InternalPureXbase */
public final void synpred1_InternalPureXbase_fragment ( ) throws RecognitionException { } } | // InternalPureXbase . g : 307:6 : ( ' catch ' | ' finally ' )
// InternalPureXbase . g :
{ if ( input . LA ( 1 ) == 17 || input . LA ( 1 ) == 81 ) { input . consume ( ) ; state . errorRecovery = false ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; throw mse ; } } |
public class FileIoUtil { /** * Trys to read a properties file .
* Returns null if properties file could not be loaded
* @ param _ file
* @ return Properties Object or null */
public static Properties readProperties ( File _file ) { } } | if ( _file . exists ( ) ) { try { return readProperties ( new FileInputStream ( _file ) ) ; } catch ( FileNotFoundException _ex ) { LOGGER . info ( "Could not load properties file: " + _file , _ex ) ; } } return null ; |
public class Cryptor { /** * an encrypt method that takes a byte - array for input and returns an encrypted byte - array */
public static byte [ ] encrypt ( byte [ ] input , String key , String algorithm , byte [ ] ivOrSalt , int iterations ) throws PageException { } } | return crypt ( input , key , algorithm , ivOrSalt , iterations , false ) ; |
public class HttpRequestMessageImpl { /** * Parse the scheme marker out of the input data and then start the parse
* for the next section . If any errors are encountered , then an exception
* is thrown .
* @ param data
* @ throws IllegalArgumentException */
private void parseScheme ( byte [ ] data ) { } } | // we know the first character is correct , find the colon
for ( int i = 1 ; i < data . length ; i ++ ) { if ( ':' == data [ i ] ) { SchemeValues val = SchemeValues . match ( data , 0 , i ) ; if ( null == val ) { throw new IllegalArgumentException ( "Invalid scheme inside URL: " + GenericUtils . getEnglishString ( data ) ) ; } setScheme ( val ) ; // scheme should be followed by " : / / "
if ( ( i + 2 ) >= data . length || ( '/' != data [ i + 1 ] || '/' != data [ i + 2 ] ) ) { throw new IllegalArgumentException ( "Invalid net_path: " + GenericUtils . getEnglishString ( data ) ) ; } parseAuthority ( data , i + 3 ) ; return ; } } // no colon found
throw new IllegalArgumentException ( "Invalid scheme in URL: " + GenericUtils . getEnglishString ( data ) ) ; |
public class SelPrefWordsiMain { /** * { @ inheritDoc } */
protected DependencyContextGenerator getContextGenerator ( ) { } } | StructuredVectorSpace svs = SerializableUtil . load ( new File ( argOptions . getStringOption ( 'l' ) ) ) ; return new SelPrefDependencyContextGenerator ( svs ) ; |
public class Base64 { /** * Very low - level access to decoding ASCII characters in
* the form of a byte array .
* @ param source the Base64 encoded data
* @ param off the offset of where to begin decoding
* @ param len the length of characters to decode
* @ return decoded data */
public final byte [ ] decode ( byte [ ] source , int off , int len ) { } } | int len34 = len * 3 / 4 ; byte [ ] outBuff = new byte [ len34 ] ; // upper limit on size of output
int outBuffPosn = 0 ; byte [ ] b4 = new byte [ 4 ] ; int b4Posn = 0 ; int i = 0 ; byte sbiCrop = 0 ; byte sbiDecode = 0 ; for ( i = off ; i < off + len ; i ++ ) { sbiCrop = ( byte ) ( source [ i ] & 0x7f ) ; // only the low seven bits
sbiDecode = DECODABET [ sbiCrop ] ; if ( sbiDecode >= WHITE_SPACE_ENC ) { // white space , equals sign or better
if ( sbiDecode >= PADDING_CHAR_ENC ) { b4 [ b4Posn ++ ] = sbiCrop ; if ( b4Posn > 3 ) { outBuffPosn += decode4to3 ( b4 , 0 , outBuff , outBuffPosn ) ; b4Posn = 0 ; // if that was the padding char , break out of ' for ' loop
if ( sbiCrop == PADDING_CHAR ) { break ; } } // end if : quartet built
} // end if : equals sign or better
} // end if : white space , equals sign or better
else { // discard
} } // each input character
byte [ ] out = new byte [ outBuffPosn ] ; System . arraycopy ( outBuff , 0 , out , 0 , outBuffPosn ) ; return out ; |
public class AbstractAmazonSNSAsync { /** * Simplified method form for invoking the RemovePermission operation with an AsyncHandler .
* @ see # removePermissionAsync ( RemovePermissionRequest , com . amazonaws . handlers . AsyncHandler ) */
@ Override public java . util . concurrent . Future < RemovePermissionResult > removePermissionAsync ( String topicArn , String label , com . amazonaws . handlers . AsyncHandler < RemovePermissionRequest , RemovePermissionResult > asyncHandler ) { } } | return removePermissionAsync ( new RemovePermissionRequest ( ) . withTopicArn ( topicArn ) . withLabel ( label ) , asyncHandler ) ; |
public class CmsSystemConfiguration { /** * Sets the configured login manager . < p >
* @ param maxBadAttemptsStr the number of allowed bad login attempts
* @ param disableMinutesStr the time an account gets locked if to many bad logins are attempted
* @ param enableSecurityStr flag to determine if the security option should be enabled on the login dialog
* @ param tokenLifetime the token lifetime
* @ param maxInactive maximum time since last login before CmsLockInactiveAccountsJob locks an account
* @ param passwordChangeInterval the password change interval
* @ param userDataCheckInterval the user data check interval */
public void setLoginManager ( String disableMinutesStr , String maxBadAttemptsStr , String enableSecurityStr , String tokenLifetime , String maxInactive , String passwordChangeInterval , String userDataCheckInterval ) { } } | int disableMinutes ; try { disableMinutes = Integer . valueOf ( disableMinutesStr ) . intValue ( ) ; } catch ( NumberFormatException e ) { disableMinutes = CmsLoginManager . DISABLE_MINUTES_DEFAULT ; } int maxBadAttempts ; try { maxBadAttempts = Integer . valueOf ( maxBadAttemptsStr ) . intValue ( ) ; } catch ( NumberFormatException e ) { maxBadAttempts = CmsLoginManager . MAX_BAD_ATTEMPTS_DEFAULT ; } boolean enableSecurity = Boolean . valueOf ( enableSecurityStr ) . booleanValue ( ) ; m_loginManager = new CmsLoginManager ( disableMinutes , maxBadAttempts , enableSecurity , tokenLifetime , maxInactive , passwordChangeInterval , userDataCheckInterval ) ; if ( CmsLog . INIT . isInfoEnabled ( ) ) { CmsLog . INIT . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_LOGINMANAGER_3 , new Integer ( disableMinutes ) , new Integer ( maxBadAttempts ) , new Boolean ( enableSecurity ) ) ) ; } |
public class DB { /** * Log simple assertion .
* @ param callInfo Call info .
* @ param sa Simple assertion . */
void log ( CallInfo callInfo , SimpleAssertion sa ) { } } | if ( isEnabled ( Option . LOG_ASSERTIONS ) || ( ! sa . passed ( ) && isEnabled ( Option . LOG_ASSERTION_ERRORS ) ) ) { log . write ( callInfo , sa ) ; } |
public class MemoryStore { /** * { @ inheritDoc } */
@ Override public void save ( T item ) { } } | Serializable idValue = getOrGenerateIdValue ( item ) ; save ( idValue , item ) ; |
public class FractionNumber { /** * 分母の指定した桁以降の値を取得する 。
* @ param digit 1から始まる
* @ return 存在しない桁の場合は空文字を返す 。 */
public String getDenominatorPartAfter ( final int digit ) { } } | final int length = denominatorPart . length ( ) ; if ( length < digit || digit <= 0 ) { return "" ; } return denominatorPart . substring ( 0 , ( length - digit + 1 ) ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.