signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class TransitionManager { /** * Sets a specific transition to occur when the given scene is entered .
* @ param scene The scene which , when applied , will cause the given
* transition to run .
* @ param transition The transition that will play when the given scene is
* entered . A value of null will res... | mSceneTransitions . put ( scene , transition ) ; |
public class BondManipulator { /** * Returns the maximum bond order for a List of bonds , given an iterator to the list .
* @ param bonds An iterator for the list of bonds
* @ return The maximum bond order found
* @ see # getMaximumBondOrder ( java . util . List ) */
public static IBond . Order getMaximumBondOrde... | IBond . Order maxOrder = IBond . Order . SINGLE ; while ( bonds . hasNext ( ) ) { IBond bond = bonds . next ( ) ; if ( isHigherOrder ( bond . getOrder ( ) , maxOrder ) ) maxOrder = bond . getOrder ( ) ; } return maxOrder ; |
public class NGServer { /** * Returns the current NailStats object for the specified class , creating a new one if necessary
* @ param nailClass the class for which we ' re gathering stats
* @ return a NailStats object for the specified class */
private NailStats getOrCreateStatsFor ( Class nailClass ) { } } | NailStats result ; synchronized ( allNailStats ) { String nailClassName = nailClass . getName ( ) ; result = allNailStats . get ( nailClassName ) ; if ( result == null ) { result = new NailStats ( nailClassName ) ; allNailStats . put ( nailClassName , result ) ; } } return result ; |
public class DispatchResponse { /** * Determine the view dispatcher .
* @ param activity the current Activity
* @ throws ViewDispatcherException if ViewDispatcher can not be determined */
private ViewDispatcher getViewDispatcher ( Activity activity ) throws ViewDispatcherException { } } | if ( dispatchRule . getViewDispatcher ( ) != null ) { return dispatchRule . getViewDispatcher ( ) ; } try { String dispatcherName ; if ( dispatchRule . getDispatcherName ( ) != null ) { dispatcherName = dispatchRule . getDispatcherName ( ) ; } else { dispatcherName = activity . getSetting ( ViewDispatcher . VIEW_DISPAT... |
public class GeminiAccountService { /** * This will result in a new address being created each time , and is severely rate - limited */
@ Override public String requestDepositAddress ( Currency currency , String ... arguments ) throws IOException { } } | GeminiDepositAddressResponse response = super . requestDepositAddressRaw ( currency ) ; return response . getAddress ( ) ; |
public class AbstrCFMLExprTransformer { /** * Hier werden die verschiedenen Moeglichen Werte erkannt und jenachdem wird mit der passenden
* Methode weitergefahren < br / >
* EBNF : < br / >
* < code > string | number | dynamic | sharp ; < / code >
* @ return CFXD Element
* @ throws TemplateException */
privat... | Expression expr = null ; // String
if ( ( expr = string ( data ) ) != null ) { expr = subDynamic ( data , expr , false , false ) ; data . mode = STATIC ; // ( expr instanceof Literal ) ? STATIC : DYNAMIC ; / / STATIC
return expr ; } // Number
if ( ( expr = number ( data ) ) != null ) { expr = subDynamic ( data , expr ,... |
public class RBBISetBuilder { int getFirstChar ( int category ) { } } | RangeDescriptor rlRange ; int retVal = - 1 ; for ( rlRange = fRangeList ; rlRange != null ; rlRange = rlRange . fNext ) { if ( rlRange . fNum == category ) { retVal = rlRange . fStartChar ; break ; } } return retVal ; |
public class AWSDirectoryServiceClient { /** * Creates an AD Connector to connect to an on - premises directory .
* Before you call < code > ConnectDirectory < / code > , ensure that all of the required permissions have been explicitly
* granted through a policy . For details about what permissions are required to ... | request = beforeClientExecution ( request ) ; return executeConnectDirectory ( request ) ; |
public class CameraEncoder { /** * Hook for Host Activity ' s onResume ( )
* Called on UI thread */
public void onHostActivityResumed ( ) { } } | synchronized ( mReadyForFrameFence ) { // Resume the GLSurfaceView ' s Renderer thread
if ( mDisplayView != null ) mDisplayView . onResume ( ) ; // Re - open camera if we ' re not recording and the SurfaceTexture has already been created
if ( ! mRecording && mSurfaceTexture != null ) { if ( VERBOSE ) Log . i ( "CameraR... |
public class ProjectiveStructureByFactorization { /** * Used to get found camera matrix for a view
* @ param view Which view
* @ param cameraMatrix storage for 3x4 projective camera matrix */
public void getCameraMatrix ( int view , DMatrixRMaj cameraMatrix ) { } } | cameraMatrix . reshape ( 3 , 4 ) ; CommonOps_DDRM . extract ( P , view * 3 , 0 , cameraMatrix ) ; for ( int col = 0 ; col < 4 ; col ++ ) { cameraMatrix . data [ cameraMatrix . getIndex ( 0 , col ) ] *= pixelScale ; cameraMatrix . data [ cameraMatrix . getIndex ( 1 , col ) ] *= pixelScale ; } |
public class Consumers { /** * Yields nth ( 1 - based ) element of the iterator if found or nothing .
* @ param < E > the iterator element type
* @ param count the element cardinality
* @ param iterator the iterator that will be consumed
* @ return just the element or nothing */
public static < E > Optional < E... | final Iterator < E > filtered = new FilteringIterator < E > ( iterator , new Nth < E > ( count ) ) ; return new MaybeFirstElement < E > ( ) . apply ( filtered ) ; |
public class ProvisionByoipCidrRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional
* parameters to enable operation dry - run . */
@ Override public Request < ProvisionByoipCidrRequest > getDryRunRequest ( ) { } } | Request < ProvisionByoipCidrRequest > request = new ProvisionByoipCidrRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ; |
public class Hasher { /** * Hashes string . This method is minor modification of String . hashCode ( ) .
* @ param string
* String to hash .
* @ return Hash of the string . */
public static long hashString ( String string ) { } } | long h = 1125899906842597L ; // prime
int len = string . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { h = 31 * h + string . charAt ( i ) ; } return h ; |
public class LzmaFrameEncoder { /** * Calculates maximum possible size of output buffer for not compressible data . */
private static int maxOutputBufferLength ( int inputLength ) { } } | double factor ; if ( inputLength < 200 ) { factor = 1.5 ; } else if ( inputLength < 500 ) { factor = 1.2 ; } else if ( inputLength < 1000 ) { factor = 1.1 ; } else if ( inputLength < 10000 ) { factor = 1.05 ; } else { factor = 1.02 ; } return 13 + ( int ) ( inputLength * factor ) ; |
public class DeltaIteration { /** * Sets the resources for the iteration , and the minimum and preferred resources are the same by default .
* The lower and upper resource limits will be considered in dynamic resource resize feature for future plan .
* @ param resources The resources for the iteration .
* @ retur... | Preconditions . checkNotNull ( resources , "The resources must be not null." ) ; Preconditions . checkArgument ( resources . isValid ( ) , "The values in resources must be not less than 0." ) ; this . minResources = resources ; this . preferredResources = resources ; return this ; |
public class LevenbergMarquardt { /** * Convert a list of numbers to an array of doubles .
* @ param listOfNumbers A list of numbers .
* @ return A corresponding array of doubles executing < code > doubleValue ( ) < / code > on each element . */
private static double [ ] numberListToDoubleArray ( List < Number > li... | double [ ] arrayOfDoubles = new double [ listOfNumbers . size ( ) ] ; for ( int i = 0 ; i < arrayOfDoubles . length ; i ++ ) { arrayOfDoubles [ i ] = listOfNumbers . get ( i ) . doubleValue ( ) ; } return arrayOfDoubles ; |
public class FJIterate { /** * Iterate over the collection specified , in parallel batches using default runtime parameter values . The
* { @ code ObjectIntProcedure } used must be stateless , or use concurrent aware objects if they are to be shared .
* e . g .
* < pre >
* { @ code final ConcurrentMutableMap < ... | FJIterate . forEachWithIndex ( iterable , procedure , FJIterate . FORK_JOIN_POOL ) ; |
public class DomainsInner { /** * Get domain name recommendations based on keywords .
* Get domain name recommendations based on keywords .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ param serviceFuture the ServiceFuture object tracking the Retrofit calls
* @ p... | return AzureServiceFuture . fromPageResponse ( listRecommendationsNextSinglePageAsync ( nextPageLink ) , new Func1 < String , Observable < ServiceResponse < Page < NameIdentifierInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < NameIdentifierInner > > > call ( String nextPageLink ) { return li... |
public class ArrayBytesBuff { /** * 检查是否可读字节数
* @ param minimumReadableBytes */
private void checkReadableBytesUnsafe ( int minimumReadableBytes ) { } } | if ( readerIndex > writerIndex - minimumReadableBytes ) { throw new IndexOutOfBoundsException ( String . format ( "readerIndex(%d) + length(%d) exceeds writerIndex(%d): %s" , readerIndex , minimumReadableBytes , writerIndex , this ) ) ; } |
public class ResourcesInner { /** * Updates a resource by ID .
* @ param resourceId The fully qualified ID of the resource , including the resource name and resource type . Use the format , / subscriptions / { guid } / resourceGroups / { resource - group - name } / { resource - provider - namespace } / { resource - t... | return updateByIdWithServiceResponseAsync ( resourceId , apiVersion , parameters ) . map ( new Func1 < ServiceResponse < GenericResourceInner > , GenericResourceInner > ( ) { @ Override public GenericResourceInner call ( ServiceResponse < GenericResourceInner > response ) { return response . body ( ) ; } } ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcActor ( ) { } } | if ( ifcActorEClass == null ) { ifcActorEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 2 ) ; } return ifcActorEClass ; |
public class DescribeDimensionKeysRequest { /** * One or more filters to apply in the request . Restrictions :
* < ul >
* < li >
* Any number of filters by the same dimension , as specified in the < code > GroupBy < / code > or < code > Partition < / code >
* parameters .
* < / li >
* < li >
* A single fi... | setFilter ( filter ) ; return this ; |
public class FileUtils { /** * Get the nquads file for a given moment in time .
* @ param dir the directory
* @ param time the time
* @ return the file */
public static File getNquadsFile ( final File dir , final Instant time ) { } } | return new File ( dir , Long . toString ( time . getEpochSecond ( ) ) + ".nq" ) ; |
public class EnumValidator { /** * Creates a new validator for the enum type with the allowed values defined in the { @ code allowed } parameter .
* @ param enumType the type of the enum .
* @ param nullable { @ code true } if the value is allowed to be { @ code null } , otherwise { @ code false } .
* @ param all... | return new EnumValidator < E > ( enumType , nullable , allowed ) ; |
public class KeyVaultClientBaseImpl { /** * Lists the deleted certificates in the specified vault currently available for recovery .
* The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging . This operation includes deletion ... | ServiceResponse < Page < DeletedCertificateItem > > response = getDeletedCertificatesNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < DeletedCertificateItem > ( response . body ( ) ) { @ Override public Page < DeletedCertificateItem > nextPage ( String nextPageLink ) { return ... |
public class StructureTools { /** * Gets a representative atom for each group that is part of the chain
* backbone . Note that modified aminoacids won ' t be returned as part of the
* backbone if the { @ link org . biojava . nbio . structure . io . mmcif . ReducedChemCompProvider } was used to load the
* structur... | List < Atom > atoms = new ArrayList < Atom > ( ) ; for ( Chain c : s . getChains ( ) ) { Atom [ ] chainAtoms = getRepresentativeAtomArray ( c ) ; for ( Atom a : chainAtoms ) { atoms . add ( a ) ; } } return atoms . toArray ( new Atom [ atoms . size ( ) ] ) ; |
public class OMapOperator { /** * Execute OMAP operator . Behaves like { @ link MapOperator # doExec ( Element , Object , String , Object . . . ) } counterpart but takes
* care to create index and increment it before every key / value pair processing .
* @ param element context element ,
* @ param scope scope obj... | if ( ! propertyPath . equals ( "." ) && ConverterRegistry . hasType ( scope . getClass ( ) ) ) { throw new TemplateException ( "Operand is property path but scope is not an object." ) ; } Element keyTemplate = element . getFirstChild ( ) ; if ( keyTemplate == null ) { throw new TemplateException ( "Invalid map element ... |
public class PeriodConverter { /** * Gson invokes this call - back method during deserialization when it encounters a field of the
* specified type . < p >
* In the implementation of this call - back method , you should consider invoking
* { @ link JsonDeserializationContext # deserialize ( JsonElement , Type ) }... | // Do not try to deserialize null or empty values
if ( json . getAsString ( ) == null || json . getAsString ( ) . isEmpty ( ) ) { return null ; } final PeriodFormatter fmt = ISOPeriodFormat . standard ( ) ; return fmt . parsePeriod ( json . getAsString ( ) ) ; |
public class DoubleBuffer { /** * Compare the remaining doubles of this buffer to another double buffer ' s remaining doubles .
* @ param otherBuffer another double buffer .
* @ return a negative value if this is less than { @ code other } ; 0 if this equals to { @ code
* other } ; a positive value if this is gre... | int compareRemaining = ( remaining ( ) < otherBuffer . remaining ( ) ) ? remaining ( ) : otherBuffer . remaining ( ) ; int thisPos = position ; int otherPos = otherBuffer . position ; // BEGIN android - changed
double thisDouble , otherDouble ; while ( compareRemaining > 0 ) { thisDouble = get ( thisPos ) ; otherDouble... |
public class ArchiveProperties { /** * Returns the archive properties as a Map . */
public Map < String , Collection < String > > toMap ( ) { } } | Map < String , Collection < String > > params = new HashMap < String , Collection < String > > ( ) ; if ( name != null ) { ArrayList < String > valueList = new ArrayList < String > ( ) ; valueList . add ( name ) ; params . put ( "name" , valueList ) ; } if ( resolution != null ) { ArrayList < String > valueList = new A... |
public class TextSimilarity { /** * This calculates the similarity between two strings as described in Programming
* Classics : Implementing the World ' s Best Algorithms by Oliver ( ISBN 0-131-00413-1 ) .
* @ param text1
* @ param text2
* @ return */
public static double oliverSimilarity ( String text1 , Strin... | preprocessDocument ( text1 ) ; preprocessDocument ( text2 ) ; String smallerDoc = text1 ; String biggerDoc = text2 ; if ( text1 . length ( ) > text2 . length ( ) ) { smallerDoc = text2 ; biggerDoc = text1 ; } double p = PHPSimilarText . similarityPercentage ( smallerDoc , biggerDoc ) ; p /= 100.0 ; return p ; |
public class TangoUser { public void removeTangoUserListener ( ITangoUserListener listener ) throws DevFailed { } } | event_listeners . remove ( ITangoUserListener . class , listener ) ; if ( event_listeners . size ( ) == 0 ) unsubscribe_event ( event_identifier ) ; |
public class RedisClusterClient { /** * Returns the first { @ link RedisURI } configured with this { @ link RedisClusterClient } instance .
* @ return the first { @ link RedisURI } . */
protected RedisURI getFirstUri ( ) { } } | assertNotEmpty ( initialUris ) ; Iterator < RedisURI > iterator = initialUris . iterator ( ) ; return iterator . next ( ) ; |
public class CmsVisitEntryFilter { /** * Returns an extended filter with the given resource restriction . < p >
* @ param structureId the structure id to filter
* @ return an extended filter with the given resource restriction */
public CmsVisitEntryFilter filterResource ( CmsUUID structureId ) { } } | CmsVisitEntryFilter filter = ( CmsVisitEntryFilter ) clone ( ) ; filter . m_structureId = structureId ; return filter ; |
public class HibernateLayer { /** * Set the layer configuration .
* @ param layerInfo
* layer information
* @ throws LayerException
* oops
* @ since 1.7.1 */
@ Api @ Override public void setLayerInfo ( VectorLayerInfo layerInfo ) throws LayerException { } } | super . setLayerInfo ( layerInfo ) ; if ( null != featureModel ) { featureModel . setLayerInfo ( getLayerInfo ( ) ) ; } |
public class Label { /** * might return null */
private static Label combineLabel ( FA fa , IntBitSet states ) { } } | int si ; Label tmp ; Label result ; result = null ; for ( si = states . first ( ) ; si != - 1 ; si = states . next ( si ) ) { tmp = ( Label ) fa . get ( si ) . getLabel ( ) ; if ( tmp != null ) { if ( result == null ) { result = new Label ( ) ; } result . symbols . addAll ( tmp . symbols ) ; } } return result ; |
public class CpcConfidence { /** * mergeFlag must already be checked as false */
static double getHipConfidenceLB ( final int lgK , final long numCoupons , final double hipEstAccum , final int kappa ) { } } | if ( numCoupons == 0 ) { return 0.0 ; } assert lgK >= 4 ; assert ( kappa >= 1 ) && ( kappa <= 3 ) ; double x = hipErrorConstant ; if ( lgK <= 14 ) { x = ( hipHighSideData [ ( 3 * ( lgK - 4 ) ) + ( kappa - 1 ) ] ) / 10000.0 ; } final double rel = x / sqrt ( 1 << lgK ) ; final double eps = kappa * rel ; final double est ... |
public class TwitterEndpointServices { /** * Computes the signature for an oauth / request _ token request per
* { @ link https : / / dev . twitter . com / oauth / overview / creating - signatures } .
* Expects consumerSecret and tokenSecret to already be set to the desired values .
* @ param requestMethod
* @ ... | return computeSignature ( requestMethod , targetUrl , params , consumerSecret , tokenSecret ) ; |
public class ContentBasedLocalBundleRepository { /** * This method adds into the cache . Adding into the cache requires updating a map and a set .
* @ param bInfo the bundle info to add into . */
private void addToCache ( BundleInfo bInfo ) { } } | List < Resource > info = _cacheBySymbolicName . get ( bInfo . symbolicName ) ; if ( info == null ) { info = new ArrayList < Resource > ( ) ; info . add ( bInfo ) ; } info = _cacheBySymbolicName . putIfAbsent ( bInfo . symbolicName , info ) ; if ( info != null ) { synchronized ( info ) { info . add ( bInfo ) ; } } _bund... |
public class LogBase { /** * Log a message , with an array of object arguments and associated Throwable information .
* If the logger is currently enabled for the given message
* level then the given message is forwarded to all the
* registered LogTarget objects .
* @ param level the level to log with
* @ par... | // this is copied from log ( LogEntry ) to prevent unnecessary object creation
if ( level . compareTo ( this . level ) < 0 ) { return ; } this . log ( new LogEntry ( level , throwable , message , arguments , ZonedDateTime . now ( ) ) ) ; |
public class TasksBase { /** * Removes the task from the specified project . The task will still exist
* in the system , but it will not be in the project anymore .
* Returns an empty data block .
* @ param task The task to remove from a project .
* @ return Request object */
public ItemRequest < Task > removeP... | String path = String . format ( "/tasks/%s/removeProject" , task ) ; return new ItemRequest < Task > ( this , Task . class , path , "POST" ) ; |
public class OutputHandler { /** * Wait for the task to finish or abort .
* @ return did the task finish correctly ?
* @ throws Throwable */
public synchronized boolean waitForFinish ( ) throws Throwable { } } | while ( ! done && exception == null ) { wait ( ) ; } if ( exception != null ) { throw exception ; } return done ; |
public class SibRaManagedConnection { /** * Cleans up this managed connection prior to returning it to the free pool .
* Invalidates any connection handles still associated with the managed
* connection as , in the normal case , they would all have been dissociated
* before cleanup was started . */
public void cl... | if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "cleanup" ) ; } // Invalidate any currently associated connections
for ( Iterator iterator = _connections . iterator ( ) ; iterator . hasNext ( ) ; ) { final SibRaConnection connection = ( SibRaConnection ) it... |
public class CmsUpdateInfo { /** * Checks if the categoryfolder setting needs to be updated .
* @ return true if the categoryfolder setting needs to be updated */
public boolean needToSetCategoryFolder ( ) { } } | if ( m_adeModuleVersion == null ) { return true ; } CmsModuleVersion categoryFolderUpdateVersion = new CmsModuleVersion ( "9.0.0" ) ; return ( m_adeModuleVersion . compareTo ( categoryFolderUpdateVersion ) == - 1 ) ; |
public class PolicyUtils { /** * Obtains the metadata for the given document .
* @ param docIS
* the document as an InputStream
* @ return the document metadata as a Map */
public Map < String , String > getDocumentMetadata ( InputStream docIS ) { } } | Map < String , String > metadata = new HashMap < String , String > ( ) ; try { // Create instance of DocumentBuilderFactory
DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; // Get the DocumentBuilder
DocumentBuilder docBuilder = factory . newDocumentBuilder ( ) ; // Create blank DOM Document ... |
public class XMLEmitter { /** * Comment node .
* @ param sComment
* The comment text */
public void onComment ( @ Nullable final String sComment ) { } } | if ( StringHelper . hasText ( sComment ) ) { if ( isThrowExceptionOnNestedComments ( ) ) if ( sComment . contains ( COMMENT_START ) || sComment . contains ( COMMENT_END ) ) throw new IllegalArgumentException ( "XML comment contains nested XML comment: " + sComment ) ; _append ( COMMENT_START ) . _append ( sComment ) . ... |
public class UUID { /** * Returns the given { @ code value } represented by the specified number of hex { @ code digits } .
* @ param value is the number to format .
* @ param digits are the number of digits requested .
* @ return the given { @ code value } as hex { @ link String } with the given number of digits... | long hi = 1L << ( digits * 4 ) ; return Long . toHexString ( hi | ( value & ( hi - 1 ) ) ) . substring ( 1 ) ; |
public class TldTaglibTypeImpl { /** * Returns all < code > function < / code > elements
* @ return list of < code > function < / code > */
public List < FunctionType < TldTaglibType < T > > > getAllFunction ( ) { } } | List < FunctionType < TldTaglibType < T > > > list = new ArrayList < FunctionType < TldTaglibType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "function" ) ; for ( Node node : nodeList ) { FunctionType < TldTaglibType < T > > type = new FunctionTypeImpl < TldTaglibType < T > > ( this , "function" , childN... |
public class CoronaJobHistory { /** * Log job ' s priority .
* @ param priority Jobs priority */
public void logJobPriority ( JobID jobid , JobPriority priority ) { } } | if ( disableHistory ) { return ; } if ( null != writers ) { log ( writers , RecordTypes . Job , new Keys [ ] { Keys . JOBID , Keys . JOB_PRIORITY } , new String [ ] { jobId . toString ( ) , priority . toString ( ) } ) ; } |
public class MCCImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . MCC__RG : return rg != null && ! rg . isEmpty ( ) ; } return super . eIsSet ( featureID ) ; |
public class JITDeploy { /** * d497921 */
public static Class < ? > generateWSEJBProxy ( ClassLoader classLoader , String proxyClassName , Class < ? > proxyInterface , Method [ ] proxyMethods , EJBMethodInfoImpl [ ] methodInfos , String ejbClassName , String beanName , ClassDefiner classDefiner ) throws ClassNotFoundEx... | Class < ? > rtnClass = null ; final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; // d576626
if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "generateWSEJBProxy: " + proxyClassName + " : " + beanName ) ; try { byte [ ] classbytes = WSEJBProxy . generateClassBytes ( proxyClassName , proxyI... |
public class AspectranNodeParser { /** * Adds the settings nodelets . */
private void addSettingsNodelets ( ) { } } | parser . setXpath ( "/aspectran/settings" ) ; parser . addNodeEndlet ( text -> { assistant . applySettings ( ) ; } ) ; parser . setXpath ( "/aspectran/settings/setting" ) ; parser . addNodelet ( attrs -> { String name = attrs . get ( "name" ) ; String value = attrs . get ( "value" ) ; assistant . putSetting ( name , va... |
public class RunsInner { /** * Cancel an existing run .
* @ 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 the ... | beginCancelWithServiceResponseAsync ( resourceGroupName , registryName , runId ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class QuotaLimit { /** * < pre >
* Tiered limit values . You must specify this as a key : value pair , with an
* integer value that is the maximum number of requests allowed for the
* specified unit . Currently only STANDARD is supported .
* < / pre >
* < code > map & lt ; string , int64 & gt ; values ... | if ( key == null ) { throw new java . lang . NullPointerException ( ) ; } java . util . Map < java . lang . String , java . lang . Long > map = internalGetValues ( ) . getMap ( ) ; return map . containsKey ( key ) ? map . get ( key ) : defaultValue ; |
public class ExtractorConfig { /** * Get string array .
* @ param key the key
* @ return the string [ ] */
public String [ ] getStringArray ( String key ) { } } | try { return getValue ( String [ ] . class , key ) ; } catch ( ClassCastException e ) { return new String [ ] { getString ( key ) } ; } |
public class Strands { /** * Disables the current strand for thread scheduling purposes , for up to
* the specified waiting time , unless the permit is available .
* If the permit is available then it is consumed and the call
* returns immediately ; otherwise the current strand becomes disabled
* for scheduling... | try { Strand . parkNanos ( nanos ) ; } catch ( SuspendExecution e ) { throw RuntimeSuspendExecution . of ( e ) ; } |
public class StylesheetRoot { /** * Get an " xsl : template " property by node match . This looks in the imports as
* well as this stylesheet .
* @ see < a href = " http : / / www . w3 . org / TR / xslt # section - Defining - Template - Rules " > section - Defining - Template - Rules in XSLT Specification < / a >
... | return m_templateList . getTemplate ( xctxt , targetNode , mode , quietConflictWarnings , dtm ) ; |
public class ChunkBlockHandler { /** * Adds a coordinate for the { @ link Chunk Chunks } around { @ link BlockPos } .
* @ param world the world
* @ param pos the pos
* @ param size the size */
private void addCoord ( World world , BlockPos pos , int size ) { } } | getAffectedChunks ( world , pos . getX ( ) , pos . getZ ( ) , size ) . forEach ( c -> addCoord ( c , pos ) ) ; |
public class EventDispatcher { protected int subscribe_quality_change_event ( String attr_name , String [ ] filters , boolean stateless ) throws DevFailed { } } | return event_supplier . subscribe_event ( attr_name , QUALITY_EVENT , this , filters , stateless ) ; |
public class WebUtils { /** * 执行带文件上传的HTTP POST请求 。
* @ param url 请求地址
* @ param params 文本请求参数
* @ param fileParams 文件请求参数
* @ param charset 字符集 , 如UTF - 8 , GBK , GB2312
* @ param connectTimeout 连接超时时间
* @ param readTimeout 请求超时时间
* @ param proxyHost 代理host , 传null表示不使用代理
* @ param proxyPort 代理端口 , 传0表... | if ( fileParams == null || fileParams . isEmpty ( ) ) { return doPost ( url , params , charset , connectTimeout , readTimeout , proxyHost , proxyPort ) ; } String boundary = System . currentTimeMillis ( ) + "" ; // 随机分隔线
HttpURLConnection conn = null ; OutputStream out = null ; String rsp = null ; try { try { String ct... |
public class FastThreadLocal { /** * Set the value for the current thread . */
public final void set ( V value ) { } } | if ( value != InternalThreadLocalMap . UNSET ) { InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap . get ( ) ; setKnownNotUnset ( threadLocalMap , value ) ; } else { remove ( ) ; } |
public class Engraver { /** * Sets the engraving mode
* < ul > < li > { @ link # NONE } : equal space between each note
* < li > { @ link # DEFAULT } : smaller space for short note , bigger space for long notes , something that look nice ; )
* < / ul >
* @ param mode { @ link # DEFAULT } or { @ link # NONE }
... | // only reset if needed
if ( m_mode == mode && m_variation == variation ) return ; spacesAfter . clear ( ) ; m_mode = mode ; // bounds variation %
// variation = Math . max ( variation , - 50 ) ;
m_variation = Math . max ( VARIATION_MIN , Math . min ( VARIATION_MAX , variation ) ) ; if ( m_mode == DEFAULT ) { double fa... |
public class Post { /** * Adds children to a post .
* @ param children The children to add .
* @ return The post with children added . */
public final Post withChildren ( final List < Post > children ) { } } | return new Post ( id , slug , title , excerpt , content , authorId , author , publishTimestamp , modifiedTimestamp , status , parentId , guid , commentCount , this . metadata , type , mimeType , taxonomyTerms , children != null ? ImmutableList . copyOf ( children ) : ImmutableList . of ( ) ) ; |
public class CollectionHelpers { /** * Returns an unmodifiable Collection View made up of the given Collections while translating the items into a common type .
* The returned Collection View does not copy any of the data from any of the given Collections , therefore any changes
* in the two Collections will be ref... | return new ConvertedSetView < > ( c1 , converter1 , c2 , converter2 ) ; |
public class DisambiguateProperties { /** * Returns the corresponding instance if ` maybePrototype ` is a prototype of a constructor ,
* otherwise null */
@ Nullable private static JSType getInstanceIfPrototype ( JSType maybePrototype ) { } } | if ( maybePrototype . isFunctionPrototypeType ( ) ) { FunctionType constructor = maybePrototype . toObjectType ( ) . getOwnerFunction ( ) ; if ( constructor != null ) { if ( ! constructor . hasInstanceType ( ) ) { // this can happen when adding to the prototype of a non - constructor function
return null ; } return con... |
public class RouteDelegate { /** * Determines whether the given annotation is a ' constraint ' or not .
* It just checks if the annotation has the { @ link Constraint } annotation on it or if the annotation is the { @ link
* Valid } annotation .
* @ param annotation the annotation to check
* @ return { @ code t... | return annotation . annotationType ( ) . isAnnotationPresent ( Constraint . class ) || annotation . annotationType ( ) . equals ( Valid . class ) ; |
public class Dater { /** * Sets the hour , minute , second to the delegate date , format is { @ link DateStyle # CLOCK }
* @ see # setClock ( int , int , int )
* @ see DateStyle # CLOCK
* @ param clock
* @ return */
public Dater setClock ( String clock ) { } } | String tip = "clock format must HH:mm:ss" ; checkArgument ( checkNotNull ( clock ) . length ( ) == 8 , tip ) ; List < String > pieces = Splitter . on ( ":" ) . splitToList ( clock ) ; checkArgument ( pieces . size ( ) == 3 , tip ) ; return setClock ( Ints . tryParse ( pieces . get ( 0 ) ) , Ints . tryParse ( pieces . g... |
public class Regex { /** * Splits the input
* @ param in
* @ param bufferSize
* @ param limit See java . util . Pattern . split
* @ return
* @ throws IOException
* @ see Pattern . split */
public String [ ] split ( PushbackReader in , int bufferSize , int limit ) throws IOException { } } | InputReader reader = Input . getInstance ( in , bufferSize ) ; List < String > list = split ( reader , limit ) ; return list . toArray ( new String [ list . size ( ) ] ) ; |
public class FSNamesystem { /** * Create all the necessary directories */
private INode mkdirsInternal ( String src , PermissionStatus permissions ) throws IOException { } } | src = dir . normalizePath ( src ) ; // tokenize the src into components
String [ ] names = INodeDirectory . getPathNames ( src ) ; if ( ! pathValidator . isValidName ( src , names ) ) { numInvalidFilePathOperations ++ ; throw new IOException ( "Invalid directory name: " + src ) ; } // check validity of the username
che... |
public class Http { /** * Makes POST request to given URL
* @ param url url
* @ param body request body to post or null to skip
* @ param query query to append to url or null to skip
* @ return Response object with HTTP response code and response as String
* @ throws HttpException in case of invalid input par... | return post ( url , body , query , null , DEFAULT_CONNECT_TIMEOUT , DEFAULT_READ_TIMEOUT ) ; |
public class GenericSQLHelper { /** * Generate generic exec SQL .
* @ param methodBuilder
* the method builder
* @ param method
* the method */
public static void generateGenericExecSQL ( MethodSpec . Builder methodBuilder , final SQLiteModelMethod method ) { } } | boolean nullable ; final List < String > paramsList = new ArrayList < String > ( ) ; final List < String > contentValueList = new ArrayList < String > ( ) ; final One < Boolean > columnsToUpdate = new One < Boolean > ( true ) ; String sql = JQLChecker . getInstance ( ) . replace ( method , method . jql , new JQLReplace... |
public class PiElectronegativityDescriptor { /** * Gets the parameters attribute of the PiElectronegativityDescriptor
* object
* @ return The parameters value */
@ Override public Object [ ] getParameters ( ) { } } | // return the parameters as used for the descriptor calculation
Object [ ] params = new Object [ 3 ] ; params [ 0 ] = maxIterations ; params [ 1 ] = lpeChecker ; params [ 2 ] = maxResonStruc ; return params ; |
public class ParameterBuilder { /** * Sets a regular expression that must match for parameter values to be considered as valid . */
public ParameterBuilder matching ( String regex ) { } } | Validate . notNull ( regex , "regex is required" ) ; this . pattern = Pattern . compile ( regex ) ; return this ; |
public class WebSocket { /** * Stop both the reading thread and the writing thread .
* The reading thread will call { @ link # onReadingThreadFinished ( WebSocketFrame ) }
* as its last step . Likewise , the writing thread will call { @ link
* # onWritingThreadFinished ( WebSocketFrame ) } as its last step .
* ... | ReadingThread readingThread ; WritingThread writingThread ; synchronized ( mThreadsLock ) { readingThread = mReadingThread ; writingThread = mWritingThread ; mReadingThread = null ; mWritingThread = null ; } if ( readingThread != null ) { readingThread . requestStop ( closeDelay ) ; } if ( writingThread != null ) { wri... |
public class KatharsisBoot { /** * Sets the default page limit for requests that return a collection of elements . If the api user does not
* specify the page limit , then this default value will be used .
* This is important to prevent denial of service attacks on the server .
* NOTE : This using this feature re... | PreconditionUtil . assertNotNull ( "Setting the default page limit requires using the QuerySpecDeserializer, but " + "it is null. Are you using QueryParams instead?" , this . querySpecDeserializer ) ; ( ( DefaultQuerySpecDeserializer ) this . querySpecDeserializer ) . setDefaultLimit ( defaultPageLimit ) ; |
public class OptionUtil { /** * Format a description of a Parameterizable ( including recursive options ) .
* @ param buf Buffer to append to .
* @ param pcls Parameterizable class to describe
* @ param width Width
* @ param indent Text indent
* @ return Formatted description */
public static StringBuilder de... | println ( buf , width , "Description for class " + pcls . getName ( ) ) ; Title title = pcls . getAnnotation ( Title . class ) ; if ( title != null && title . value ( ) != null && ! title . value ( ) . isEmpty ( ) ) { println ( buf , width , title . value ( ) ) ; } Description desc = pcls . getAnnotation ( Description ... |
public class AudioStreamEncoder { /** * Encodes the given AudioInputStream , using the given FLACEncoder .
* FLACEncoder must be in a state to accept samples and encode ( FLACOutputStream ,
* EncodingConfiguration , and StreamConfiguration have been set , and FLAC stream
* has been opened ) .
* @ param sin
* ... | AudioFormat format = sin . getFormat ( ) ; int frameSize = format . getFrameSize ( ) ; int sampleSize = format . getSampleSizeInBits ( ) ; int bytesPerSample = sampleSize / 8 ; if ( sampleSize % 8 != 0 ) { // end processing now
throw new IllegalArgumentException ( "Unsupported Sample Size: size = " + sampleSize ) ; } i... |
public class DescribeDBSecurityGroupsResult { /** * A list of < a > DBSecurityGroup < / a > instances .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setDBSecurityGroups ( java . util . Collection ) } or { @ link # withDBSecurityGroups ( java . util . Colle... | if ( this . dBSecurityGroups == null ) { setDBSecurityGroups ( new com . amazonaws . internal . SdkInternalList < DBSecurityGroup > ( dBSecurityGroups . length ) ) ; } for ( DBSecurityGroup ele : dBSecurityGroups ) { this . dBSecurityGroups . add ( ele ) ; } return this ; |
public class ScriptModuleLoader { /** * Add or update the existing { @ link ScriptModule } s with the given script archives .
* This method will convert the archives to modules and then compile + link them in to the
* dependency graph . It will then recursively re - link any modules depending on the new modules .
... | Objects . requireNonNull ( candidateArchives ) ; long updateNumber = System . currentTimeMillis ( ) ; // map script module id to archive to be compiled
Map < ModuleId , ScriptArchive > archivesToCompile = new HashMap < ModuleId , ScriptArchive > ( candidateArchives . size ( ) * 2 ) ; // create an updated mapping of the... |
public class StandardLinkBuilder { /** * Process an already - built URL just before returning it .
* By default , this method will apply the { @ code HttpServletResponse . encodeURL ( url ) } mechanism , as standard
* when using the Java Servlet API . Note however that this will only be applied if { @ code context ... | if ( ! ( context instanceof IWebContext ) ) { return link ; } final HttpServletResponse response = ( ( IWebContext ) context ) . getResponse ( ) ; return ( response != null ? response . encodeURL ( link ) : link ) ; |
public class BaseMessageFilter { /** * Set the message receiver for this filter .
* @ param messageReceiver The message receiver . */
public void setMessageReceiver ( BaseMessageReceiver messageReceiver , Integer intID ) { } } | if ( ( messageReceiver != null ) || ( intID != null ) ) if ( ( m_intID != null ) || ( m_messageReceiver != null ) ) Util . getLogger ( ) . warning ( "BaseMessageFilter/setMessageReceiver()----Error - Filter added twice." ) ; m_messageReceiver = messageReceiver ; m_intID = intID ; |
public class RemoteMongoCollectionImpl { /** * Finds all documents in the collection .
* @ param resultClass the class to decode each document into
* @ param < ResultT > the target document type of the iterable .
* @ return the find iterable interface */
public < ResultT > RemoteFindIterable < ResultT > find ( fi... | return new RemoteFindIterableImpl < > ( proxy . find ( resultClass ) , dispatcher ) ; |
public class PeerConnectionInt { /** * Call this method when new candidate arrived from other peer
* @ param index index of media in sdp
* @ param id id of candidate
* @ param sdp sdp of candidate */
public void onCandidate ( long sessionId , int index , String id , String sdp ) { } } | send ( new PeerConnectionActor . OnCandidate ( sessionId , index , id , sdp ) ) ; |
public class PassConfig { /** * Regenerates the top scope potentially only for a sub - tree of AST and then
* copies information for the old global scope .
* @ param compiler The compiler for which the global scope is generated .
* @ param scriptRoot The root of the AST used to generate global scope . */
void pat... | checkNotNull ( typedScopeCreator ) ; typedScopeCreator . patchGlobalScope ( topScope , scriptRoot ) ; |
public class GaussianLikelihoodManager { /** * Precomputes likelihood for all the mixtures */
public void precomputeAll ( ) { } } | precomputes . resize ( mixtures . size ( ) ) ; for ( int i = 0 ; i < precomputes . size ; i ++ ) { precomputes . get ( i ) . setGaussian ( mixtures . get ( i ) ) ; } |
public class InterpretedContainerImpl { /** * This method will create a new root Container for the supplied < code > entity < / code > when moving up from this container . As we are moving up from this container the
* < code > entity < / code > being passed in should either be the one returned from < code > delegate ... | // first we need to see if we need a new overlay container , you only get new overlays for new artifact roots , not fake roots
OverlayContainer newOverlay = rootOverlay ; if ( delegate . isRoot ( ) ) { // the delegate was root , so we ' re moving up to a new artifact root .
// we have to correct the overlay
// the over... |
public class LatentRelationalAnalysis { /** * Searches an index given the index directory and counts up the frequncy of the two words used in a phrase .
* @ param indexDir a String containing the directory where the index is stored
* @ param A a { @ code String } containing the first word of the phrase
* @ param ... | File indexDir_f = new File ( indexDir ) ; if ( ! indexDir_f . exists ( ) || ! indexDir_f . isDirectory ( ) ) { System . err . println ( "Search failed: index directory does not exist" ) ; } else { try { return searchPhrase ( indexDir_f , A , B ) ; } catch ( Exception e ) { System . err . println ( "Unable to search " +... |
public class CachingAuthenticator { /** * Discards any cached principal for the collection of credentials satisfying the given predicate .
* @ param predicate a predicate to filter credentials */
public void invalidateAll ( Predicate < ? super C > predicate ) { } } | final Set < C > keys = cache . asMap ( ) . keySet ( ) . stream ( ) . filter ( predicate ) . collect ( Collectors . toSet ( ) ) ; cache . invalidateAll ( keys ) ; |
public class TextUtil { /** * Merge the given strings with to separators .
* The separators are used to delimit the groups
* of characters .
* < p > Examples :
* < ul >
* < li > < code > merge ( ' { ' , ' } ' , " a " , " b " , " cd " ) < / code > returns the string
* < code > " { a } { b } { cd } " < / code... | final StringBuilder buffer = new StringBuilder ( ) ; for ( final Object s : strs ) { buffer . append ( leftSeparator ) ; if ( s != null ) { buffer . append ( s . toString ( ) ) ; } buffer . append ( rightSeparator ) ; } return buffer . toString ( ) ; |
public class CommerceAddressRestrictionPersistenceImpl { /** * Removes the commerce address restriction with the primary key from the database . Also notifies the appropriate model listeners .
* @ param primaryKey the primary key of the commerce address restriction
* @ return the commerce address restriction that w... | Session session = null ; try { session = openSession ( ) ; CommerceAddressRestriction commerceAddressRestriction = ( CommerceAddressRestriction ) session . get ( CommerceAddressRestrictionImpl . class , primaryKey ) ; if ( commerceAddressRestriction == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH... |
public class Pareto { /** * The crowding distance value of a solution provides an estimate of the
* density of solutions surrounding that solution . The < em > crowding
* distance < / em > value of a particular solution is the average distance of
* its two neighboring solutions .
* @ apiNote
* Calculating the... | return crowdingDistance ( set , Vec :: compare , Vec :: distance , Vec :: length ) ; |
public class TaskQueue { /** * Establishes the heap invariant ( described above ) assuming the heap
* satisfies the invariant except possibly for the leaf - node indexed by k
* ( which may have a nextExecutionTime less than its parent ' s ) .
* This method functions by " promoting " queue [ k ] up the hierarchy
... | while ( k > 1 ) { int j = k >> 1 ; if ( queue [ j ] . nextExecutionTime <= queue [ k ] . nextExecutionTime ) break ; TimerTask tmp = queue [ j ] ; queue [ j ] = queue [ k ] ; queue [ k ] = tmp ; k = j ; } |
public class AtomContainerManipulator { /** * Counts the number of implicit hydrogens on the provided IAtomContainer .
* As this method will sum all implicit hydrogens on each atom it is
* important to ensure the atoms have already been perceived ( and thus have
* an implicit hydrogen count ) ( see .
* { @ link... | if ( container == null ) throw new IllegalArgumentException ( "null container provided" ) ; int count = 0 ; for ( IAtom atom : container . atoms ( ) ) { Integer implicit = atom . getImplicitHydrogenCount ( ) ; if ( implicit != null ) { count += implicit ; } } return count ; |
public class UnifierConfiguration { /** * Prepares equivalence types for features to be tested . All equivalence
* types are given as { @ link PatternToken } s . They create an equivalence set ( with
* abstraction ) .
* @ param feature Feature to be tested , like gender , grammatical case or number .
* @ param ... | EquivalenceTypeLocator typeKey = new EquivalenceTypeLocator ( feature , type ) ; if ( equivalenceTypes . containsKey ( typeKey ) ) { return ; } equivalenceTypes . put ( typeKey , elem ) ; List < String > lTypes ; if ( equivalenceFeatures . containsKey ( feature ) ) { lTypes = equivalenceFeatures . get ( feature ) ; } e... |
public class PatternInputStream { /** * Read next chunk from this stream .
* @ return a chunk
* @ throws IOException if chunk can not be read */
@ Override public Chunk < byte [ ] , BytesReference > readChunk ( ) throws IOException { } } | Chunk < byte [ ] , BytesReference > chunk = internalReadChunk ( ) ; if ( chunk != null ) { processChunk ( chunk ) ; } return chunk ; |
public class Config { /** * Returns the map merkle tree config for the given name , creating one
* if necessary and adding it to the collection of known configurations .
* The configuration is found by matching the configuration name
* pattern to the provided { @ code name } without the partition qualifier
* ( ... | return ConfigUtils . getConfig ( configPatternMatcher , mapMerkleTreeConfigs , name , MerkleTreeConfig . class , new BiConsumer < MerkleTreeConfig , String > ( ) { @ Override public void accept ( MerkleTreeConfig merkleTreeConfig , String name ) { merkleTreeConfig . setMapName ( name ) ; if ( "default" . equals ( name ... |
public class ResourceClaim { /** * Grab a ticket in the queue .
* @ param zookeeper ZooKeeper connection to use .
* @ param lockNode Path to the znode representing the locking queue .
* @ param ticket Name of the ticket to attempt to grab .
* @ return True on success , false if the ticket was already grabbed by... | try { zookeeper . create ( lockNode + "/" + ticket , new byte [ 0 ] , ZooDefs . Ids . OPEN_ACL_UNSAFE , CreateMode . EPHEMERAL ) ; } catch ( KeeperException e ) { if ( e . code ( ) == KeeperException . Code . NODEEXISTS ) { // It is possible that two processes try to grab the exact same ticket at the same time .
// Thi... |
public class SynchronizedRingByteBuffer { /** * Calls fill if rings marked fits . Otherwise returns 0.
* @ param ring
* @ return
* @ throws IOException
* @ throws InterruptedException */
public int tryFillAll ( RingByteBuffer ring ) throws IOException , InterruptedException { } } | fillLock . lock ( ) ; try { if ( ring . marked ( ) > free ( ) ) { return 0 ; } return fill ( ring ) ; } finally { fillLock . unlock ( ) ; } |
public class BuildStepsInner { /** * List the build arguments for a step including the secret arguments .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ param serviceFuture the ServiceFuture object tracking the Retrofit calls
* @ param serviceCallback the async Servi... | return AzureServiceFuture . fromPageResponse ( listBuildArgumentsNextSinglePageAsync ( nextPageLink ) , new Func1 < String , Observable < ServiceResponse < Page < BuildArgumentInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < BuildArgumentInner > > > call ( String nextPageLink ) { return listB... |
public class CommerceNotificationAttachmentUtil { /** * Returns the last commerce notification attachment in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; .
* @ param uuid the uuid
* @ param companyId the company ID
* @ param orderByComparator the comparator to order the set by ( optionally < cod... | return getPersistence ( ) . fetchByUuid_C_Last ( uuid , companyId , orderByComparator ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.