signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Codecs { /** * Create a permutation { @ code Codec } with the given alleles .
* @ param alleles the alleles of the permutation
* @ param < T > the allele type
* @ return a new permutation { @ code Codec }
* @ throws IllegalArgumentException if the given allele array is empty
* @ throws NullPointe... | if ( alleles . isEmpty ( ) ) { throw new IllegalArgumentException ( "Empty allele array is not allowed." ) ; } return Codec . of ( Genotype . of ( PermutationChromosome . of ( alleles ) ) , gt -> gt . getChromosome ( ) . stream ( ) . map ( EnumGene :: getAllele ) . collect ( ISeq . toISeq ( ) ) ) ; |
public class SourceMapGeneratorV3 { /** * Sets the source code that exists in the buffer for which the
* generated code is being generated . This ensures that the source map
* accurately reflects the fact that the source is being appended to
* an existing buffer and as such , does not start at line 0 , position 0... | checkState ( offsetLine >= 0 ) ; checkState ( offsetIndex >= 0 ) ; offsetPosition = new FilePosition ( offsetLine , offsetIndex ) ; |
public class InitStrategy { /** * Returns the list of * . jpi , * . hpi and * . hpl to expand and load .
* Normally we look at { @ code $ JENKINS _ HOME / plugins / * . jpi } and * . hpi and * . hpl .
* @ return
* never null but can be empty . The list can contain different versions of the same plugin ,
* and w... | List < File > r = new ArrayList < > ( ) ; // the ordering makes sure that during the debugging we get proper precedence among duplicates .
// for example , while doing " mvn jpi : run " or " mvn hpi : run " on a plugin that ' s bundled with Jenkins , we want to the
// * . jpl file to override the bundled jpi / hpi file... |
public class StyleCache { /** * Set the style into the polyline options
* @ param polylineOptions polyline options
* @ param style style row
* @ return true if style was set into the polyline options */
public boolean setStyle ( PolylineOptions polylineOptions , StyleRow style ) { } } | return StyleUtils . setStyle ( polylineOptions , style , density ) ; |
public class HtmlDocletWriter { /** * Get user specified header and the footer .
* @ param header if true print the user provided header else print the
* user provided footer . */
public Content getUserHeaderFooter ( boolean header ) { } } | String content ; if ( header ) { content = replaceDocRootDir ( configuration . header ) ; } else { if ( configuration . footer . length ( ) != 0 ) { content = replaceDocRootDir ( configuration . footer ) ; } else { content = replaceDocRootDir ( configuration . header ) ; } } Content rawContent = new RawHtml ( content )... |
public class CmsFocalPointController { /** * Handles mouse drag . < p >
* @ param nativeEvent the mousemove event */
private void handleMove ( NativeEvent nativeEvent ) { } } | Element imageElem = m_image . getElement ( ) ; int offsetX = ( ( int ) pageX ( nativeEvent ) ) - imageElem . getParentElement ( ) . getAbsoluteLeft ( ) ; int offsetY = ( ( int ) pageY ( nativeEvent ) ) - imageElem . getParentElement ( ) . getAbsoluteTop ( ) ; if ( m_coordinateTransform != null ) { CmsPoint screenPoint ... |
public class Util { void polling_configure ( ) { } } | // Send a stop polling command to thread in order not to poll devices
final DServer adm_dev = get_dserver_device ( ) ; try { adm_dev . stop_polling ( ) ; } catch ( final DevFailed e ) { Except . print_exception ( e ) ; } final Vector tmp_cl_list = adm_dev . get_class_list ( ) ; // DeviceClass
int upd ; // Create the st... |
public class AbstractGenerateSoyEscapingDirectiveCode { /** * Called reflectively when Ant sees { @ code < input > } to specify a file that uses the generated
* helper functions . */
public FileRef createInput ( ) { } } | FileRef ref = new FileRef ( true ) ; inputs . add ( ref ) ; return ref ; |
public class SnackbarBuilder { /** * Set the callback to be informed of the Snackbar being dismissed due to being swiped away .
* @ param callback The callback .
* @ return This instance . */
@ SuppressWarnings ( "WeakerAccess" ) public SnackbarBuilder swipeDismissCallback ( final SnackbarSwipeDismissCallback callb... | callbacks . add ( new SnackbarCallback ( ) { public void onSnackbarSwiped ( Snackbar snackbar ) { callback . onSnackbarSwiped ( snackbar ) ; } } ) ; return this ; |
public class CommerceDiscountRulePersistenceImpl { /** * Returns a range of all the commerce discount rules .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result ... | return findAll ( start , end , null ) ; |
public class DDLCompiler { /** * Add a constraint on a given table to the catalog
* @ param table The table on which the constraint will be enforced
* @ param node The XML node representing the constraint
* @ param indexReplacementMap
* @ throws VoltCompilerException */
private void addConstraintToCatalog ( Tab... | assert node . name . equals ( "constraint" ) ; String name = node . attributes . get ( "name" ) ; String typeName = node . attributes . get ( "constrainttype" ) ; ConstraintType type = ConstraintType . valueOf ( typeName ) ; String tableName = table . getTypeName ( ) ; if ( type == ConstraintType . LIMIT ) { int tupleL... |
public class Reflector { /** * call constructor of a class with matching arguments
* @ param clazz Class to get Instance
* @ param args Arguments for the Class
* @ return invoked Instance
* @ throws PageException */
public static Object callConstructor ( Class clazz , Object [ ] args ) throws PageException { } ... | args = cleanArgs ( args ) ; try { return getConstructorInstance ( clazz , args ) . invoke ( ) ; } catch ( InvocationTargetException e ) { Throwable target = e . getTargetException ( ) ; if ( target instanceof PageException ) throw ( PageException ) target ; throw Caster . toPageException ( e . getTargetException ( ) ) ... |
public class FactoryDaoRegistry { /** * Creates a Dao for the specified object type . */
private < K , T extends Persistable < K > > CastorDao < K , T > _createDao ( final Class < T > type ) { } } | String daoClazzName = _typeMapping . get ( type . getName ( ) ) ; if ( _LOG_ . isDebugEnabled ( ) ) { _LOG_ . debug ( "creating Dao: object type=" + type + ", Dao type=" + daoClazzName ) ; } CastorDao < K , T > dao = null ; if ( daoClazzName == null ) { dao = new CastorDao < K , T > ( type ) ; } else { try { @ Suppress... |
public class RedisClient { /** * ( non - Javadoc )
* @ see com . impetus . kundera . client . Client # close ( ) */
@ Override public void close ( ) { } } | if ( settings != null ) { settings . clear ( ) ; settings = null ; } if ( connection != null ) { connection . disconnect ( ) ; connection = null ; } reader = null ; |
public class HttpRequestTimer { /** * Start the timer with the specified timeout and return a object that can be used to track the
* state of the timer and cancel it if need be .
* @ param apacheRequest
* HTTP request this timer will abort if triggered .
* @ param requestTimeoutMillis
* A positive value here ... | if ( isTimeoutDisabled ( requestTimeoutMillis ) ) { return NoOpHttpRequestAbortTaskTracker . INSTANCE ; } else if ( executor == null ) { initializeExecutor ( ) ; } HttpRequestAbortTaskImpl timerTask = new HttpRequestAbortTaskImpl ( apacheRequest ) ; ScheduledFuture < ? > timerTaskFuture = executor . schedule ( timerTas... |
public class ApiKeyRealm { /** * Gets the AuthenticationInfo that matches a token . This method is only called if the info is not already
* cached by the realm , so this method does not need to perform any further caching . */
@ SuppressWarnings ( "unchecked" ) @ Override protected AuthenticationInfo doGetAuthenticat... | String id ; if ( AnonymousToken . isAnonymous ( token ) ) { // Only continue if an anonymous identity has been set
if ( _anonymousId != null ) { id = _anonymousId ; } else { return null ; } } else { id = ( ( ApiKeyAuthenticationToken ) token ) . getPrincipal ( ) ; } return getUncachedAuthenticationInfoForKey ( id ) ; |
public class BoundsOnRatiosInThetaSketchedSets { /** * Gets the approximate lower bound for B over A based on a 95 % confidence interval
* @ param sketchA the sketch A
* @ param sketchB the sketch B
* @ return the approximate lower bound for B over A */
public static double getLowerBoundForBoverA ( final Sketch s... | final double thetaA = sketchA . getTheta ( ) ; final double thetaB = sketchB . getTheta ( ) ; checkThetas ( thetaA , thetaB ) ; final int countB = sketchB . getRetainedEntries ( true ) ; final int countA = ( thetaB == thetaA ) ? sketchA . getRetainedEntries ( true ) : sketchA . getCountLessThanTheta ( thetaB ) ; if ( c... |
public class Seconds { /** * Returns a new instance with the specified number of seconds added .
* This instance is immutable and unaffected by this method call .
* @ param seconds the amount of seconds to add , may be negative
* @ return the new period plus the specified number of seconds
* @ throws Arithmetic... | if ( seconds == 0 ) { return this ; } return Seconds . seconds ( FieldUtils . safeAdd ( getValue ( ) , seconds ) ) ; |
public class PennTreeReader { /** * Reads a single tree in standard Penn Treebank format from the
* input stream . The method supports additional parentheses around the
* tree ( an unnamed ROOT node ) so long as they are balanced . If the token stream
* ends before the current tree is complete , then the method w... | Tree t = null ; while ( tokenizer . hasNext ( ) && t == null ) { // Setup PDA
this . currentTree = null ; this . stack = new ArrayList < Tree > ( ) ; try { t = getTreeFromInputStream ( ) ; } catch ( NoSuchElementException e ) { throw new IOException ( "End of token stream encountered before parsing could complete." ) ;... |
public class RectangularShape { /** * Sets the location and size of the framing rectangle of this shape based on the specified
* center and corner points . */
public void setFrameFromCenter ( float centerX , float centerY , float cornerX , float cornerY ) { } } | float width = Math . abs ( cornerX - centerX ) ; float height = Math . abs ( cornerY - centerY ) ; setFrame ( centerX - width , centerY - height , width * 2 , height * 2 ) ; |
public class CacheableDataProvider { /** * Execute entry processor on entry cache
* @ param entry Entry on which will be executed entry processor
* @ param entryProcessor Entry processor that must be executed
* @ param < ReturnValue > ClassType
* @ return Return value from entry processor */
public < ReturnValu... | long key = buildHashCode ( entry ) ; if ( ! cache . containsKey ( key ) ) { List < Object > primaryKeys = getPrimaryKeys ( entry ) ; List < Entry > entries = super . fetch ( primaryKeys ) ; Optional < Entry > first = entries . stream ( ) . findFirst ( ) ; if ( first . isPresent ( ) ) { cache . putIfAbsent ( key , first... |
public class JsonPullParser { /** * Sets an Reader as the { @ code JSON } feed .
* @ param reader
* A Reader . Cannot be null . */
void setSource ( Reader reader ) { } } | if ( reader == null ) { throw new IllegalArgumentException ( "'reader' must not be null." ) ; } br = ( reader instanceof BufferedReader ) ? ( BufferedReader ) reader : new BufferedReader ( reader ) ; |
public class Serializer { /** * Write the object to the stream .
* @ param stream the stream to write the object to .
* @ param object the object to write to the stream .
* @ throws SerializationException the object could not be serialized . */
public void writeToStream ( OutputStream stream , Object object ) thr... | try { mapper . writeValue ( stream , object ) ; } catch ( IOException ex ) { throw new SerializationException ( "Exception during serialization" , ex ) ; } |
public class Spinner { /** * Obtains all attributes from a specific attribute set .
* @ param attributeSet
* The attribute set , the attributes should be obtained from , as an instance of the type
* { @ link AttributeSet } or null , if no attributes should be obtained */
private void obtainStyledAttributes ( @ Nu... | TypedArray typedArray = getContext ( ) . obtainStyledAttributes ( attributeSet , R . styleable . Spinner ) ; try { obtainHint ( typedArray ) ; obtainHintColor ( typedArray ) ; obtainSpinnerStyledAttributes ( typedArray ) ; } finally { typedArray . recycle ( ) ; } |
public class RegisterWebAppVisitorHS { /** * Load a class from class name .
* @ param clazz class of the required object
* @ param classLoader class loader to use to load the class
* @ param className class name for the class to load
* @ return class object
* @ throws NullArgumentException if any of the param... | NullArgumentException . validateNotNull ( clazz , "Class" ) ; NullArgumentException . validateNotNull ( classLoader , "ClassLoader" ) ; NullArgumentException . validateNotNull ( className , "Servlet Class" ) ; return ( Class < ? extends T > ) classLoader . loadClass ( className ) ; |
public class GetMetricDataResult { /** * The metrics that are returned , including the metric name , namespace , and dimensions .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setMetricDataResults ( java . util . Collection ) } or { @ link # withMetricDataR... | if ( this . metricDataResults == null ) { setMetricDataResults ( new com . amazonaws . internal . SdkInternalList < MetricDataResult > ( metricDataResults . length ) ) ; } for ( MetricDataResult ele : metricDataResults ) { this . metricDataResults . add ( ele ) ; } return this ; |
public class CFFFontSubset { /** * Function builds the new offset array , object array and assembles the index .
* used for creating the glyph and subrs subsetted index
* @ param Offsets the offset array of the original index
* @ param Used the hashmap of the used objects
* @ param OperatorForUnusedEntries the ... | int unusedCount = 0 ; int Offset = 0 ; int [ ] NewOffsets = new int [ Offsets . length ] ; // Build the Offsets Array for the Subset
for ( int i = 0 ; i < Offsets . length ; ++ i ) { NewOffsets [ i ] = Offset ; // If the object in the offset is also present in the used
// HashMap then increment the offset var by its si... |
public class Http { /** * Makes PUT 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
* @ param headers to include or null to skip
* @ param connectTimeOut connect time out in ms
* @ param readTimeOut read time o... | return execute ( "PUT" , url , body , query , headers , connectTimeOut , readTimeOut ) ; |
public class ClientState { /** * Attempts to login the given user . */
public void login ( AuthenticatedUser user ) throws AuthenticationException { } } | if ( ! user . isAnonymous ( ) && ! Auth . isExistingUser ( user . getName ( ) ) ) throw new AuthenticationException ( String . format ( "User %s doesn't exist - create it with CREATE USER query first" , user . getName ( ) ) ) ; this . user = user ; |
public class KeyEncoder { /** * Encodes the given Boolean object into exactly 1 byte for descending
* order .
* @ param value optional Boolean value to encode
* @ param dst destination for encoded bytes
* @ param dstOffset offset into destination array */
public static void encodeDesc ( Boolean value , byte [ ]... | if ( value == null ) { dst [ dstOffset ] = NULL_BYTE_LOW ; } else { dst [ dstOffset ] = value . booleanValue ( ) ? ( byte ) 127 : ( byte ) 128 ; } |
public class QrCodeDecoderImage { /** * Reads the format bits near the corner position pattern */
private boolean readFormatRegion0 ( QrCode qr ) { } } | // set the coordinate system to the closest pp to reduce position errors
gridReader . setSquare ( qr . ppCorner , ( float ) qr . threshCorner ) ; bits . resize ( 15 ) ; bits . zero ( ) ; for ( int i = 0 ; i < 6 ; i ++ ) { read ( i , i , 8 ) ; } read ( 6 , 7 , 8 ) ; read ( 7 , 8 , 8 ) ; read ( 8 , 8 , 7 ) ; for ( int i ... |
public class EndpointDemographicMarshaller { /** * Marshall the given parameter object . */
public void marshall ( EndpointDemographic endpointDemographic , ProtocolMarshaller protocolMarshaller ) { } } | if ( endpointDemographic == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( endpointDemographic . getAppVersion ( ) , APPVERSION_BINDING ) ; protocolMarshaller . marshall ( endpointDemographic . getLocale ( ) , LOCALE_BINDING ) ; protocolMar... |
public class AssertUtils { /** * Indicates if a class or at least one of its annotations is annotated by a given annotation .
* Notice that the classes with a package name starting with " java . lang " will be ignored .
* @ param memberDeclaringClass the class to check
* @ param candidate the annotation to find
... | if ( memberDeclaringClass . equals ( candidate ) ) { return true ; } for ( Annotation anno : memberDeclaringClass . getAnnotations ( ) ) { Class < ? extends Annotation > annoClass = anno . annotationType ( ) ; if ( ! annoClass . getPackage ( ) . getName ( ) . startsWith ( "java.lang" ) && hasAnnotationDeep ( annoClass ... |
public class FieldCriteria { /** * Only to be used by InMemoryRepository */
public PropertyInterface getProperty ( ) { } } | if ( property == null ) { property = Properties . getPropertyByPath ( classHolder . getClazz ( ) , path ) ; } return property ; |
public class CounterManagerNotificationManager { /** * It registers the cache listeners if they aren ' t already registered .
* @ param cache The { @ link Cache } to register the listener . */
public synchronized void listenOn ( Cache < CounterKey , CounterValue > cache ) throws InterruptedException { } } | if ( ! topologyListener . registered ) { this . cache = cache ; topologyListener . register ( cache ) ; } if ( ! listenersRegistered ) { this . cache . addListener ( valueListener , CounterKeyFilter . getInstance ( ) ) ; listenersRegistered = true ; } |
public class PlayerServlet { /** * { @ inheritDoc } */
@ Override protected void doBye ( SipServletRequest request ) throws ServletException , IOException { } } | logger . info ( "MediaPlaybackServlet: Got BYE request:\n" + request ) ; isBye = true ; MediaSession mediaSession = ( MediaSession ) request . getSession ( ) . getAttribute ( "MEDIA_SESSION" ) ; mediaSession . release ( ) ; request . getSession ( ) . removeAttribute ( "MEDIA_SESSION" ) ; SipServletResponse sipServletRe... |
public class TextSimilarity { /** * 词列表1和词列表2的相似度分值
* @ param words1 词列表1
* @ param words2 词列表2
* @ return 相似度分值 */
@ Override public double similarScore ( List < Word > words1 , List < Word > words2 ) { } } | if ( words1 == null || words2 == null ) { // 只要有一个文本为null , 规定相似度分值为0 , 表示完全不相等
return 0.0 ; } if ( words1 . isEmpty ( ) && words2 . isEmpty ( ) ) { // 如果两个文本都为空 , 规定相似度分值为1 , 表示完全相等
return 1.0 ; } if ( words1 . isEmpty ( ) || words2 . isEmpty ( ) ) { // 如果一个文本为空 , 另一个不为空 , 规定相似度分值为0 , 表示完全不相等
return 0.0 ; } // 输出词列表信息... |
public class SimpleBase { /** * Creates a new iterator for traversing through a submatrix inside this matrix . It can be traversed
* by row or by column . Range of elements is inclusive , e . g . minRow = 0 and maxRow = 1 will include rows
* 0 and 1 . The iteration starts at ( minRow , minCol ) and ends at ( maxRow... | return new DMatrixIterator ( ( DMatrixRMaj ) mat , rowMajor , minRow , minCol , maxRow , maxCol ) ; |
public class NetworkConfig { /** * Creates a new NetworkConfig instance configured with details supplied in YAML format
* @ param configStream A stream opened on a YAML document containing network configuration details
* @ return A new NetworkConfig instance
* @ throws InvalidArgumentException */
public static Ne... | logger . trace ( "NetworkConfig.fromYamlStream..." ) ; // Sanity check
if ( configStream == null ) { throw new InvalidArgumentException ( "configStream must be specified" ) ; } Yaml yaml = new Yaml ( ) ; @ SuppressWarnings ( "unchecked" ) Map < String , Object > map = yaml . load ( configStream ) ; JsonObjectBuilder bu... |
public class BasePortletLayoutStatisticsController { /** * Select the first portlet name by default for the form */
protected void selectFormDefaultPortlet ( final F report ) { } } | final Set < AggregatedPortletMapping > portlets = this . getPortlets ( ) ; if ( ! portlets . isEmpty ( ) ) { report . getPortlets ( ) . add ( portlets . iterator ( ) . next ( ) . getFname ( ) ) ; } |
public class ReflectionToStringBuilder { /** * Returns whether or not to append the given < code > Field < / code > .
* < ul >
* < li > Transient fields are appended only if { @ link # isAppendTransients ( ) } returns < code > true < / code > .
* < li > Static fields are appended only if { @ link # isAppendStatic... | if ( field . getName ( ) . indexOf ( ClassUtils . INNER_CLASS_SEPARATOR_CHAR ) != - 1 ) { // Reject field from inner class .
return false ; } if ( Modifier . isTransient ( field . getModifiers ( ) ) && ! this . isAppendTransients ( ) ) { // Reject transient fields .
return false ; } if ( Modifier . isStatic ( field . g... |
public class SegmentsUtil { /** * Find equal segments2 in segments1.
* @ param segments1 segs to find .
* @ param segments2 sub segs .
* @ return Return the found offset , return - 1 if not find . */
public static int find ( MemorySegment [ ] segments1 , int offset1 , int numBytes1 , MemorySegment [ ] segments2 ,... | if ( numBytes2 == 0 ) { // quick way 1.
return offset1 ; } if ( inFirstSegment ( segments1 , offset1 , numBytes1 ) && inFirstSegment ( segments2 , offset2 , numBytes2 ) ) { byte first = segments2 [ 0 ] . get ( offset2 ) ; int end = numBytes1 - numBytes2 + offset1 ; for ( int i = offset1 ; i <= end ; i ++ ) { // quick w... |
public class ReconciliationOrderReport { /** * Sets the proposalGrossBillableRevenueManualAdjustment value for this ReconciliationOrderReport .
* @ param proposalGrossBillableRevenueManualAdjustment * If this reconciliation data is for a { @ link Proposal } , then
* this contains the gross revenue
* manual adjust... | this . proposalGrossBillableRevenueManualAdjustment = proposalGrossBillableRevenueManualAdjustment ; |
public class NumericParameterTypeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setCurrencyUnit ( String newCurrencyUnit ) { } } | String oldCurrencyUnit = currencyUnit ; currencyUnit = newCurrencyUnit ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , BpsimPackage . NUMERIC_PARAMETER_TYPE__CURRENCY_UNIT , oldCurrencyUnit , currencyUnit ) ) ; |
public class MmtfActions { /** * Get a Biojava structure from the mmtf REST service .
* @ param pdbId the PDB code of the required structure
* @ return a Structure object relating to the input byte array
* @ throws IOException */
public static Structure readFromWeb ( String pdbId ) throws IOException { } } | // Get the reader - this is the bit that people need to implement .
MmtfStructureReader mmtfStructureReader = new MmtfStructureReader ( ) ; // Do the inflation
new StructureDataToAdapter ( new GenericDecoder ( ReaderUtils . getDataFromUrl ( pdbId ) ) , mmtfStructureReader ) ; // Get the structue
return mmtfStructureRea... |
public class AbstractSecureSession { /** * The initial handshake is a procedure by which the two peers exchange
* communication parameters until an SecureSession is established . Application
* data can not be sent during this phase .
* @ param receiveBuffer Encrypted message
* @ return True means handshake succ... | if ( ! session . isOpen ( ) ) { close ( ) ; return ( initialHSComplete = false ) ; } if ( initialHSComplete ) { return true ; } switch ( initialHSStatus ) { case NOT_HANDSHAKING : case FINISHED : { handshakeFinish ( ) ; return initialHSComplete ; } case NEED_UNWRAP : doHandshakeReceive ( receiveBuffer ) ; if ( initialH... |
public class CmsDefaultXmlContentHandler { /** * Adds search settings as defined by ' simple ' syntax in fields . < p >
* @ param contentDef the content definition
* @ param name the element name
* @ param value the search setting value
* @ throws CmsXmlException if something goes wrong */
protected void addSim... | if ( "false" . equalsIgnoreCase ( value ) ) { addSearchSetting ( contentDef , name , Boolean . FALSE ) ; } else if ( "true" . equalsIgnoreCase ( value ) ) { addSearchSetting ( contentDef , name , Boolean . TRUE ) ; } else { StringTemplate template = m_searchTemplateGroup . getInstanceOf ( value ) ; if ( ( template != n... |
public class sdcard { /** * Counts the size of a directory recursively ( sum of the length of all files ) .
* @ param directory directory to inspect , must not be null
* @ return size of directory in bytes , 0 if directory is security restricted */
public static long getDirectorySize ( File directory ) { } } | if ( ! directory . exists ( ) ) { throw new IllegalArgumentException ( directory + " does not exist" ) ; } if ( ! directory . isDirectory ( ) ) { throw new IllegalArgumentException ( directory + " is not a directory" ) ; } long size = 0 ; File [ ] files = directory . listFiles ( ) ; if ( files == null ) { // null if se... |
public class PagesIndexOrdering { /** * note this code was forked from Fastutils */
@ SuppressWarnings ( "InnerAssignment" ) private void quickSort ( PagesIndex pagesIndex , int from , int to ) { } } | int len = to - from ; // Insertion sort on smallest arrays
if ( len < SMALL ) { for ( int i = from ; i < to ; i ++ ) { for ( int j = i ; j > from && ( comparator . compareTo ( pagesIndex , j - 1 , j ) > 0 ) ; j -- ) { pagesIndex . swap ( j , j - 1 ) ; } } return ; } // Choose a partition element , v
int m = from + len ... |
public class ESFilterBuilder { /** * Gets the between boundary values .
* @ param boundExpression
* the bound expression
* @ return the between boundry values */
private String getBetweenBoundaryValues ( Expression boundExpression ) { } } | if ( boundExpression instanceof IdentificationVariable || boundExpression instanceof NumericLiteral || boundExpression instanceof InputParameter ) { Object value = ( boundExpression instanceof InputParameter ) ? kunderaQuery . getParametersMap ( ) . get ( ( boundExpression ) . toParsedText ( ) ) : boundExpression . toP... |
public class ServletBeanContext { /** * Pushes the current request context onto the stack */
private synchronized void pushRequestContext ( ServletContext context , ServletRequest req , ServletResponse resp ) { } } | getRequestStack ( ) . push ( new RequestContext ( context , req , resp ) ) ; |
public class QueryExecutorImpl { /** * Wait until our lock is released . Execution of a single synchronized method can then continue
* without further ado . Must be called at beginning of each synchronized public method . */
private void waitOnLock ( ) throws PSQLException { } } | while ( lockedFor != null ) { try { this . wait ( ) ; } catch ( InterruptedException ie ) { Thread . currentThread ( ) . interrupt ( ) ; throw new PSQLException ( GT . tr ( "Interrupted while waiting to obtain lock on database connection" ) , PSQLState . OBJECT_NOT_IN_STATE , ie ) ; } } |
public class DateUtils { /** * Warning : relies on default timezone !
* @ since 7.6 */
public static String formatDate ( Instant d ) { } } | return d . atZone ( ZoneId . systemDefault ( ) ) . toLocalDate ( ) . toString ( ) ; |
public class SplitOperation { /** * Performs the actual splitting operation . Throws a TransformationOperationException if the index string is not a
* number or causes an IndexOutOfBoundsException . */
private String performSplitting ( String source , String splitString , String indexString ) throws TransformationOpe... | try { Integer index = Integer . parseInt ( indexString ) ; return source . split ( splitString ) [ index ] ; } catch ( NumberFormatException e ) { throw new TransformationOperationException ( "The given result index parameter is not a number" ) ; } catch ( IndexOutOfBoundsException e ) { throw new TransformationOperati... |
public class ReverseDbTreeNode { /** * Loads the children of this TreeNode . If another Thread is already active on this node the method returns
* without doing anything ( if a separate Thread is started the method returns anyway , but the Thread might
* do nothing ) .
* @ param recursive If true , all children d... | if ( inNewThread ) { new Thread ( ) { public void run ( ) { load ( recursive , replace , false ) ; } } . start ( ) ; return ; } if ( ! populationInProgress ) { synchronized ( this . populationLock ) { this . populationInProgress = true ; if ( replace || ! this . isFilled ) { this . isFilled = _load ( ) ; } this . popul... |
public class RabbitmqClusterContext { /** * 呼出元別 、 接続先RabbitMQプロセスの定義マップを検証して設定する 。
* @ param connectionProcessMap the connectionProcessMap to set
* @ throws RabbitmqCommunicateException 接続先RabbitMQプロセスがRabbitMQプロセス一覧に定義されていない場合 */
public void setConnectionProcessMap ( Map < String , String > connectionProcess... | Map < String , String > tempConnectionProcessMap = connectionProcessMap ; if ( connectionProcessMap == null ) { tempConnectionProcessMap = new HashMap < String , String > ( ) ; } validateProcessReference ( this . mqProcessList , tempConnectionProcessMap ) ; this . connectionProcessMap = tempConnectionProcessMap ; |
public class CopiedOverriddenMethod { /** * compares two code blocks to see if they are equal with regard to instructions and field accesses
* @ param child
* the first code block
* @ param parent
* the second code block
* @ return whether the code blocks are the same */
private boolean codeEquals ( Code chil... | if ( parent == null ) { return false ; } byte [ ] childBytes = child . getCode ( ) ; byte [ ] parentBytes = parent . getCode ( ) ; if ( ( childBytes == null ) || ( parentBytes == null ) ) { return false ; } if ( childBytes . length != parentBytes . length ) { return false ; } InstructionHandle [ ] childihs = new Instru... |
public class Surface { /** * Starts a series of drawing commands that are clipped to the specified rectangle ( in view
* coordinates , not OpenGL coordinates ) . Thus must be followed by a call to { @ link # endClipped }
* when the clipped drawing commands are done .
* @ return whether the resulting clip rectangl... | batch . flush ( ) ; // flush any pending unclipped calls
Rectangle r = pushScissorState ( x , target . flip ( ) ? target . height ( ) - y - height : y , width , height ) ; batch . gl . glScissor ( r . x , r . y , r . width , r . height ) ; if ( scissorDepth == 1 ) batch . gl . glEnable ( GL20 . GL_SCISSOR_TEST ) ; batc... |
public class LinearClassifier { /** * Returns indices of labels
* @ param labels - Set of labels to get indicies
* @ return Set of indicies */
protected Set < Integer > getLabelIndices ( Set < L > labels ) { } } | Set < Integer > iLabels = new HashSet < Integer > ( ) ; for ( L label : labels ) { int iLabel = labelIndex . indexOf ( label ) ; iLabels . add ( iLabel ) ; if ( iLabel < 0 ) throw new IllegalArgumentException ( "Unknown label " + label ) ; } return iLabels ; |
public class OAuthApi { /** * Exchange an auth token from the old Authentication API , to an OAuth access token .
* Calling this method will delete the auth token used to make the request .
* < br >
* This method should be called when upgrading your app to use OAuth . Call this method prior to initializing
* Ji... | JinxUtils . validateParams ( inputStream ) ; Properties legacyTokenProperties = loadLegacyTokenProperties ( inputStream ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.auth.oauth.getAccessToken" ) ; params . put ( "api_key" , jinx . getApiKey ( ) ) ; params . put ( "auth_tok... |
public class SingularityMesosSchedulerClient { /** * Sent by the scheduler to query the status of non - terminal tasks . This causes the master to send back UPDATE
* events for each task in the list . Tasks that are no longer known to Mesos will result in TASK _ LOST updates .
* If the list of tasks is empty , mast... | Builder reconsile = build ( ) . setReconcile ( Reconcile . newBuilder ( ) . addAllTasks ( tasks ) ) ; sendCall ( reconsile , Type . RECONCILE ) ; |
public class Packer { /** * Add anchor = WEST to the constraints for the current component if how = =
* true remove it if false . */
public Packer setAnchorWest ( final boolean how ) { } } | if ( how == true ) { gc . anchor = GridBagConstraints . WEST ; } else { gc . anchor &= ~ GridBagConstraints . WEST ; } setConstraints ( comp , gc ) ; return this ; |
public class SwingGroovyMethods { /** * Overloads the left shift operator to provide an easy way to add
* nodes to a MutableTreeNode . < p >
* @ param self a MutableTreeNode
* @ param node a node to be added to the treeNode .
* @ return same treeNode , after the value was added to it .
* @ since 1.6.4 */
publ... | self . insert ( node , self . getChildCount ( ) ) ; return self ; |
public class IQ2DatalogTranslatorImpl { /** * Move ORDER BY above the highest construction node ( required by Datalog ) */
private IQ liftOrderBy ( IQ iq ) { } } | IQTree topNonQueryModifierTree = getFirstNonQueryModifierTree ( iq ) ; if ( ( topNonQueryModifierTree instanceof UnaryIQTree ) && ( ( ( UnaryIQTree ) topNonQueryModifierTree ) . getChild ( ) . getRootNode ( ) instanceof OrderByNode ) ) { return orderByLifter . liftOrderBy ( iq ) ; } return iq ; |
public class ListOperation { /** * List action must not try to configure selected item . Instead if list
* detect that the selected item is new ( thay may happen when user start new
* operation but desist ) , selected item must be se to null .
* @ param ctx PM Context */
@ Override public void configureSelected (... | if ( ctx . getEntityContainer ( ) . isSelectedNew ( ) ) { ctx . getEntityContainer ( ) . setSelected ( null ) ; } else { super . configureSelected ( ctx ) ; } |
public class Preconditions { /** * Tests if the newBackupCount count is valid .
* @ param newBackupCount the number of sync backups
* @ param currentAsyncBackupCount the current number of async backups
* @ return the newBackupCount
* @ throws java . lang . IllegalArgumentException if newBackupCount is smaller t... | if ( newBackupCount < 0 ) { throw new IllegalArgumentException ( "backup-count can't be smaller than 0" ) ; } if ( currentAsyncBackupCount < 0 ) { throw new IllegalArgumentException ( "async-backup-count can't be smaller than 0" ) ; } if ( newBackupCount > MAX_BACKUP_COUNT ) { throw new IllegalArgumentException ( "back... |
public class LookupReferencesManager { /** * Returns a list of lookups from the snapshot if the lookupsnapshottaker is configured . If it ' s not available ,
* returns null .
* @ return list of LookupBean objects , or null */
@ Nullable private List < LookupBean > getLookupListFromSnapshot ( ) { } } | if ( lookupSnapshotTaker != null ) { return lookupSnapshotTaker . pullExistingSnapshot ( lookupListeningAnnouncerConfig . getLookupTier ( ) ) ; } return null ; |
public class FileListCacheValue { /** * Adds the filename from the set if it exists
* @ param fileName
* @ return true if the set was mutated */
public boolean add ( String fileName ) { } } | writeLock . lock ( ) ; try { return filenames . add ( fileName ) ; } finally { writeLock . unlock ( ) ; } |
public class Timestamp { /** * Creates a Timestamp instance from the given string . String is in the RFC 3339 format without
* the timezone offset ( always ends in " Z " ) . */
public static Timestamp parseTimestamp ( String timestamp ) { } } | TemporalAccessor temporalAccessor = timestampParser . parse ( timestamp ) ; Instant instant = Instant . from ( temporalAccessor ) ; return ofTimeSecondsAndNanos ( instant . getEpochSecond ( ) , instant . getNano ( ) ) ; |
public class EnumTypeConverter { /** * Enforces that obj is a String contained in the Enum ' s values list */
@ SuppressWarnings ( "unchecked" ) public Object unmarshal ( Object obj ) throws RpcException { } } | if ( obj == null ) { return returnNullIfOptional ( ) ; } else if ( obj . getClass ( ) != String . class ) { String msg = "'" + obj + "' enum must be String, got: " + obj . getClass ( ) . getSimpleName ( ) ; throw RpcException . Error . INVALID_PARAMS . exc ( msg ) ; } else if ( e . getValues ( ) . contains ( ( String )... |
public class CmsDriverManager { /** * Reads the aliases which point to a given structure id . < p >
* @ param dbc the current database context
* @ param project the current project
* @ param structureId the structure id for which we want to read the aliases
* @ return the list of aliases pointing to the structu... | return getVfsDriver ( dbc ) . readAliases ( dbc , project , new CmsAliasFilter ( null , null , structureId ) ) ; |
public class AbstractSSTableSimpleWriter { /** * find available generation and pick up filename from that */
protected static String makeFilename ( File directory , final String keyspace , final String columnFamily ) { } } | final Set < Descriptor > existing = new HashSet < Descriptor > ( ) ; directory . list ( new FilenameFilter ( ) { public boolean accept ( File dir , String name ) { Pair < Descriptor , Component > p = SSTable . tryComponentFromFilename ( dir , name ) ; Descriptor desc = p == null ? null : p . left ; if ( desc == null ) ... |
public class WhitesourceService { /** * Gets additional data for given dependencies .
* @ param orgToken Organization token uniquely identifying the account at white source .
* @ param product The product name or token to update .
* @ param productVersion The product version .
* @ param projectInfos OSS usage i... | return client . getDependencyData ( requestFactory . newDependencyDataRequest ( orgToken , product , productVersion , projectInfos , userKey , requesterEmail , productToken ) ) ; |
public class HashedTextDataLoader { /** * To be called by the { @ link # initialLoad ( ) } method .
* It will take in the text and add a new document
* vector to the data set . Once all text documents
* have been loaded , this method should never be
* called again . < br >
* This method is thread safe .
* @... | if ( noMoreAdding ) throw new RuntimeException ( "Initial data set has been finalized" ) ; StringBuilder localWorkSpace = workSpace . get ( ) ; List < String > localStorageSpace = storageSpace . get ( ) ; Map < String , Integer > localWordCounts = wordCounts . get ( ) ; if ( localWorkSpace == null ) { localWorkSpace = ... |
public class LineItemActivityAssociation { /** * Gets the clickThroughConversionCost value for this LineItemActivityAssociation .
* @ return clickThroughConversionCost * The amount of money to attribute per click through conversion .
* This attribute is
* required for creating a { @ code LineItemActivityAssociati... | return clickThroughConversionCost ; |
public class Decoration { /** * Converts the specified string to a Decoration type .
* @ param str
* The string to be converted as a decoration . Possible values
* are :
* < pre >
* . staccato
* ~ general gracing ( abc v1.6 and older )
* ~ irish roll ( abc v2.0)
* uupbow
* vdownbow
* T trill
* H f... | byte type = UNKNOWN ; if ( str . length ( ) > 2 ) { char s = str . charAt ( 0 ) ; char e = str . charAt ( str . length ( ) - 1 ) ; if ( ( ( s == '!' ) && ( e == '!' ) ) || ( ( s == '+' ) && ( e == '+' ) ) ) { str = str . substring ( 1 , str . length ( ) - 1 ) ; } } if ( str . equals ( "." ) ) type = STACCATO ; else if ... |
public class KeyFactory { /** * Generates a public key object from the provided key specification
* ( key material ) .
* @ param keySpec the specification ( key material ) of the public key .
* @ return the public key .
* @ exception InvalidKeySpecException if the given key specification
* is inappropriate fo... | if ( serviceIterator == null ) { return spi . engineGeneratePublic ( keySpec ) ; } Exception failure = null ; KeyFactorySpi mySpi = spi ; do { try { return mySpi . engineGeneratePublic ( keySpec ) ; } catch ( Exception e ) { if ( failure == null ) { failure = e ; } mySpi = nextSpi ( mySpi ) ; } } while ( mySpi != null ... |
public class SubscriberState { /** * Read the subscriber state to the given { @ link DataInput }
* in the order of :
* isMaster
* serverState
* totalUpdates
* streamId
* @ param dataInput the data output to write to
* @ throws IOException */
public static SubscriberState read ( DataInput dataInput ) throw... | return SubscriberState . builder ( ) . isMaster ( dataInput . readBoolean ( ) ) . serverState ( dataInput . readUTF ( ) ) . totalUpdates ( dataInput . readInt ( ) ) . streamId ( dataInput . readInt ( ) ) . build ( ) ; |
public class AutoMlClient { /** * Deletes a model . Returns ` google . protobuf . Empty ` in the
* [ response ] [ google . longrunning . Operation . response ] field when it completes , and ` delete _ details `
* in the [ metadata ] [ google . longrunning . Operation . metadata ] field .
* < p > Sample code :
*... | DeleteModelRequest request = DeleteModelRequest . newBuilder ( ) . setName ( name ) . build ( ) ; return deleteModelAsync ( request ) ; |
public class Mutations { /** * No need to occupy externalizer ids when we have a limited set of options */
static < K , V , T , R > void writeTo ( ObjectOutput output , Mutation < K , V , R > mutation ) throws IOException { } } | BaseMutation bm = ( BaseMutation ) mutation ; DataConversion . writeTo ( output , bm . keyDataConversion ) ; DataConversion . writeTo ( output , bm . valueDataConversion ) ; byte type = mutation . type ( ) ; output . writeByte ( type ) ; switch ( type ) { case ReadWrite . TYPE : output . writeObject ( ( ( ReadWrite < K... |
public class JSONAssert { /** * Asserts that the JSONObject provided matches the expected JSONObject . If it isn ' t it throws an
* { @ link AssertionError } .
* @ param expected Expected JSONObject
* @ param actual JSONObject to compare
* @ param strict Enables strict checking
* @ throws JSONException JSON p... | assertEquals ( expected , actual , strict ? JSONCompareMode . STRICT : JSONCompareMode . LENIENT ) ; |
public class CmsImportExportManager { /** * Adds a import version class name to the configuration . < p >
* @ param importVersionClass the import version class name to add */
public void addImportVersionClass ( I_CmsImport importVersionClass ) { } } | if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_IMPORTEXPORT_ADDED_IMPORT_VERSION_1 , importVersionClass ) ) ; } m_importVersionClasses . add ( importVersionClass ) ; |
public class Model { /** * Analyzes the entire json object and creates a brand - new . . .
* instance from its representation .
* TODO : Figure out how to make this accesible without . . .
* creating a dummy instance .
* @ param json The JSONObject representation of the object .
* @ return The object T if abl... | T object = null ; try { object = clazz . newInstance ( ) ; ( ( Model ) object ) . setContext ( context ) ; Field [ ] fields = clazz . getDeclaredFields ( ) ; try { for ( Field field : fields ) { if ( ! field . isAnnotationPresent ( ModelField . class ) ) { continue ; } String name = field . getName ( ) ; boolean was = ... |
public class ExistingChannelModelControllerClient { /** * Create and add model controller handler to an existing management channel handler .
* @ param handler the channel handler
* @ return the created client */
public static ModelControllerClient createAndAdd ( final ManagementChannelHandler handler ) { } } | final ExistingChannelModelControllerClient client = new ExistingChannelModelControllerClient ( handler ) ; handler . addHandlerFactory ( client ) ; return client ; |
public class DescribeLoadBalancersRequest { /** * The Amazon Resource Names ( ARN ) of the load balancers . You can specify up to 20 load balancers in a single call .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setLoadBalancerArns ( java . util . Collecti... | if ( this . loadBalancerArns == null ) { setLoadBalancerArns ( new java . util . ArrayList < String > ( loadBalancerArns . length ) ) ; } for ( String ele : loadBalancerArns ) { this . loadBalancerArns . add ( ele ) ; } return this ; |
public class ServerJFapCommunicator { /** * Calls through to the JFAPCommunicator class to do the real handshaking .
* @ see com . ibm . ws . sib . comms . common . JFAPCommunicator # initiateCommsHandshaking ( ) */
@ Override protected void initiateCommsHandshaking ( ) throws SIConnectionLostException , SIConnection... | if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "initiateCommsHandshaking" ) ; initiateCommsHandshakingImpl ( true ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "initiateCommsHandshaking" ) ; |
public class ResUtils { /** * Converts any path into something that can be placed in an Android directory .
* Traverses any subdirectories and flattens it all into a single filename . Also
* gets rid of commonly seen illegal characters in tz identifiers , and lower cases
* the entire thing .
* @ param path the ... | File file = new File ( path ) ; List < String > parts = new ArrayList < String > ( ) ; do { parts . add ( file . getName ( ) ) ; file = file . getParentFile ( ) ; } while ( file != null ) ; StringBuffer sb = new StringBuffer ( ) ; int size = parts . size ( ) ; for ( int a = size - 1 ; a >= 0 ; a -- ) { if ( sb . length... |
public class ServiceContextFactory { /** * Convenience method , it requires that the request is a HttpServletRequest .
* @ see # createServiceContext ( HttpServletRequest ) */
public static ServiceContext createServiceContext ( ServletRequest request ) { } } | if ( ! ( request instanceof HttpServletRequest ) ) { throw new IllegalArgumentException ( "Expected HttpServletRequest" ) ; } return createServiceContext ( ( HttpServletRequest ) request ) ; |
public class QueryToolChest { /** * Returns a CacheStrategy to be used to load data into the cache and remove it from the cache .
* This is optional . If it returns null , caching is effectively disabled for the query .
* @ param query The query whose results might be cached
* @ param < T > The type of object tha... | return null ; |
public class RedshiftMetadataMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RedshiftMetadata redshiftMetadata , ProtocolMarshaller protocolMarshaller ) { } } | if ( redshiftMetadata == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( redshiftMetadata . getRedshiftDatabase ( ) , REDSHIFTDATABASE_BINDING ) ; protocolMarshaller . marshall ( redshiftMetadata . getDatabaseUserName ( ) , DATABASEUSERNAME_... |
public class rnatip_stats { /** * Use this API to fetch statistics of rnatip _ stats resource of given name . */
public static rnatip_stats get ( nitro_service service , String Rnatip ) throws Exception { } } | rnatip_stats obj = new rnatip_stats ( ) ; obj . set_Rnatip ( Rnatip ) ; rnatip_stats response = ( rnatip_stats ) obj . stat_resource ( service ) ; return response ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EEnum getIfcSIUnitName ( ) { } } | if ( ifcSIUnitNameEEnum == null ) { ifcSIUnitNameEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1057 ) ; } return ifcSIUnitNameEEnum ; |
public class SecurityContextProviderImpl { /** * { @ inheritDoc } */
@ Override public ThreadContext captureThreadContext ( Map < String , String > execProps , Map < String , ? > threadContextConfig ) { } } | String jaasLoginContextEntry = getConfigNameForRef ( ( String ) threadContextConfig . get ( JAAS_LOGINCONTEXTENTRY_REF ) ) ; return new SecurityContextImpl ( true , jaasLoginContextEntry ) ; |
public class ClassNode { /** * Accept a visitor that visit all public and non - abstract class node
* that has been annotated by the class represented by this ` ClassNode `
* @ param visitor the function that take ` ClassNode ` as argument
* @ return this ` ClassNode ` instance */
public ClassNode visitPublicNotA... | return visitAnnotatedClasses ( $ . guardedVisitor ( new $ . Predicate < ClassNode > ( ) { @ Override public boolean test ( ClassNode classNode ) { return classNode . publicNotAbstract ( ) ; } } , visitor ) ) ; |
public class Solo { /** * Clicks a MenuItem displaying the specified text .
* @ param text the text displayed by the MenuItem . The parameter will be interpreted as a regular expression
* @ param subMenu { @ code true } if the menu item could be located in a sub menu */
public void clickOnMenuItem ( String text , b... | if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnMenuItem(\"" + text + "\", " + subMenu + ")" ) ; } clicker . clickOnMenuItem ( text , subMenu ) ; |
public class SpatialSupport { /** * Register spatial types to the given codegen module
* @ param module module to be customized for spatial support */
public static void addSupport ( AbstractModule module ) { } } | module . bindInstance ( SQLCodegenModule . ENTITYPATH_TYPE , RelationalPathSpatial . class ) ; registerTypes ( module . get ( Configuration . class ) ) ; registerTypes ( module . get ( TypeMappings . class ) ) ; addImports ( module ) ; |
public class JSTypeRegistry { /** * Creates an enum type .
* @ param name The human - readable name associated with the enum , or null if unknown . */
public EnumType createEnumType ( String name , Node source , JSType elementsType ) { } } | return new EnumType ( this , name , source , elementsType ) ; |
public class RecyclerViewPager { /** * 当滑动状态改变时所做的各种处理 。 */
@ Override public void onScrollStateChanged ( int state ) { } } | if ( DEBUG ) Log . d ( "RecyclerViewPager" , "onScrollStateChanged:" + state ) ; super . onScrollStateChanged ( state ) ; // 当处于滑动状态时
if ( state == SCROLL_STATE_DRAGGING ) { mNeedAdjust = true ; mCurView = getLayoutManager ( ) . canScrollHorizontally ( ) ? ViewUtils . getCenterXChild ( this ) : ViewUtils . getCenterYCh... |
public class FileUtils { /** * Calculates the SHA - 1 hash for an { @ link InputStream }
* @ param in the { @ link InputStream } to calculate the hash for
* @ return { @ link String } representation of the hash */
public static String hash ( InputStream in ) { } } | try { MessageDigest digest = MessageDigest . getInstance ( "sha1" ) ; ByteArrayPool . withByteArray ( buffer -> { try { int length ; while ( ( length = in . read ( buffer ) ) != - 1 ) { digest . update ( buffer , 0 , length ) ; } } catch ( IOException e ) { throw Exceptions . propagate ( e ) ; } } ) ; return String . f... |
public class Value { /** * Returns an { @ code ARRAY < INT64 > } value .
* @ param v the source of element values , which may be null to produce a value for which { @ code
* isNull ( ) } is { @ code true } */
public static Value int64Array ( @ Nullable long [ ] v ) { } } | return int64Array ( v , 0 , v == null ? 0 : v . length ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.