signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class IfcSoundPropertiesImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcSoundValue > getSoundValues ( ) { } }
return ( EList < IfcSoundValue > ) eGet ( Ifc2x3tc1Package . Literals . IFC_SOUND_PROPERTIES__SOUND_VALUES , true ) ;
public class IntegerDateElement { /** * < p > Erzeugt ein neues Datumselement . < / p > * @ param name name of element * @ param index index of element * @ param dmin default minimum * @ param dmax default maximum * @ param symbol format symbol * @ return new element instance */ static IntegerDateElement cr...
return new IntegerDateElement ( name , index , Integer . valueOf ( dmin ) , Integer . valueOf ( dmax ) , symbol ) ;
public class AuditLogger { /** * Opens our log file , sets up our print writer and writes a message to it indicating that it * was opened . */ protected void openLog ( boolean freakout ) { } }
try { // create our file writer to which we ' ll log FileOutputStream fout = new FileOutputStream ( _logPath , true ) ; OutputStreamWriter writer = new OutputStreamWriter ( fout , "UTF8" ) ; _logWriter = new PrintWriter ( new BufferedWriter ( writer ) , true ) ; // log a standard message log ( "log_opened " + _logPath ...
public class cmpaction { /** * Use this API to fetch filtered set of cmpaction resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static cmpaction [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
cmpaction obj = new cmpaction ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; cmpaction [ ] response = ( cmpaction [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class RegexpOnFilenameOrgCheck { /** * Setter . * @ param pSelection the new value of { @ link # selection } */ public void setSelection ( final String pSelection ) { } }
if ( pSelection != null && pSelection . length ( ) > 0 ) { selection = Pattern . compile ( pSelection ) ; }
public class ContainerTracker { /** * Register a started container to this tracker * @ param containerId container id to register * @ param imageConfig configuration of associated image * @ param gavLabel pom label to identifying the reactor project where the container was created */ public synchronized void regi...
ContainerShutdownDescriptor descriptor = new ContainerShutdownDescriptor ( imageConfig , containerId ) ; shutdownDescriptorPerContainerMap . put ( containerId , descriptor ) ; updatePomLabelMap ( gavLabel , descriptor ) ; updateImageToContainerMapping ( imageConfig , containerId ) ;
public class AmazonApiGatewayV2Client { /** * Creates a RouteResponse for a Route . * @ param createRouteResponseRequest * @ return Result of the CreateRouteResponse operation returned by the service . * @ throws NotFoundException * The resource specified in the request was not found . * @ throws TooManyReque...
request = beforeClientExecution ( request ) ; return executeCreateRouteResponse ( request ) ;
public class Primitives { /** * Returns the corresponding primitive type of { @ code type } if it is a wrapper type ; otherwise * returns { @ code type } itself . Idempotent . * < pre > * unwrap ( Integer . class ) = = int . class * unwrap ( int . class ) = = int . class * unwrap ( String . class ) = = String...
N . checkArgNotNull ( cls , "cls" ) ; Class < ? > unwrapped = PRIMITIVE_2_WRAPPER . getByValue ( cls ) ; return unwrapped == null ? cls : unwrapped ;
public class CmsIdentifiableObjectContainer { /** * Resets the container . < p > */ public void clear ( ) { } }
m_cache = null ; m_objectList . clear ( ) ; m_objectsById . clear ( ) ; m_orderedObjectList . clear ( ) ; m_objectsListsById . clear ( ) ;
public class Blade { /** * Add a after route to routes , the before route will be executed after matching route * @ param path your route path * @ param handler route implement * @ return return blade instance * @ see # after ( String , RouteHandler ) */ @ Deprecated public Blade after ( @ NonNull String path ,...
this . routeMatcher . addRoute ( path , handler , HttpMethod . AFTER ) ; return this ;
public class NonBlockingBitOutputStream { /** * Write a single bit to the stream . It will only be flushed to the underlying * OutputStream when a byte has been completed or when flush ( ) manually . * @ param aBit * 1 if the bit should be set , 0 if not * @ throws IOException * In case writing to the output ...
if ( m_aOS == null ) throw new IllegalStateException ( "BitOutputStream is already closed" ) ; if ( aBit != CGlobal . BIT_NOT_SET && aBit != CGlobal . BIT_SET ) throw new IllegalArgumentException ( aBit + " is not a bit" ) ; if ( aBit == CGlobal . BIT_SET ) if ( m_bHighOrderBitFirst ) m_nBuffer |= ( aBit << ( 7 - m_nBu...
public class ProtoParser { /** * Reads an integer and returns it . */ private int readInt ( ) { } }
String tag = readWord ( ) ; try { int radix = 10 ; if ( tag . startsWith ( "0x" ) || tag . startsWith ( "0X" ) ) { tag = tag . substring ( "0x" . length ( ) ) ; radix = 16 ; } return Integer . valueOf ( tag , radix ) ; } catch ( Exception e ) { throw unexpected ( "expected an integer but was " + tag ) ; }
public class FingerprintGenerator { /** * Generate a fingerprint based on class and method * @ param cl The class * @ param m The method * @ return The fingerprint generated */ public static String fingerprint ( Class cl , Method m ) { } }
return fingerprint ( cl , m . getName ( ) ) ;
public class ClassicAuthenticator { /** * Sets the { @ link CredentialContext # CLUSTER _ MANAGEMENT } credential . Specific is ignored in this context . * @ param adminName the administrative login to use . * @ param adminPassword the administrative password to use . * @ return this { @ link ClassicAuthenticator...
this . clusterManagementCredential = new Credential ( adminName , adminPassword ) ; return this ;
public class AbstrCFMLScriptTransformer { /** * Prueft ob sich der Zeiger am Ende eines Script Blockes befindet * @ return Ende ScriptBlock ? * @ throws TemplateException */ private final boolean isFinish ( Data data ) throws TemplateException { } }
comments ( data ) ; if ( data . tagName == null ) return false ; return data . srcCode . isCurrent ( "</" , data . tagName ) ;
public class EUI64 { /** * Creates a { @ link EUI64 } from a string standard representation in { @ code name } . The standard * representation is eight groups of two hexadecimal digits , separated by hyphens ( { @ code - } ) or * colons ( { @ code : } ) , in transmission order . * @ param name The string represen...
long bits = 0 ; char sep = 0 ; for ( int n = 0 ; ; ++ n ) { if ( n == name . length ( ) ) { if ( n == 23 ) { return new EUI64 ( bits ) ; } else { break ; } } char c = name . charAt ( n ) ; if ( n == 2 ) { if ( c != ':' && c != '-' ) { break ; } sep = c ; } else if ( ( n - 2 ) % 3 == 0 ) { if ( c != sep ) { break ; } } ...
public class BeansImpl { /** * If not already created , a new < code > decorators < / code > element will be created and returned . * Otherwise , the first existing < code > decorators < / code > element will be returned . * @ return the instance defined for the element < code > decorators < / code > */ public Deco...
List < Node > nodeList = childNode . get ( "decorators" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new DecoratorsImpl < Beans < T > > ( this , "decorators" , childNode , nodeList . get ( 0 ) ) ; } return createDecorators ( ) ;
public class ListServiceSpecificCredentialsResult { /** * A list of structures that each contain details about a service - specific credential . * @ param serviceSpecificCredentials * A list of structures that each contain details about a service - specific credential . */ public void setServiceSpecificCredentials ...
if ( serviceSpecificCredentials == null ) { this . serviceSpecificCredentials = null ; return ; } this . serviceSpecificCredentials = new com . amazonaws . internal . SdkInternalList < ServiceSpecificCredentialMetadata > ( serviceSpecificCredentials ) ;
public class Processor { /** * Creates a Source Processor * @ param source the data source itself * @ param parallelism the parallelism of this processor * @ param description the description of this processor * @ param taskConf the configuration of this processor * @ param system actor system * @ return th...
io . gearpump . streaming . Processor < DataSourceTask < Object , Object > > p = DataSourceProcessor . apply ( source , parallelism , description , taskConf , system ) ; return new Processor ( p ) ;
public class SecurityContextImpl { /** * After deserializing the security context , re - inflate the subjects ( need to add the missing credentials , since these don ' t get serialized ) * @ param securityService the security service to use for authenticating the user * @ param unauthenticatedSubjectServiceRef refe...
callerSubject = recreateFullSubject ( callerPrincipal , securityService , unauthenticatedSubjectServiceRef , callerSubjectCacheKey ) ; if ( ! subjectsAreEqual ) { invocationSubject = recreateFullSubject ( invocationPrincipal , securityService , unauthenticatedSubjectServiceRef , invocationSubjectCacheKey ) ; } else { i...
public class MPXWriter { /** * This method is called to format a task type . * @ param value task type value * @ return formatted task type */ private String formatTaskType ( TaskType value ) { } }
return ( LocaleData . getString ( m_locale , ( value == TaskType . FIXED_DURATION ? LocaleData . YES : LocaleData . NO ) ) ) ;
public class Layout { /** * Layout children inside the layout container */ public void layoutChildren ( ) { } }
Set < Integer > copySet ; synchronized ( mMeasuredChildren ) { Log . d ( Log . SUBSYSTEM . LAYOUT , TAG , "layoutChildren [%d] layout = %s" , mMeasuredChildren . size ( ) , this ) ; copySet = new HashSet < > ( mMeasuredChildren ) ; } for ( int nextMeasured : copySet ) { Widget child = mContainer . get ( nextMeasured ) ...
public class KeydefFilter { /** * Parse the keys attributes . * @ param atts all attributes */ private void handleKeysAttr ( final Attributes atts ) { } }
final String attrValue = atts . getValue ( ATTRIBUTE_NAME_KEYS ) ; if ( attrValue != null ) { URI target = toURI ( atts . getValue ( ATTRIBUTE_NAME_HREF ) ) ; final URI copyTo = toURI ( atts . getValue ( ATTRIBUTE_NAME_COPY_TO ) ) ; if ( copyTo != null ) { target = copyTo ; } final String keyRef = atts . getValue ( ATT...
public class NettyHttpResponseFactory { /** * Lookup the response from the context . * @ param request The context * @ return The { @ link NettyMutableHttpResponse } */ @ Internal public static NettyMutableHttpResponse getOrCreate ( NettyHttpRequest < ? > request ) { } }
return getOr ( request , io . micronaut . http . HttpResponse . ok ( ) ) ;
public class BooleanUI { /** * { @ inheritDoc } */ @ Override public Object transformObject ( final UIValue _uiValue , final Object _object ) throws EFapsException { } }
Object ret = null ; if ( _object instanceof Map ) { ret = _object ; } else if ( _object instanceof Serializable ) { _uiValue . setDbValue ( ( Serializable ) _object ) ; ret = getValue ( _uiValue ) ; } return ret ;
public class TomcatServerXML { /** * Sets the http port and Fedora default http connector options . * @ see " http : / / tomcat . apache . org / tomcat - 6.0 - doc / config / http . html " * @ throws InstallationFailedException */ public void setHTTPPort ( ) throws InstallationFailedException { } }
// Note this very significant assumption : this xpath will select exactly one connector Element httpConnector = ( Element ) getDocument ( ) . selectSingleNode ( HTTP_CONNECTOR_XPATH ) ; if ( httpConnector == null ) { throw new InstallationFailedException ( "Unable to set server.xml HTTP Port. XPath for Connector elemen...
public class InMemoryEngine { /** * { @ inheritDoc } */ @ Override public < K , V > Map < K , V > getBigMap ( String name , Class < K > keyClass , Class < V > valueClass , MapType type , StorageHint storageHint , boolean isConcurrent , boolean isTemporary ) { } }
assertConnectionOpen ( ) ; Map < K , V > m ; if ( MapType . HASHMAP . equals ( type ) ) { m = isConcurrent ? new ConcurrentHashMap < > ( ) : new HashMap < > ( ) ; } else if ( MapType . TREEMAP . equals ( type ) ) { m = isConcurrent ? new ConcurrentSkipListMap < > ( ) : new TreeMap < > ( ) ; } else { throw new IllegalAr...
public class SeaGlassButtonUI { /** * DOCUMENT ME ! * @ param b DOCUMENT ME ! * @ param defaultIcon DOCUMENT ME ! * @ return DOCUMENT ME ! */ private Icon getPressedIcon ( AbstractButton b , Icon defaultIcon ) { } }
return getIcon ( b , b . getPressedIcon ( ) , defaultIcon , SynthConstants . PRESSED ) ;
public class CmsDialog { /** * Builds a button row with a " close " and a " details " button . < p > * @ param closeAttribute additional attributes for the " close " button * @ param detailsAttribute additional attributes for the " details " button * @ return the button row */ public String dialogButtonsCloseDeta...
return dialogButtons ( new int [ ] { BUTTON_CLOSE , BUTTON_DETAILS } , new String [ ] { closeAttribute , detailsAttribute } ) ;
public class AuthenticationApi { /** * Sign - out a logged in user * Sign - out the current user and invalidate either the current token or all tokens associated with the user . * @ param authorization The OAuth 2 bearer access token you received from [ / auth / v3 / oauth / token ] ( / reference / authentication /...
try { return authenticationApi . signOut1 ( authorization , global , redirectUri ) ; } catch ( ApiException e ) { throw new AuthenticationApiException ( "Error sign out" , e ) ; }
public class Exceptions { /** * Throws the specified exception violating the { @ code throws } clause of the enclosing method . * This method is useful when you need to rethrow a checked exception in { @ link Function } , { @ link Consumer } , * { @ link Supplier } and { @ link Runnable } , only if you are sure tha...
doThrowUnsafely ( requireNonNull ( cause , "cause" ) ) ; return null ; // Never reaches here .
public class Messages { /** * Create state message key for resource name . < p > * @ param state resource state * @ return title message key to resource state * @ see org . opencms . file . CmsResource # getState ( ) */ public static String getStateKey ( CmsResourceState state ) { } }
StringBuffer sb = new StringBuffer ( GUI_STATE_PREFIX ) ; sb . append ( state . getState ( ) ) ; sb . append ( GUI_STATE_POSTFIX ) ; return sb . toString ( ) ;
public class SQLLexer { /** * Quickly determine if the characters in a char array match the given token . * Token must be specified in lower case , and must be all ASCII letters . * Will return false if the token is preceded by alphanumeric characters - - - * it may be embedded in an indentifier in this case . ...
if ( position != 0 && isIdentifierPartFast ( buffer [ position - 1 ] ) ) { // character at position is preceded by a letter or digit return false ; } int tokenLength = lowercaseToken . length ( ) ; if ( position + tokenLength > buffer . length ) { // Buffer not long enough to contain token . return false ; } if ( posit...
public class AnnotationScanner { /** * Created and adds the event to the eventsFound set , if its package matches the includeRegExp . * @ param eventBuilderFactory Event Factory used to create the EventConfig instance with . * @ param eventsFound Set of events found , to add the newly created EventConfig to . * @...
if ( className . matches ( includeRegExp ) ) { try { Class < ? > matchingClass = Class . forName ( className ) ; matchingClass . asSubclass ( ofType ) ; classes . add ( ( Class < T > ) matchingClass ) ; } catch ( ClassNotFoundException cnfe ) { throw new IllegalStateException ( "Scannotation found a class that does not...
public class SampleRandomGroupsHttpHandler { /** * test , how many times the group was present in the list of groups . */ private Map < String , Integer > runSampling ( final ProctorContext proctorContext , final Set < String > targetTestNames , final TestType testType , final int determinationsToRun ) { } }
final Set < String > targetTestGroups = getTargetTestGroups ( targetTestNames ) ; final Map < String , Integer > testGroupToOccurrences = Maps . newTreeMap ( ) ; for ( final String testGroup : targetTestGroups ) { testGroupToOccurrences . put ( testGroup , 0 ) ; } for ( int i = 0 ; i < determinationsToRun ; ++ i ) { fi...
public class NotifyWorkersRequest { /** * A list of Worker IDs you wish to notify . You can notify upto 100 Workers at a time . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setWorkerIds ( java . util . Collection ) } or { @ link # withWorkerIds ( java . ut...
if ( this . workerIds == null ) { setWorkerIds ( new java . util . ArrayList < String > ( workerIds . length ) ) ; } for ( String ele : workerIds ) { this . workerIds . add ( ele ) ; } return this ;
public class ListTagsForResourceResult { /** * A list of tags for the resource . * @ param tagList * A list of tags for the resource . */ public void setTagList ( java . util . Collection < Tag > tagList ) { } }
if ( tagList == null ) { this . tagList = null ; return ; } this . tagList = new java . util . ArrayList < Tag > ( tagList ) ;
public class Dstream { /** * Adjusts the clustering of a dense density grid . Implements lines 8 through 18 from Figure 4 of Chen and Tu 2007. * @ param dg the dense density grid being adjusted * @ param cv the characteristic vector of dg * @ param dgClass the cluster to which dg belonged * @ return a HashMap <...
// System . out . print ( " Density grid " + dg . toString ( ) + " is adjusted as a dense grid at time " + this . getCurrTime ( ) + " . " ) ; // Among all neighbours of dg , find the grid h whose cluster ch has the largest size GridCluster ch ; // The cluster , ch , of h DensityGrid hChosen = new DensityGrid ( dg ) ; /...
public class PublicanPODocBookBuilder { /** * Add any bug link strings for a specific topic . * @ param buildData Information and data structures for the build . * @ param specTopic The spec topic to create any bug link translation strings for . * @ param translations The mapping of original strings to translatio...
try { final DocBookXMLPreProcessor preProcessor = buildData . getXMLPreProcessor ( ) ; final String bugLinkUrl = preProcessor . getBugLinkUrl ( buildData , specTopic ) ; processPOBugLinks ( buildData , preProcessor , bugLinkUrl , translations ) ; } catch ( BugLinkException e ) { throw new BuildProcessingException ( e )...
public class RunsInner { /** * Patch the run properties . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param runId The run ID . * @ throws IllegalArgumentException thrown if parameters fail th...
return updateWithServiceResponseAsync ( resourceGroupName , registryName , runId ) . map ( new Func1 < ServiceResponse < RunInner > , RunInner > ( ) { @ Override public RunInner call ( ServiceResponse < RunInner > response ) { return response . body ( ) ; } } ) ;
public class SDVariable { /** * Reverse subtraction operation : elementwise { @ code x - this } < br > * If this and x variables have equal shape , the output shape is the same as the inputs . < br > * Supports broadcasting : if this and x have different shapes and are broadcastable , the output shape is broadcast ...
val result = sameDiff . f ( ) . rsub ( this , x ) ; return sameDiff . updateVariableNameAndReference ( result , name ) ;
public class MemoryPoolStats { /** * Sets new used memory amount . * @ param value the memory amount . */ public void setUsed ( long value ) { } }
used . setValueAsLong ( value ) ; minUsed . setValueIfLesserThanCurrentAsLong ( value ) ; maxUsed . setValueIfGreaterThanCurrentAsLong ( value ) ;
public class Main { /** * Main * @ param args args */ public static void main ( String [ ] args ) { } }
final int argsLength = args . length ; if ( argsLength < 1 ) { usage ( ) ; System . exit ( OTHER ) ; } String rarFile = "" ; String [ ] cps = null ; boolean stdout = false ; String reportFile = "" ; for ( int i = 0 ; i < argsLength ; i ++ ) { String arg = args [ i ] ; if ( arg . equals ( ARGS_CP ) ) { cps = args [ ++ i...
public class ReconnectionManager { /** * Disable the automatic reconnection mechanism . Does nothing if already disabled . */ public synchronized void disableAutomaticReconnection ( ) { } }
if ( ! automaticReconnectEnabled ) { return ; } XMPPConnection connection = weakRefConnection . get ( ) ; if ( connection == null ) { throw new IllegalStateException ( "Connection instance no longer available" ) ; } connection . removeConnectionListener ( connectionListener ) ; automaticReconnectEnabled = false ;
public class BigMoney { /** * Returns a copy of this monetary value with the specified amount . * The returned instance will have this currency and the new amount . * The scale of the returned instance will be that of the specified BigDecimal . * This instance is immutable and unaffected by this method . * @ pa...
MoneyUtils . checkNotNull ( amount , "Amount must not be null" ) ; if ( this . amount . equals ( amount ) ) { return this ; } return BigMoney . of ( currency , amount ) ;
public class SwipeBack { /** * Sets the color of the divider , if you have set the option to use a shadow * gradient as divider * You must enable the divider by calling * { @ link # setDividerEnabled ( boolean ) } * @ param color * The color of the divider shadow . */ public SwipeBack setDividerAsShadowColor ...
GradientDrawable . Orientation orientation = getDividerOrientation ( ) ; final int endColor = color & 0x00FFFFFF ; GradientDrawable gradient = new GradientDrawable ( orientation , new int [ ] { color , endColor , } ) ; setDivider ( gradient ) ; return this ;
public class WebhookCluster { /** * Closes all { @ link net . dv8tion . jda . webhook . WebhookClient WebhookClients } that meet * the specified filter . * < br > The filter may return { @ code true } for all clients that should be < b > removed and closed < / b > . * @ param predicate * The filter to decide wh...
Checks . notNull ( predicate , "Filter" ) ; List < WebhookClient > clients = new ArrayList < > ( ) ; for ( WebhookClient client : webhooks ) { if ( predicate . test ( client ) ) clients . add ( client ) ; } removeWebhooks ( clients ) ; clients . forEach ( WebhookClient :: close ) ; return clients ;
public class GBSInsertFringe { /** * Balance a fringe with a K factor of thirty - two . * @ param stack The stack of nodes through which the insert operation * passed . * @ param bparent The parent of the fringe balance point . * @ param fpoint The fringe balance point ( the top of the fringe ) . * @ param fp...
/* k = 32 , 2k - 1 = 63 , k - 1 = 31 [ A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0-1-2-3-4 ] [ 31 children ] becomes : * - - - - - H - - - - - * * - - - - - X - - - - - * * - - - D - - - * * - - - L - - - * * - - - T - - - * * - - - 1 - - - * * - B...
public class MemoryBandwidth { /** * memory bandwidth in bytes / second */ double run_benchmark ( ) { } }
// use the lesser of 40MB or 10 % of Heap final long M = Math . min ( 10000000l , Runtime . getRuntime ( ) . maxMemory ( ) / 40 ) ; int [ ] vals = MemoryManager . malloc4 ( ( int ) M ) ; double total ; int repeats = 20 ; Timer timer = new Timer ( ) ; // ms long sum = 0 ; // write repeats * M ints // read repeats * M in...
public class BitSet { /** * Every public method must preserve these invariants . */ private void checkInvariants ( ) { } }
assert ( wordsInUse == 0 || words [ wordsInUse - 1 ] != 0 ) ; assert ( wordsInUse >= 0 && wordsInUse <= words . length ) ; assert ( wordsInUse == words . length || words [ wordsInUse ] == 0 ) ;
public class ArrayUtils { /** * Null - safe method returning the array if not null otherwise returns an empty array . * @ param < T > Class type of the elements in the array . * @ param array array to evaluate . * @ param componentType { @ link Class } type of the elements in the array . Defaults to { @ link Obje...
return array != null ? array : ( T [ ] ) Array . newInstance ( defaultIfNull ( componentType , Object . class ) , 0 ) ;
public class BuilderImpl { /** * ( non - Javadoc ) * @ see com . ibm . ws . security . jwt . internal . Builder # claimFrom ( java . lang . String , java . lang . String ) */ @ Override public Builder claimFrom ( String jsonOrJwt , String claim ) throws InvalidClaimException , InvalidTokenException { } }
if ( JwtUtils . isNullEmpty ( claim ) ) { String err = Tr . formatMessage ( tc , "JWT_INVALID_CLAIM_ERR" , new Object [ ] { claim } ) ; throw new InvalidClaimException ( err ) ; } if ( isValidToken ( jsonOrJwt ) ) { String decoded = jsonOrJwt ; if ( JwtUtils . isBase64Encoded ( jsonOrJwt ) ) { decoded = JwtUtils . deco...
public class Consumers { /** * Yields the only element if found , nothing otherwise . * @ param < E > the iterator element type * @ param iterator the iterator that will be consumed * @ throws IllegalStateException if the iterator contains more than one * element * @ return just the element or nothing */ publ...
return new MaybeOneElement < E > ( ) . apply ( iterator ) ;
public class SimpleBloomFilter { /** * Computes the optimal number of hash functions to apply to each element added to the Bloom Filter as a factor * of the approximate ( estimated ) number of elements that will be added to the filter along with * the required number of bits needed by the filter , which was compute...
double numberOfHashFunctions = ( requiredNumberOfBits / approximateNumberOfElements ) * Math . log ( 2.0d ) ; return Double . valueOf ( Math . ceil ( numberOfHashFunctions ) ) . intValue ( ) ;
public class ScriptRuntimeException { /** * Returns a message containing the String passed to a constructor as well as line and column numbers and filename if any of these are known . * @ return The error message . */ @ Override public String getMessage ( ) { } }
String ret = super . getMessage ( ) ; if ( fileName != null ) { ret += ( " in " + fileName ) ; if ( lineNumber != - 1 ) { ret += " at line number " + lineNumber ; } if ( columnNumber != - 1 ) { ret += " at column number " + columnNumber ; } } return ret ;
public class ApiOvhCloud { /** * Delete a group * REST : DELETE / cloud / project / { serviceName } / instance / group / { groupId } * @ param groupId [ required ] Group id * @ param serviceName [ required ] Project name */ public void project_serviceName_instance_group_groupId_DELETE ( String serviceName , Strin...
String qPath = "/cloud/project/{serviceName}/instance/group/{groupId}" ; StringBuilder sb = path ( qPath , serviceName , groupId ) ; exec ( qPath , "DELETE" , sb . toString ( ) , null ) ;
public class NFRule { /** * Searches the rule ' s rule text for the first substitution token , * creates a substitution based on it , and removes the token from * the rule ' s rule text . * @ param owner The rule set containing this rule * @ param predecessor The rule preceding this one in the rule set ' s * ...
NFSubstitution result ; int subStart ; int subEnd ; // search the rule ' s rule text for the first two characters of // a substitution token subStart = indexOfAnyRulePrefix ( ruleText ) ; // if we didn ' t find one , create a null substitution positioned // at the end of the rule text if ( subStart == - 1 ) { return nu...
public class InstantSearch { /** * Registers a { @ link SearchView } to trigger search requests on text change , replacing the current one if any . * @ param activity The searchable activity , see { @ link android . app . SearchableInfo } . * @ param searchView a SearchView whose query text will be used . */ @ Supp...
"WeakerAccess" , "unused" } ) // For library users public void registerSearchView ( @ NonNull final Activity activity , @ NonNull final SearchView searchView ) { registerSearchView ( activity , new SearchViewFacade ( searchView ) ) ;
public class TrainableDistanceMetric { /** * Static helper method for training a distance metric only if it is needed . * This method can be safely called for any Distance Metric . * @ param dm the distance metric to train * @ param dataset the data set to train from * @ param threadpool the source of threads f...
// TODO I WILL DELETE , JUST STUBBING FOR NOW TO MAKE LIFE EASY AS I DO ONE CODE SECTION AT A TIME trainIfNeeded ( dm , dataset ) ;
public class ChemSequenceManipulator { /** * Get the total number of bonds inside an IChemSequence . * @ param sequence The IChemSequence object . * @ return The number of Bond objects inside . */ public static int getBondCount ( IChemSequence sequence ) { } }
int count = 0 ; for ( int i = 0 ; i < sequence . getChemModelCount ( ) ; i ++ ) { count += ChemModelManipulator . getBondCount ( sequence . getChemModel ( i ) ) ; } return count ;
public class BatchWriteOperationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( BatchWriteOperation batchWriteOperation , ProtocolMarshaller protocolMarshaller ) { } }
if ( batchWriteOperation == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( batchWriteOperation . getCreateObject ( ) , CREATEOBJECT_BINDING ) ; protocolMarshaller . marshall ( batchWriteOperation . getAttachObject ( ) , ATTACHOBJECT_BINDING...
public class TokenManager { /** * get a Jwt with a provided clientRequest , * it will get token based on Jwt . Key ( either scope or service _ id ) * if the user declared both scope and service _ id in header , it will get jwt based on scope * @ param clientRequest * @ return */ public Result < Jwt > getJwt ( C...
HeaderValues scope = clientRequest . getRequestHeaders ( ) . get ( OauthHelper . SCOPE ) ; if ( scope != null ) { String scopeStr = scope . getFirst ( ) ; Set < String > scopeSet = new HashSet < > ( ) ; scopeSet . addAll ( Arrays . asList ( scopeStr . split ( " " ) ) ) ; return getJwt ( new Jwt . Key ( scopeSet ) ) ; }...
public class ConsumerDispatcher { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . msgstore . transactions . TransactionCallback # afterCompletion ( com . ibm . ws . sib . msgstore . transactions . Transaction , boolean ) */ @ Override public void afterCompletion ( TransactionCommon transaction , boolean commit...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "afterCompletion" , new Object [ ] { transaction , Boolean . valueOf ( committed ) } ) ; // Reset the current transaction now that this one has completed synchronized ( orderLock ) { // If asynch and a rollback occurred , un...
public class GroupHandlerImpl { /** * Remove all membership entities related to current group . */ private void removeMemberships ( Node groupNode , boolean broadcast ) throws RepositoryException { } }
NodeIterator refUsers = groupNode . getNode ( JCROrganizationServiceImpl . JOS_MEMBERSHIP ) . getNodes ( ) ; while ( refUsers . hasNext ( ) ) { refUsers . nextNode ( ) . remove ( ) ; }
public class TableImpl { /** * records . add ( newEntity ( ) ) ; / / CHANGE # 7b */ private void revertInsertRow ( long id , int row , boolean reuseRow ) { } }
// INFORM INSIDER insider . uninserting ( clazz , id ) ; idColl . cancelId ( id ) ; // UNDO CHANGE # 1 if ( reuseRow ) { deleted . add ( row ) ; // UNDO CHANGE # 2 } else { rows -- ; // UNDO CHANGE # 3 } idColl . delete ( id ) ; // UNDO CHANGE # 4 size -- ; // UNDO CHANGE # 5 ids . remove ( id ) ; // UNDO CHANGE # 6 if...
public class ComponentRegister { /** * Identifies if the current VM has a native support for multidex . * @ return true , otherwise is false . * @ see android . support . multidex . MultiDexExtractor # isVMMultidexCapable ( String ) */ private static boolean isVMMultidexCapable ( ) { } }
boolean isMultidexCapable = false ; String vmVersion = System . getProperty ( "java.vm.version" ) ; try { Matcher matcher = Pattern . compile ( "(\\d+)\\.(\\d+)(\\.\\d+)?" ) . matcher ( vmVersion ) ; if ( matcher . matches ( ) ) { int major = Integer . parseInt ( matcher . group ( 1 ) ) ; int minor = Integer . parseInt...
public class WebContainerListener { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . container . service . state . ApplicationStateListener # applicationStopped ( com . ibm . ws . container . service . app . deploy . ApplicationInfo ) */ @ Override @ FFDCIgnore ( NullPointerException . class ) public void applica...
// If we can ' t get the J2EEName of the application , then we don ' t care about this application . String appName = appInfo . getDeploymentName ( ) ; if ( null == appName ) return ; // Handle an app being stopped webModulesInStartingApps . remove ( appName ) ; webModulesInStartedApps . remove ( appName ) ; if ( Trace...
public class DefaultMonitorService { /** * ~ Methods * * * * * */ @ Override @ Transactional public synchronized void enableMonitoring ( ) { } }
requireNotDisposed ( ) ; _logger . info ( "Globally enabling all system monitoring." ) ; _setServiceEnabled ( true ) ; _checkAlertExistence ( true ) ; _logger . info ( "All system monitoring globally enabled." ) ;
public class ExecutionImpl { /** * creates a new execution . properties processDefinition , processInstance and activity will be initialized . */ public ExecutionImpl createExecution ( boolean initializeExecutionStartContext ) { } }
// create the new child execution ExecutionImpl createdExecution = newExecution ( ) ; // initialize sequence counter createdExecution . setSequenceCounter ( getSequenceCounter ( ) ) ; // manage the bidirectional parent - child relation createdExecution . setParent ( this ) ; // initialize the new execution createdExecu...
public class DirectFilepathMapper { /** * file for a given path in the specified subdir * @ param path path * @ param dir dir * @ return file */ private File withPath ( Path path , File dir ) { } }
return new File ( dir , path . getPath ( ) ) ;
public class TaskHolder { /** * Get the next ( String ) param . * @ param strName The param name ( in most implementations this is optional ) . * @ return The next param as a string . */ public Map < String , Object > getNextPropertiesParam ( InputStream in , String strName , Map < String , Object > properties ) { ...
return m_proxyTask . getNextPropertiesParam ( in , strName , properties ) ;
public class IntFloatSortedVector { /** * Gets the entrywise difference of the two vectors . */ public IntFloatSortedVector getDiff ( IntFloatVector other ) { } }
IntFloatSortedVector diff = new IntFloatSortedVector ( this ) ; diff . subtract ( other ) ; return diff ;
public class KeyLongValue { /** * This method does not keep order of list . */ public static Map < String , Long > toMap ( List < KeyLongValue > values ) { } }
return values . stream ( ) . collect ( uniqueIndex ( KeyLongValue :: getKey , KeyLongValue :: getValue , values . size ( ) ) ) ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcBoilerTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class CraftingHelper { /** * Attempt to craft the given recipe . < br > * This pays no attention to tedious things like using the right crafting table / brewing stand etc , or getting the right shape . < br > * It simply takes the raw ingredients out of the player ' s inventory , and inserts the output of th...
if ( player == null || recipe == null ) return false ; ItemStack is = recipe . getRecipeOutput ( ) ; if ( is == null ) return false ; List < ItemStack > ingredients = getIngredients ( recipe ) ; if ( playerHasIngredients ( player , ingredients ) ) { // We have the ingredients we need , so directly manipulate the invent...
public class CmsResultsTab { /** * Scrolls to the result which corresponds to a preset value in the editor . < p > */ protected void scrollToPreset ( ) { } }
final ScrollPanel scrollPanel = getList ( ) ; if ( m_preset != null ) { Widget child = scrollPanel . getWidget ( ) ; if ( child instanceof CmsList < ? > ) { @ SuppressWarnings ( "unchecked" ) CmsList < I_CmsListItem > list = ( CmsList < I_CmsListItem > ) child ; if ( list . getWidgetCount ( ) > 0 ) { final Widget first...
public class Parser { /** * parse the given sql from index i , appending it to the given buffer until we hit an unmatched * right parentheses or end of string . When the stopOnComma flag is set we also stop processing * when a comma is found in sql text that isn ' t inside nested parenthesis . * @ param sql the o...
SqlParseState state = SqlParseState . IN_SQLCODE ; int len = sql . length ; int nestedParenthesis = 0 ; boolean endOfNested = false ; // because of the + + i loop i -- ; while ( ! endOfNested && ++ i < len ) { char c = sql [ i ] ; state_switch : switch ( state ) { case IN_SQLCODE : if ( c == '$' ) { int i0 = i ; i = pa...
public class Datepicker { /** * Generates the default language for the date picker . Originally implemented in * the HeadRenderer , this code has been moved here to provide better * compatibility to PrimeFaces . If multiple date pickers are on the page , the * script is generated redundantly , but this shouldn ' ...
ResponseWriter rw = fc . getResponseWriter ( ) ; rw . startElement ( "script" , null ) ; rw . write ( "$.datepicker.setDefaults($.datepicker.regional['" + fc . getViewRoot ( ) . getLocale ( ) . getLanguage ( ) + "']);" ) ; rw . endElement ( "script" ) ;
public class Manager { /** * Returns the database with the given name , or creates it if it doesn ' t exist . * Multiple calls with the same name will return the same { @ link Database } instance . * This is equivalent to calling { @ link # openDatabase ( String , DatabaseOptions ) } * with a default set of optio...
DatabaseOptions options = getDefaultOptions ( name ) ; options . setCreate ( true ) ; return openDatabase ( name , options ) ;
public class Blob { /** * { @ inheritDoc } */ public long position ( final byte [ ] pattern , final long start ) throws SQLException { } }
synchronized ( this ) { if ( this . underlying == null ) { if ( start > 1 ) { throw new SQLException ( "Invalid offset: " + start ) ; } // end of if return - 1L ; } // end of if return this . underlying . position ( pattern , start ) ; } // end of sync
public class PromiseNotificationUtil { /** * Try to mark the { @ link Promise } as failure and log if { @ code logger } is not { @ code null } in case this fails . */ public static void tryFailure ( Promise < ? > p , Throwable cause , InternalLogger logger ) { } }
if ( ! p . tryFailure ( cause ) && logger != null ) { Throwable err = p . cause ( ) ; if ( err == null ) { logger . warn ( "Failed to mark a promise as failure because it has succeeded already: {}" , p , cause ) ; } else { logger . warn ( "Failed to mark a promise as failure because it has failed already: {}, unnotifie...
public class IconProviderFromUrlProvider { /** * / * ( non - Javadoc ) * @ see com . sporniket . libre . ui . swing . IconProvider # retrieveIcon ( java . lang . Object ) */ public ImageIcon retrieveIcon ( String location ) throws IconProviderException { } }
try { URL _url = getUrlProvider ( ) . getUrl ( location ) ; return getIconProvider ( ) . retrieveIcon ( _url ) ; } catch ( UrlProviderException _exception ) { throw new IconProviderException ( _exception ) ; }
public class GrpclbState { /** * Handle new addresses of the balancer and backends from the resolver , and create connection if * not yet connected . */ void handleAddresses ( List < LbAddressGroup > newLbAddressGroups , List < EquivalentAddressGroup > newBackendServers ) { } }
if ( newLbAddressGroups . isEmpty ( ) ) { // No balancer address : close existing balancer connection and enter fallback mode // immediately . shutdownLbComm ( ) ; syncContext . execute ( new FallbackModeTask ( ) ) ; } else { LbAddressGroup newLbAddressGroup = flattenLbAddressGroups ( newLbAddressGroups ) ; startLbComm...
public class YogaBuilder { /** * there are cases where a user might want to override meta data registry , * selector resolver and / or CoreSelector implementations . This would be the * place to do it , since we have complex dependencies for those objects , and * we need those objects set up before other setters ...
_metaDataRegistry = new DefaultMetaDataRegistry ( ) ; _selectorResolver = new SelectorResolver ( ) ; _selectorResolver . getBaseSelector ( ) . setEntityConfigurationRegistry ( new DefaultEntityConfigurationRegistry ( ) ) ; _metaDataRegistry . setCoreSelector ( this . _selectorResolver . getBaseSelector ( ) ) ; _metaDat...
public class Heritrix3Wrapper { /** * Build an existing job . * @ param jobname job name * @ return job state */ public JobResult buildJobConfiguration ( String jobname ) { } }
HttpPost postRequest = new HttpPost ( baseUrl + "job/" + jobname ) ; StringEntity postEntity = null ; try { postEntity = new StringEntity ( BUILD_ACTION ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; } postEntity . setContentType ( "application/x-www-form-urlencoded" ) ; postRequest . addHea...
public class HttpRedirectBindingUtil { /** * Encodes the specified { @ code message } into a deflated base64 string . */ static String toDeflatedBase64 ( SAMLObject message ) { } }
requireNonNull ( message , "message" ) ; final String messageStr ; try { messageStr = nodeToString ( XMLObjectSupport . marshall ( message ) ) ; } catch ( MarshallingException e ) { throw new SamlException ( "failed to serialize a SAML message" , e ) ; } final ByteArrayOutputStream bytesOut = new ByteArrayOutputStream ...
public class StubAmpOut { /** * @ Override * public AnnotatedType getApiClass ( ) * return getClass ( ) ; */ @ Override public Object onLookup ( String path , ServiceRefAmp parentRef ) { } }
PodRef podCaller = null ; StubLink actorLink = new StubLink ( getServiceManager ( ) , path , parentRef , podCaller , this ) ; ServiceRefAmp actorRef = parentRef . pin ( actorLink , parentRef . address ( ) + path ) ; actorLink . initSelfRef ( actorRef ) ; // ServiceManagerAmp manager = getServiceManager ( ) ; // return ...
public class Descriptor { /** * Add the given service calls to this service . * @ param calls The calls to add . * @ return A copy of this descriptor with the new calls added . */ public Descriptor withCalls ( Call < ? , ? > ... calls ) { } }
return replaceAllCalls ( this . calls . plusAll ( Arrays . asList ( calls ) ) ) ;
public class GenericsUtils { /** * Try to get the parameterized type from the cache . * If no cached item found , cache and return the result of { @ link # findParameterizedType ( ClassNode , ClassNode , boolean ) } */ public static ClassNode findParameterizedTypeFromCache ( final ClassNode genericsClass , final Clas...
if ( ! PARAMETERIZED_TYPE_CACHE_ENABLED ) { return findParameterizedType ( genericsClass , actualType , tryToFindExactType ) ; } SoftReference < ClassNode > sr = PARAMETERIZED_TYPE_CACHE . getAndPut ( new ParameterizedTypeCacheKey ( genericsClass , actualType ) , key -> new SoftReference < > ( findParameterizedType ( k...
public class JWSHeader { /** * Construct JWSHeader from base64url string . * @ param base64 * base64 url string . * @ return Constructed JWSHeader */ public static JWSHeader fromBase64String ( String base64 ) throws IOException { } }
String json = MessageSecurityHelper . base64UrltoString ( base64 ) ; ObjectMapper mapper = new ObjectMapper ( ) ; return mapper . readValue ( json , JWSHeader . class ) ;
public class TextAccessor { /** * / * [ deutsch ] * < p > Interpretiert die angegebene Textform als Enum - Elementwert . < / p > * @ param < V > generic value type of element * @ param parseable text to be parsed * @ param status current parsing position * @ param valueType value class of element * @ param ...
boolean caseInsensitive = true ; boolean partialCompare = false ; boolean smart = true ; if ( leniency == Leniency . STRICT ) { caseInsensitive = false ; smart = false ; } else if ( leniency == Leniency . LAX ) { partialCompare = true ; } return this . parse ( parseable , status , valueType , caseInsensitive , partialC...
public class MultiProviderPropertyConfig { /** * { @ inheritDoc } */ public void add ( Properties newer ) { } }
for ( Object key : newer . keySet ( ) ) { this . properties . put ( key . toString ( ) , newer . get ( key ) ) ; }
public class AlignmentTrimmer { /** * Try increase total alignment score by partially ( or fully ) trimming it from right side . If score can ' t be * increased the same alignment will be returned . * @ param alignment input alignment * @ param scoring scoring * @ return resulting alignment */ public static < S...
if ( scoring instanceof LinearGapAlignmentScoring ) return rightTrimAlignment ( alignment , ( LinearGapAlignmentScoring < S > ) scoring ) ; else if ( scoring instanceof AffineGapAlignmentScoring ) return rightTrimAlignment ( alignment , ( AffineGapAlignmentScoring < S > ) scoring ) ; else throw new IllegalArgumentExcep...
public class BlockBox { /** * Calculates the position for a floating box in the given context . * @ param subbox the box to be placed * @ param wlimit the width limit for placing all the boxes * @ param stat status of the layout that should be updated */ protected void layoutBlockFloating ( BlockBox subbox , int ...
subbox . setFloats ( new FloatList ( subbox ) , new FloatList ( subbox ) , 0 , 0 , 0 ) ; subbox . doLayout ( wlimit , true , true ) ; FloatList f = ( subbox . getFloating ( ) == FLOAT_LEFT ) ? fleft : fright ; // float list at my side FloatList of = ( subbox . getFloating ( ) == FLOAT_LEFT ) ? fright : fleft ; // float...
public class XLinkUtils { /** * Returns a future Date - String in the format ' yyyyMMddkkmmss ' . */ private static String getExpirationDate ( int futureDays ) { } }
Calendar calendar = Calendar . getInstance ( ) ; calendar . add ( Calendar . DAY_OF_YEAR , futureDays ) ; Format formatter = new SimpleDateFormat ( XLinkConstants . DATEFORMAT ) ; return formatter . format ( calendar . getTime ( ) ) ;
public class Shard { /** * / * ( non - Javadoc ) * @ see org . apache . hadoop . io . Writable # readFields ( java . io . DataInput ) */ public void readFields ( DataInput in ) throws IOException { } }
version = in . readLong ( ) ; dir = Text . readString ( in ) ; gen = in . readLong ( ) ;
public class ValueList { /** * Get the ValueList . * @ return String with the Values , which looks like the original */ public String getValueList ( ) { } }
final StringBuffer buf = new StringBuffer ( ) ; for ( final Token token : this . tokens ) { switch ( token . type ) { case EXPRESSION : buf . append ( "$<" ) . append ( token . value ) . append ( ">" ) ; break ; case TEXT : buf . append ( token . value ) ; break ; default : break ; } } return buf . toString ( ) ;
public class CamelCase { /** * Return camelCase * @ param text * @ return */ public static final String property ( String text ) { } }
CamelSpliterator cs = new CamelSpliterator ( text ) ; StringBuilder sb = new StringBuilder ( ) ; cs . tryAdvance ( ( s ) -> sb . append ( lower ( s ) ) ) ; StreamSupport . stream ( cs , false ) . forEach ( ( s ) -> sb . append ( s ) ) ; return sb . toString ( ) ;
public class AnnotationUtil { /** * Returns the { @ link Annotation } tagged on another annotation instance . * @ param annotation * the annotation instance * @ param tagClass * the expected annotation class * @ param < T > * the generic type of the expected annotation * @ return * the annotation tagged...
Class < ? > c = annotation . annotationType ( ) ; for ( Annotation a : c . getAnnotations ( ) ) { if ( tagClass . isInstance ( a ) ) { return ( T ) a ; } } return null ;
public class DaoService { /** * / * ( non - Javadoc ) * @ see org . esupportail . smsuapi . dao . DaoService # isPhoneNumberInBlackList ( java . lang . String ) */ public boolean isPhoneNumberInBlackList ( final String phoneNumber ) { } }
final Criteria criteria = getCurrentSession ( ) . createCriteria ( Blacklist . class ) ; criteria . add ( Restrictions . eq ( Blacklist . PROP_BLA_PHONE , phoneNumber ) ) ; return criteria . uniqueResult ( ) != null ;