signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class DateParser { /** * Converts a relative 2 - digit year to an absolute 4 - digit year
* @ param shortYear the relative year
* @ return the absolute year */
protected static int yearFrom2Digits ( int shortYear , int currentYear ) { } }
|
if ( shortYear < 100 ) { shortYear += currentYear - ( currentYear % 100 ) ; if ( Math . abs ( shortYear - currentYear ) >= 50 ) { if ( shortYear < currentYear ) { return shortYear + 100 ; } else { return shortYear - 100 ; } } } return shortYear ;
|
public class MarkdownMojo { /** * An accepted file was deleted - deletes the output file .
* @ param file the file
* @ return { @ code true } */
@ Override public boolean fileDeleted ( File file ) { } }
|
File output = getOutputFile ( file , OUTPUT_EXTENSION ) ; FileUtils . deleteQuietly ( output ) ; return true ;
|
public class Formatter { /** * Closes this formatter . If the destination implements the { @ link
* java . io . Closeable } interface , its { @ code close } method will be invoked .
* < p > Closing a formatter allows it to release resources it may be holding
* ( such as open files ) . If the formatter is already closed , then invoking
* this method has no effect .
* < p > Attempting to invoke any methods except { @ link # ioException ( ) } in
* this formatter after it has been closed will result in a { @ link
* FormatterClosedException } . */
@ Override public void close ( ) throws IOException { } }
|
if ( out instanceof Closeable ) { closed = true ; ( ( Closeable ) out ) . close ( ) ; }
|
public class AstUtil { /** * Returns true if the expression is a binary expression with the specified token .
* @ param expression
* expression
* @ param token
* token
* @ return
* as described */
public static boolean isBinaryExpressionType ( Expression expression , String token ) { } }
|
if ( expression instanceof BinaryExpression ) { if ( token . equals ( ( ( BinaryExpression ) expression ) . getOperation ( ) . getText ( ) ) ) { return true ; } } return false ;
|
public class UnicodeSet { /** * Append the < code > toPattern ( ) < / code > representation of a
* string to the given < code > Appendable < / code > . */
private static < T extends Appendable > T _appendToPat ( T buf , String s , boolean escapeUnprintable ) { } }
|
int cp ; for ( int i = 0 ; i < s . length ( ) ; i += Character . charCount ( cp ) ) { cp = s . codePointAt ( i ) ; _appendToPat ( buf , cp , escapeUnprintable ) ; } return buf ;
|
public class JsonInput { /** * opening quite already consumed */
String parseString ( ) throws IOException { } }
|
buf . setLength ( 0 ) ; char next = readNext ( ) ; while ( next != '"' ) { if ( next == '\\' ) { parseEscape ( ) ; } else { buf . append ( next ) ; } next = readNext ( ) ; } return buf . toString ( ) ;
|
public class RestBuilder { /** * Creates a provider that delivers type when needed
* @ param provider to be executed when needed
* @ param < T > provided object as argument
* @ return builder */
@ SuppressWarnings ( "unchecked" ) public < T > RestBuilder addProvider ( Class < ? extends ContextProvider < T > > provider ) { } }
|
Assert . notNull ( provider , "Missing context provider!" ) ; registeredProviders . put ( null , provider ) ; return this ;
|
public class BuffReaderParseFactory { /** * Not supported at this time . */
@ Override public Parser newFixedLengthParser ( final Connection con , final File dataSource , final String dataDefinition ) { } }
|
throw new UnsupportedOperationException ( "Not supported..." ) ;
|
public class VpTree { /** * Recursively search for the k nearest neighbors to target .
* @ param target target point
* @ param maxDistance maximum distance
* @ param k number of neighbors to find */
private PriorityQueue < HeapItem > search ( final double [ ] target , double maxDistance , final int k ) { } }
|
PriorityQueue < HeapItem > heap = new PriorityQueue < HeapItem > ( ) ; if ( root == null ) { return heap ; } double tau = maxDistance ; final FastQueue < Node > nodes = new FastQueue < Node > ( 20 , Node . class , false ) ; nodes . add ( root ) ; while ( nodes . size ( ) > 0 ) { final Node node = nodes . removeTail ( ) ; final double dist = distance ( items [ node . index ] , target ) ; if ( dist <= tau ) { if ( heap . size ( ) == k ) { heap . poll ( ) ; } heap . add ( new HeapItem ( node . index , dist ) ) ; if ( heap . size ( ) == k ) { tau = heap . element ( ) . dist ; } } if ( node . left != null && dist - tau <= node . threshold ) { nodes . add ( node . left ) ; } if ( node . right != null && dist + tau >= node . threshold ) { nodes . add ( node . right ) ; } } return heap ;
|
public class PartitioningNearestNeighborFinder { /** * Computes the principle vectors , which represent a set of prototypical
* terms that span the semantic space
* @ param numPrincipleVectors */
private void computePrincipleVectors ( int numPrincipleVectors ) { } }
|
// Group all of the sspace ' s vectors into a Matrix so that we can
// cluster them
final int numTerms = sspace . getWords ( ) . size ( ) ; final List < DoubleVector > termVectors = new ArrayList < DoubleVector > ( numTerms ) ; String [ ] termAssignments = new String [ numTerms ] ; int k = 0 ; for ( String term : sspace . getWords ( ) ) { termVectors . add ( Vectors . asDouble ( sspace . getVector ( term ) ) ) ; termAssignments [ k ++ ] = term ; } Random random = new Random ( ) ; final DoubleVector [ ] principles = new DoubleVector [ numPrincipleVectors ] ; for ( int i = 0 ; i < principles . length ; ++ i ) principles [ i ] = new DenseVector ( sspace . getVectorLength ( ) ) ; // Randomly assign the data set to different intitial clusters
final MultiMap < Integer , Integer > clusterAssignment = new HashMultiMap < Integer , Integer > ( ) ; for ( int i = 0 ; i < numTerms ; ++ i ) clusterAssignment . put ( random . nextInt ( numPrincipleVectors ) , i ) ; int numIters = 1 ; for ( int iter = 0 ; iter < numIters ; ++ iter ) { verbose ( LOGGER , "Computing principle vectors (round %d/%d)" , iter + 1 , numIters ) ; // Compute the centroids
for ( Map . Entry < Integer , Set < Integer > > e : clusterAssignment . asMap ( ) . entrySet ( ) ) { int cluster = e . getKey ( ) ; DoubleVector principle = new DenseVector ( sspace . getVectorLength ( ) ) ; principles [ cluster ] = principle ; for ( Integer row : e . getValue ( ) ) VectorMath . add ( principle , termVectors . get ( row ) ) ; } // Reassign each element to the centroid to which it is closest
clusterAssignment . clear ( ) ; final int numThreads = workQueue . availableThreads ( ) ; Object key = workQueue . registerTaskGroup ( numThreads ) ; for ( int threadId_ = 0 ; threadId_ < numThreads ; ++ threadId_ ) { final int threadId = threadId_ ; workQueue . add ( key , new Runnable ( ) { public void run ( ) { // Thread local cache of all the cluster assignments
MultiMap < Integer , Integer > clusterAssignment_ = new HashMultiMap < Integer , Integer > ( ) ; // For each of the vectors that this thread is
// responsible for , find the principle vector to
// which it is closest
for ( int i = threadId ; i < numTerms ; i += numThreads ) { DoubleVector v = termVectors . get ( i ) ; double highestSim = - Double . MAX_VALUE ; int pVec = - 1 ; for ( int j = 0 ; j < principles . length ; ++ j ) { DoubleVector principle = principles [ j ] ; double sim = Similarity . cosineSimilarity ( v , principle ) ; assert sim >= - 1 && sim <= 1 : "similarity " + " to principle vector " + j + " is " + "outside the expected range: " + sim ; if ( sim > highestSim ) { highestSim = sim ; pVec = j ; } } assert pVec != - 1 : "Could not find match to " + "any of the " + principles . length + " principle vectors" ; clusterAssignment_ . put ( pVec , i ) ; } // Once all the vectors for this thread have been
// mapped , update the thread - shared mapping . Do
// this here , rather than for each comparison to
// minimize the locking
synchronized ( clusterAssignment ) { clusterAssignment . putAll ( clusterAssignment_ ) ; } } } ) ; } workQueue . await ( key ) ; } double mean = numTerms / ( double ) numPrincipleVectors ; double variance = 0d ; for ( Map . Entry < Integer , Set < Integer > > e : clusterAssignment . asMap ( ) . entrySet ( ) ) { Set < Integer > rows = e . getValue ( ) ; Set < String > terms = new HashSet < String > ( ) ; for ( Integer i : rows ) terms . add ( termAssignments [ i ] ) ; verbose ( LOGGER , "Principle vectod %d is closest to %d terms" , e . getKey ( ) , terms . size ( ) ) ; double diff = mean - terms . size ( ) ; variance += diff * diff ; principleVectorToNearestTerms . putMany ( principles [ e . getKey ( ) ] , terms ) ; } verbose ( LOGGER , "Average number terms per principle vector: %f, " + "(%f stddev)" , mean , Math . sqrt ( variance / numPrincipleVectors ) ) ;
|
public class JacksonObjectProvider { /** * { @ inheritDoc } */
@ Override public FilterProvider transform ( final ObjectGraph graph ) { } }
|
// Root entity .
final FilteringPropertyFilter root = new FilteringPropertyFilter ( graph . getEntityClass ( ) , graph . getFields ( ) , createSubfilters ( graph . getEntityClass ( ) , graph . getSubgraphs ( ) ) ) ; return new FilteringFilterProvider ( root ) ;
|
public class BshClassManager { /** * Indicate that the specified class name has been defined and may be
* loaded normally . */
protected void doneDefiningClass ( String className ) { } }
|
String baseName = Name . suffix ( className , 1 ) ; definingClasses . remove ( className ) ; definingClassesBaseNames . remove ( baseName ) ;
|
public class UserCustomTableReader { /** * { @ inheritDoc } */
@ Override protected UserCustomColumn createColumn ( UserCustomResultSet result , int index , String name , String type , Long max , boolean notNull , int defaultValueIndex , boolean primaryKey ) { } }
|
GeoPackageDataType dataType = getDataType ( type ) ; Object defaultValue = result . getValue ( defaultValueIndex , dataType ) ; UserCustomColumn column = new UserCustomColumn ( index , name , dataType , max , notNull , defaultValue , primaryKey ) ; return column ;
|
public class FutureUtils { /** * This function takes a { @ link CompletableFuture } and a handler function for the result of this future . If the
* input future is already done , this function returns { @ link CompletableFuture # handle ( BiFunction ) } . Otherwise ,
* the return value is { @ link CompletableFuture # handleAsync ( BiFunction , Executor ) } with the given executor .
* @ param completableFuture the completable future for which we want to call # handle .
* @ param executor the executor to run the handle function if the future is not yet done .
* @ param handler the handler function to call when the future is completed .
* @ param < IN > type of the handler input argument .
* @ param < OUT > type of the handler return value .
* @ return the new completion stage . */
public static < IN , OUT > CompletableFuture < OUT > handleAsyncIfNotDone ( CompletableFuture < IN > completableFuture , Executor executor , BiFunction < ? super IN , Throwable , ? extends OUT > handler ) { } }
|
return completableFuture . isDone ( ) ? completableFuture . handle ( handler ) : completableFuture . handleAsync ( handler , executor ) ;
|
public class JsonRpcServerHandler { /** * Determines whether the response to the request should be pretty - printed .
* @ param request the HTTP request .
* @ return { @ code true } if the response should be pretty - printed . */
private boolean shouldPrettyPrint ( HttpRequest request ) { } }
|
QueryStringDecoder decoder = new QueryStringDecoder ( request . getUri ( ) , Charsets . UTF_8 , true , 2 ) ; Map < String , List < String > > parameters = decoder . parameters ( ) ; if ( parameters . containsKey ( PP_PARAMETER ) ) { return parseBoolean ( parameters . get ( PP_PARAMETER ) . get ( 0 ) ) ; } else if ( parameters . containsKey ( PRETTY_PRINT_PARAMETER ) ) { return parseBoolean ( parameters . get ( PRETTY_PRINT_PARAMETER ) . get ( 0 ) ) ; } return true ;
|
public class ValidatorBuilderDouble { /** * @ see # range ( Range )
* @ param min the minimum allowed value .
* @ param max the maximum allowed value .
* @ return this build instance for fluent API calls . */
public ValidatorBuilderDouble < PARENT > range ( double min , double max ) { } }
|
return range ( new Range < > ( Double . valueOf ( min ) , Double . valueOf ( max ) ) ) ;
|
public class ManifestDocumentBinding { /** * This method binds a ChunksManifest object to the content of the arg xml .
* @ param xml manifest document to be bound to ChunksManifest object
* @ return ChunksManifest object */
public static ChunksManifest createManifestFrom ( InputStream xml ) { } }
|
try { ChunksManifestDocument doc = ChunksManifestDocument . Factory . parse ( xml ) ; return ManifestElementReader . createManifestFrom ( doc ) ; } catch ( XmlException e ) { throw new DuraCloudRuntimeException ( e ) ; } catch ( IOException e ) { throw new DuraCloudRuntimeException ( e ) ; }
|
public class ServiceClientChecks { /** * Processes a token from the required tokens list when the TreeWalker visits it .
* @ param token Node in the AST . */
@ Override public void visitToken ( DetailAST token ) { } }
|
// Failed to load ServiceClient ' s class , don ' t validate anything .
if ( this . serviceClientClass == null ) { return ; } switch ( token . getType ( ) ) { case TokenTypes . PACKAGE_DEF : this . extendsServiceClient = extendsServiceClient ( token ) ; break ; case TokenTypes . CTOR_DEF : if ( this . extendsServiceClient && visibilityIsPublicOrProtected ( token ) ) { log ( token , CONSTRUCTOR_ERROR_MESSAGE ) ; } break ; case TokenTypes . METHOD_DEF : if ( this . extendsServiceClient && ! this . hasStaticBuilder && methodIsStaticBuilder ( token ) ) { this . hasStaticBuilder = true ; } break ; }
|
public class HashPartitioner { /** * Use { @ link Object # hashCode ( ) } to partition . */
public int getPartition ( K key , V value , int numReduceTasks ) { } }
|
return ( key . hashCode ( ) & Integer . MAX_VALUE ) % numReduceTasks ;
|
public class SMailPostalMotorbike { protected String resolveProtocolKey ( String key ) { } }
|
return MotorbikeSecurityType . SSL . equals ( securityType ) ? Srl . replace ( key , ".smtp." , ".smtps." ) : key ;
|
public class WrappingUtils { /** * Applies the given rounding params on the specified rounded drawable . */
static void applyRoundingParams ( Rounded rounded , RoundingParams roundingParams ) { } }
|
rounded . setCircle ( roundingParams . getRoundAsCircle ( ) ) ; rounded . setRadii ( roundingParams . getCornersRadii ( ) ) ; rounded . setBorder ( roundingParams . getBorderColor ( ) , roundingParams . getBorderWidth ( ) ) ; rounded . setPadding ( roundingParams . getPadding ( ) ) ; rounded . setScaleDownInsideBorders ( roundingParams . getScaleDownInsideBorders ( ) ) ; rounded . setPaintFilterBitmap ( roundingParams . getPaintFilterBitmap ( ) ) ;
|
public class LogPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getNewCheckoutAdded ( ) { } }
|
if ( newCheckoutAddedEClass == null ) { newCheckoutAddedEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( LogPackage . eNS_URI ) . getEClassifiers ( ) . get ( 11 ) ; } return newCheckoutAddedEClass ;
|
public class QrCode { /** * Splits data into blocks , adds error correction and then interleaves the blocks and error correction data . */
private static void addEcc ( int [ ] fullstream , int [ ] datastream , int version , int data_cw , int blocks ) { } }
|
int ecc_cw = QR_TOTAL_CODEWORDS [ version - 1 ] - data_cw ; int short_data_block_length = data_cw / blocks ; int qty_long_blocks = data_cw % blocks ; int qty_short_blocks = blocks - qty_long_blocks ; int ecc_block_length = ecc_cw / blocks ; int i , j , length_this_block , posn ; int [ ] data_block = new int [ short_data_block_length + 2 ] ; int [ ] ecc_block = new int [ ecc_block_length + 2 ] ; int [ ] interleaved_data = new int [ data_cw + 2 ] ; int [ ] interleaved_ecc = new int [ ecc_cw + 2 ] ; posn = 0 ; for ( i = 0 ; i < blocks ; i ++ ) { if ( i < qty_short_blocks ) { length_this_block = short_data_block_length ; } else { length_this_block = short_data_block_length + 1 ; } for ( j = 0 ; j < ecc_block_length ; j ++ ) { ecc_block [ j ] = 0 ; } for ( j = 0 ; j < length_this_block ; j ++ ) { data_block [ j ] = datastream [ posn + j ] ; } ReedSolomon rs = new ReedSolomon ( ) ; rs . init_gf ( 0x11d ) ; rs . init_code ( ecc_block_length , 0 ) ; rs . encode ( length_this_block , data_block ) ; for ( j = 0 ; j < ecc_block_length ; j ++ ) { ecc_block [ j ] = rs . getResult ( j ) ; } for ( j = 0 ; j < short_data_block_length ; j ++ ) { interleaved_data [ ( j * blocks ) + i ] = data_block [ j ] ; } if ( i >= qty_short_blocks ) { interleaved_data [ ( short_data_block_length * blocks ) + ( i - qty_short_blocks ) ] = data_block [ short_data_block_length ] ; } for ( j = 0 ; j < ecc_block_length ; j ++ ) { interleaved_ecc [ ( j * blocks ) + i ] = ecc_block [ ecc_block_length - j - 1 ] ; } posn += length_this_block ; } for ( j = 0 ; j < data_cw ; j ++ ) { fullstream [ j ] = interleaved_data [ j ] ; } for ( j = 0 ; j < ecc_cw ; j ++ ) { fullstream [ j + data_cw ] = interleaved_ecc [ j ] ; }
|
public class Convert { /** * Escape all unicode characters in string . */
public static String escapeUnicode ( String s ) { } }
|
int len = s . length ( ) ; int i = 0 ; while ( i < len ) { char ch = s . charAt ( i ) ; if ( ch > 255 ) { StringBuilder buf = new StringBuilder ( ) ; buf . append ( s . substring ( 0 , i ) ) ; while ( i < len ) { ch = s . charAt ( i ) ; if ( ch > 255 ) { buf . append ( "\\u" ) ; buf . append ( Character . forDigit ( ( ch >> 12 ) % 16 , 16 ) ) ; buf . append ( Character . forDigit ( ( ch >> 8 ) % 16 , 16 ) ) ; buf . append ( Character . forDigit ( ( ch >> 4 ) % 16 , 16 ) ) ; buf . append ( Character . forDigit ( ( ch ) % 16 , 16 ) ) ; } else { buf . append ( ch ) ; } i ++ ; } s = buf . toString ( ) ; } else { i ++ ; } } return s ;
|
public class AbstractOracleQuery { /** * START WITH specifies the root row ( s ) of the hierarchy .
* @ param cond condition
* @ return the current object */
@ WithBridgeMethods ( value = OracleQuery . class , castRequired = true ) public < A > C startWith ( Predicate cond ) { } }
|
return addFlag ( Position . BEFORE_ORDER , START_WITH , cond ) ;
|
public class MPPUtility { /** * Determine the length of a nul terminated UTF16LE string in bytes .
* @ param data string data
* @ param offset offset into string data
* @ return length in bytes */
private static final int getUnicodeStringLengthInBytes ( byte [ ] data , int offset ) { } }
|
int result ; if ( data == null || offset >= data . length ) { result = 0 ; } else { result = data . length - offset ; for ( int loop = offset ; loop < ( data . length - 1 ) ; loop += 2 ) { if ( data [ loop ] == 0 && data [ loop + 1 ] == 0 ) { result = loop - offset ; break ; } } } return result ;
|
public class ResourceGroupsInner { /** * Checks whether a resource group exists .
* @ param resourceGroupName The name of the resource group to check . The name is case insensitive .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the Boolean object */
public Observable < ServiceResponse < Boolean > > checkExistenceWithServiceResponseAsync ( String resourceGroupName ) { } }
|
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } return service . checkExistence ( resourceGroupName , this . client . subscriptionId ( ) , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < Void > , Observable < ServiceResponse < Boolean > > > ( ) { @ Override public Observable < ServiceResponse < Boolean > > call ( Response < Void > response ) { try { ServiceResponse < Boolean > clientResponse = checkExistenceDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
|
public class BpmnParse { /** * IoMappings / / / / / */
protected void parseActivityInputOutput ( Element activityElement , ActivityImpl activity ) { } }
|
Element extensionElements = activityElement . element ( "extensionElements" ) ; if ( extensionElements != null ) { IoMapping inputOutput = null ; try { inputOutput = parseInputOutput ( extensionElements ) ; } catch ( BpmnParseException e ) { addError ( e ) ; } if ( inputOutput != null ) { if ( checkActivityInputOutputSupported ( activityElement , activity , inputOutput ) ) { activity . setIoMapping ( inputOutput ) ; if ( getMultiInstanceScope ( activity ) == null ) { // turn activity into a scope ( - > local , isolated scope for
// variables ) unless it is a multi instance activity , in that case
// this
// is not necessary because :
// A scope is already created for the multi instance body which
// isolates the local variables from other executions in the same
// scope , and
// * parallel : the individual concurrent executions are isolated
// even if they are not scope themselves
// * sequential : after each iteration local variables are purged
activity . setScope ( true ) ; } } } }
|
public class ConcurrentGroupServerUpdatePolicy { /** * Records the result of updating a server group .
* @ param serverGroup the server group ' s name . Cannot be < code > null < / code >
* @ param failed < code > true < / code > if the server group update failed ;
* < code > false < / code > if it succeeded */
public void recordServerGroupResult ( final String serverGroup , final boolean failed ) { } }
|
synchronized ( this ) { if ( groups . contains ( serverGroup ) ) { responseCount ++ ; if ( failed ) { this . failed = true ; } DomainControllerLogger . HOST_CONTROLLER_LOGGER . tracef ( "Recorded group result for '%s': failed = %s" , serverGroup , failed ) ; notifyAll ( ) ; } else { throw DomainControllerLogger . HOST_CONTROLLER_LOGGER . unknownServerGroup ( serverGroup ) ; } }
|
public class DigitList { /** * Returns true if this DigitList represents Long . MIN _ VALUE ;
* false , otherwise . This is required so that getLong ( ) works . */
private boolean isLongMIN_VALUE ( ) { } }
|
if ( decimalAt != count || count != MAX_LONG_DIGITS ) return false ; for ( int i = 0 ; i < count ; ++ i ) { if ( digits [ i ] != LONG_MIN_REP [ i ] ) return false ; } return true ;
|
public class BeanUtils { /** * 循环向上转型 , 获取对象的DeclaredField . */
private static Field getDeclaredField ( Object object , String fieldName ) throws NoSuchFieldException { } }
|
Assert . notNull ( object ) ; return getDeclaredField ( object . getClass ( ) , fieldName ) ;
|
public class AngularMomentum { /** * Calculates the I - operator */
public Matrix getIminus ( ) { } }
|
Matrix Iminus = new Matrix ( size , size ) ; int i , j ; for ( i = 0 ; i < size ; i ++ ) for ( j = 0 ; j < size ; j ++ ) Iminus . matrix [ i ] [ j ] = 0d ; for ( i = 1 ; i < size ; i ++ ) Iminus . matrix [ i ] [ i - 1 ] = Math . sqrt ( J * J + J - ( J - i ) * ( J - i ) - ( J - i ) ) ; return Iminus ;
|
public class HttpServletResponseImpl { /** * Determine if a URI string has a < code > scheme < / code > component . */
private boolean hasScheme ( String uri ) { } }
|
int len = uri . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = uri . charAt ( i ) ; if ( c == ':' ) { return i > 0 ; } else if ( ! Character . isLetterOrDigit ( c ) && ( c != '+' && c != '-' && c != '.' ) ) { return false ; } } return false ;
|
public class ProvidenceHelper { /** * Get a field value from a message with optional chaining . If the field is
* not set , or any message in the chain leading up to the last message is
* missing , it will return an empty optional . Otherwise the leaf field value .
* Note that this will only check for MESSAGE type if the message is present
* and needs to be looked up in .
* @ param message The message to start looking up field values in .
* @ param fields Fields to look up in the message .
* @ param < T > The expected leaf value type .
* @ return Optional field value . */
@ SuppressWarnings ( "unchecked" ) @ Nonnull public static < T > Optional < T > optionalInMessage ( PMessage message , PField ... fields ) { } }
|
if ( fields == null || fields . length == 0 ) { throw new IllegalArgumentException ( "No fields arguments." ) ; } PField field = fields [ 0 ] ; if ( ! message . has ( field . getId ( ) ) ) { return Optional . empty ( ) ; } if ( fields . length > 1 ) { if ( field . getType ( ) != PType . MESSAGE ) { throw new IllegalArgumentException ( "Field " + field . getName ( ) + " is not a message." ) ; } return optionalInMessage ( ( PMessage ) message . get ( field ) , Arrays . copyOfRange ( fields , 1 , fields . length ) ) ; } else { return Optional . of ( ( T ) message . get ( field . getId ( ) ) ) ; }
|
public class AbstractScriptEngine { /** * Sets the specified value with the specified key in the < code > ENGINE _ SCOPE < / code >
* < code > Bindings < / code > of the protected < code > context < / code > field .
* @ param key The specified key .
* @ param value The specified value .
* @ throws NullPointerException if key is null .
* @ throws IllegalArgumentException if key is empty . */
public void put ( String key , Object value ) { } }
|
Bindings nn = getBindings ( ScriptContext . ENGINE_SCOPE ) ; if ( nn != null ) { nn . put ( key , value ) ; }
|
public class SessionImpl { /** * @ see javax . servlet . http . HttpSession # setAttribute ( java . lang . String , java . lang . Object ) */
@ Override public void setAttribute ( String name , Object value ) { } }
|
final boolean bTrace = TraceComponent . isAnyTracingEnabled ( ) ; if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setAttribute: " + name + "=" + value ) ; } if ( null == value ) { removeAttribute ( name ) ; return ; } if ( isInvalid ( ) ) { throw new IllegalStateException ( "Session is invalid" ) ; } HttpSessionBindingEvent replaceEvent = null ; HttpSessionBindingEvent addEvent = null ; Object current = this . attributes . remove ( name ) ; if ( null != current ) { replaceEvent = new HttpSessionBindingEvent ( this , name , current ) ; if ( current instanceof HttpSessionBindingListener ) { // inform the old value of it ' s removal
if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Notifying old value: " + current ) ; } ( ( HttpSessionBindingListener ) current ) . valueUnbound ( replaceEvent ) ; } } this . attributes . put ( name , value ) ; if ( value instanceof HttpSessionBindingListener ) { // inform the new value of it ' s use
if ( bTrace && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Notifying new value: " + value ) ; } addEvent = new HttpSessionBindingEvent ( this , name , value ) ; ( ( HttpSessionBindingListener ) value ) . valueBound ( addEvent ) ; } // List < HttpSessionAttributeListener > list = this . myConfig . getSessionAttributeListeners ( ) ;
// if ( null ! = list ) {
// / / if we replaced a value , let the listeners now that . Otherwise ,
// / / tell them of the new value being set
// if ( null ! = current ) {
// for ( HttpSessionAttributeListener listener : list ) {
// if ( bTrace & & tc . isDebugEnabled ( ) ) {
// Tr . debug ( tc , " Notifying listener of replace : " + listener ) ;
// listener . attributeReplaced ( replaceEvent ) ;
// } else {
// if ( null = = addEvent ) {
// addEvent = new HttpSessionBindingEvent ( this , name , value ) ;
// for ( HttpSessionAttributeListener listener : list ) {
// if ( bTrace & & tc . isDebugEnabled ( ) ) {
// Tr . debug ( tc , " Notifying listener of set : " + listener ) ;
// listener . attributeAdded ( addEvent ) ;
|
public class PayMchAPI { /** * 下载对账单
* @ param downloadbill downloadbill
* @ param key key
* @ return DownloadbillResult */
public static DownloadbillResult payDownloadbill ( MchDownloadbill downloadbill , String key ) { } }
|
Map < String , String > map = MapUtil . objectToMap ( downloadbill ) ; String sign = SignatureUtil . generateSign ( map , downloadbill . getSign_type ( ) , key ) ; downloadbill . setSign ( sign ) ; String closeorderXML = XMLConverUtil . convertToXML ( downloadbill ) ; HttpUriRequest httpUriRequest = RequestBuilder . post ( ) . setHeader ( xmlHeader ) . setUri ( baseURI ( ) + "/pay/downloadbill" ) . setEntity ( new StringEntity ( closeorderXML , Charset . forName ( "utf-8" ) ) ) . build ( ) ; return LocalHttpClient . execute ( httpUriRequest , new ResponseHandler < DownloadbillResult > ( ) { @ Override public DownloadbillResult handleResponse ( HttpResponse response ) throws ClientProtocolException , IOException { int status = response . getStatusLine ( ) . getStatusCode ( ) ; if ( status >= 200 && status < 300 ) { HttpEntity entity = response . getEntity ( ) ; String str ; // GZIP
if ( entity . getContentType ( ) . getValue ( ) . matches ( "(?i).*gzip.*" ) ) { str = StreamUtils . copyToString ( new GZIPInputStream ( entity . getContent ( ) ) , Charset . forName ( "UTF-8" ) ) ; } else { str = EntityUtils . toString ( entity , "utf-8" ) ; } EntityUtils . consume ( entity ) ; if ( str . matches ( ".*<xml>(.*|\\n)+</xml>.*" ) ) { return XMLConverUtil . convertToObject ( DownloadbillResult . class , str ) ; } else { DownloadbillResult dr = new DownloadbillResult ( ) ; dr . setData ( str ) ; // 获取返回头数据 签名信息
Header headerDigest = response . getFirstHeader ( "Digest" ) ; if ( headerDigest != null ) { String [ ] hkv = headerDigest . getValue ( ) . split ( "=" ) ; dr . setSign_type ( hkv [ 0 ] ) ; dr . setSign ( hkv [ 1 ] ) ; } return dr ; } } else { throw new ClientProtocolException ( "Unexpected response status: " + status ) ; } } } ) ;
|
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcBSplineSurfaceFormToString ( EDataType eDataType , Object instanceValue ) { } }
|
return instanceValue == null ? null : instanceValue . toString ( ) ;
|
public class OkRequest { /** * Write stream to request body
* The given stream will be closed once sending completes
* @ param input
* @ return this request */
public OkRequest < T > send ( final InputStream input ) throws IOException { } }
|
openOutput ( ) ; copy ( input , mOutput ) ; return this ;
|
public class BasePanel { /** * " Clone " this screen .
* @ return true if successful . */
public boolean onNewWindow ( ) { } }
|
String strLastCommand = Utility . addURLParam ( null , Params . MENU , Constant . BLANK ) ; // " ? menu = " ; / / Blank command = home
this . handleCommand ( strLastCommand , this , ScreenConstants . USE_NEW_WINDOW | ScreenConstants . DONT_PUSH_TO_BROWSER ) ; // Process the last ? menu = command in a new window
return true ; // Handled
|
public class Notification { /** * Returns an Update String for CQL if there is data .
* Returns null if nothing to update
* @ return */
private String update ( ) { } }
|
// If this has been done before , there is no change in checkSum and the last time notified is within GracePeriod
if ( checksum != 0 && checksum ( ) == checksum && now < last . getTime ( ) + graceEnds && now > last . getTime ( ) + lastdays ) { return null ; } else { return "UPDATE authz.notify SET last = '" + Chrono . dateOnlyStamp ( last ) + "', checksum=" + current + " WHERE user='" + user + "' AND type=" + type . getValue ( ) + ";" ; }
|
public class GisModelCurveCalculator { /** * This method calculates an array of Point2D that represents an arc . The distance
* between it points is 1 angular unit
* @ param c Point2D that represents the center of the arc
* @ param r double value that represents the radius of the arc
* @ param sa double value that represents the start angle of the arc
* @ param ea double value that represents the end angle of the arc
* @ return Point2D [ ] An array of Point2D that represents the shape of the arc */
public static Point2D [ ] calculateGisModelArc ( Point2D c , double r , double sa , double ea ) { } }
|
int isa = ( int ) sa ; int iea = ( int ) ea ; double angulo ; Point2D [ ] pts ; if ( sa <= ea ) { pts = new Point2D [ ( iea - isa ) + 2 ] ; angulo = sa ; pts [ 0 ] = new Point2D . Double ( c . getX ( ) + r * Math . cos ( angulo * Math . PI / ( double ) 180.0 ) , c . getY ( ) + r * Math . sin ( angulo * Math . PI / ( double ) 180.0 ) ) ; for ( int i = 1 ; i <= ( iea - isa ) + 1 ; i ++ ) { angulo = ( double ) ( isa + i ) ; pts [ i ] = new Point2D . Double ( c . getX ( ) + r * Math . cos ( angulo * Math . PI / ( double ) 180.0 ) , c . getY ( ) + r * Math . sin ( angulo * Math . PI / ( double ) 180.0 ) ) ; } angulo = ea ; pts [ ( iea - isa ) + 1 ] = new Point2D . Double ( c . getX ( ) + r * Math . cos ( angulo * Math . PI / ( double ) 180.0 ) , c . getY ( ) + r * Math . sin ( angulo * Math . PI / ( double ) 180.0 ) ) ; } else { pts = new Point2D [ ( 360 - isa ) + iea + 2 ] ; angulo = sa ; pts [ 0 ] = new Point2D . Double ( c . getX ( ) + r * Math . cos ( angulo * Math . PI / ( double ) 180.0 ) , c . getY ( ) + r * Math . sin ( angulo * Math . PI / ( double ) 180.0 ) ) ; for ( int i = 1 ; i <= ( 360 - isa ) ; i ++ ) { angulo = ( double ) ( isa + i ) ; pts [ i ] = new Point2D . Double ( c . getX ( ) + r * Math . cos ( angulo * Math . PI / ( double ) 180.0 ) , c . getY ( ) + r * Math . sin ( angulo * Math . PI / ( double ) 180.0 ) ) ; } for ( int i = ( 360 - isa ) + 1 ; i <= ( 360 - isa ) + iea ; i ++ ) { angulo = ( double ) ( i - ( 360 - isa ) ) ; pts [ i ] = new Point2D . Double ( c . getX ( ) + r * Math . cos ( angulo * Math . PI / ( double ) 180.0 ) , c . getY ( ) + r * Math . sin ( angulo * Math . PI / ( double ) 180.0 ) ) ; } angulo = ea ; pts [ ( 360 - isa ) + iea + 1 ] = new Point2D . Double ( c . getX ( ) + r * Math . cos ( angulo * Math . PI / ( double ) 180.0 ) , c . getY ( ) + r * Math . sin ( angulo * Math . PI / ( double ) 180.0 ) ) ; } return pts ;
|
public class WonderPushDialogBuilder { /** * Read styled attributes , they will defined in an AlertDialog shown by the given activity .
* You must call { @ link TypedArray # recycle ( ) } after having read the desired attributes .
* @ see Context # obtainStyledAttributes ( android . util . AttributeSet , int [ ] , int , int ) */
@ SuppressLint ( "Recycle" ) public static TypedArray getDialogStyledAttributes ( Context activity , int [ ] attrs , int defStyleAttr , int defStyleRef ) { } }
|
AlertDialog . Builder builder = new AlertDialog . Builder ( activity ) ; AlertDialog dialog = builder . create ( ) ; TypedArray ta = dialog . getContext ( ) . obtainStyledAttributes ( null , attrs , defStyleAttr , defStyleRef ) ; dialog . dismiss ( ) ; return ta ;
|
public class FileUtil { /** * Copy a file to new destination .
* @ param srcFile
* @ param destFile */
public static void copyFile ( File srcFile , File destFile ) { } }
|
OutputStream out = null ; InputStream in = null ; try { if ( ! destFile . getParentFile ( ) . exists ( ) ) destFile . getParentFile ( ) . mkdirs ( ) ; in = new FileInputStream ( srcFile ) ; out = new FileOutputStream ( destFile ) ; // Transfer bytes from in to out
byte [ ] buf = new byte [ 1024 ] ; int len ; while ( ( len = in . read ( buf ) ) > 0 ) { out . write ( buf , 0 , len ) ; } in . close ( ) ; out . close ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; }
|
public class CommerceWarehouseLocalServiceBaseImpl { /** * Returns the number of rows matching the dynamic query .
* @ param dynamicQuery the dynamic query
* @ param projection the projection to apply to the query
* @ return the number of rows matching the dynamic query */
@ Override public long dynamicQueryCount ( DynamicQuery dynamicQuery , Projection projection ) { } }
|
return commerceWarehousePersistence . countWithDynamicQuery ( dynamicQuery , projection ) ;
|
public class MediumMapPageNumberImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } }
|
switch ( featureID ) { case AfplibPackage . MEDIUM_MAP_PAGE_NUMBER__PAGE_NUM : return PAGE_NUM_EDEFAULT == null ? pageNum != null : ! PAGE_NUM_EDEFAULT . equals ( pageNum ) ; } return super . eIsSet ( featureID ) ;
|
public class Query { /** * Creates and returns a new Query that ' s additionally sorted by the specified field .
* @ param field The field to sort by .
* @ return The created Query . */
@ Nonnull public Query orderBy ( @ Nonnull String field ) { } }
|
return orderBy ( FieldPath . fromDotSeparatedString ( field ) , Direction . ASCENDING ) ;
|
public class AsyncListEngine { /** * Display extension */
@ Override public void subscribe ( ListEngineDisplayListener < T > listener ) { } }
|
if ( ! listeners . contains ( listener ) ) { listeners . add ( listener ) ; }
|
public class PreComputedContextExtractor { /** * { @ inheritDoc } */
public void processDocument ( BufferedReader document , Wordsi wordsi ) { } }
|
String line ; try { line = document . readLine ( ) ; } catch ( IOException ioe ) { throw new IOError ( ioe ) ; } // Split the header from the rest of the context . The header must be
// the focus word for this context .
String [ ] headerRest = line . split ( "\\s+" , 2 ) ; // Reject any words not accepted by wordsi .
if ( ! wordsi . acceptWord ( headerRest [ 0 ] ) ) return ; SparseDoubleVector context = new CompactSparseVector ( ) ; // Iterate through each feature and convert it to a dimension for the
// context vector .
for ( String item : headerRest [ 1 ] . split ( "\\|" ) ) { String [ ] featureScore = item . split ( "," , 2 ) ; double score = Double . parseDouble ( featureScore [ 0 ] ) ; int dimension = basis . getDimension ( featureScore [ 1 ] ) ; if ( dimension >= 0 ) context . set ( dimension , score ) ; } wordsi . handleContextVector ( headerRest [ 0 ] , headerRest [ 0 ] , context ) ;
|
public class Entities { /** * Walks through all entities ( recursive and breadth - first ) . Walking can be stopped or filtered
* based on the visit result returned .
* This is equivalent to { @ code walkEntityTree ( container , Integer . MAX _ VALUE , visitor ) }
* @ param container
* Entity container .
* @ param visitor
* Entity visitor .
* @ see EntityVisitor */
public static void walkEntityTree ( final EntityContainer container , final EntityVisitor visitor ) { } }
|
walkEntityTree ( container , Integer . MAX_VALUE , visitor ) ;
|
public class EntityResource { /** * Gets the list of entities for a given entity type .
* @ param entityType name of a type which is unique */
public Response getEntityListByType ( String entityType ) { } }
|
try { Preconditions . checkNotNull ( entityType , "Entity type cannot be null" ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Fetching entity list for type={} " , entityType ) ; } final List < String > entityList = metadataService . getEntityList ( entityType ) ; JSONObject response = new JSONObject ( ) ; response . put ( AtlasClient . REQUEST_ID , Servlets . getRequestId ( ) ) ; response . put ( AtlasClient . TYPENAME , entityType ) ; response . put ( AtlasClient . RESULTS , new JSONArray ( entityList ) ) ; response . put ( AtlasClient . COUNT , entityList . size ( ) ) ; return Response . ok ( response ) . build ( ) ; } catch ( NullPointerException e ) { LOG . error ( "Entity type cannot be null" , e ) ; throw new WebApplicationException ( Servlets . getErrorResponse ( e , Response . Status . BAD_REQUEST ) ) ; } catch ( AtlasException | IllegalArgumentException e ) { LOG . error ( "Unable to get entity list for type {}" , entityType , e ) ; throw new WebApplicationException ( Servlets . getErrorResponse ( e , Response . Status . BAD_REQUEST ) ) ; } catch ( WebApplicationException e ) { LOG . error ( "Unable to get entity list for type {}" , entityType , e ) ; throw e ; } catch ( Throwable e ) { LOG . error ( "Unable to get entity list for type {}" , entityType , e ) ; throw new WebApplicationException ( Servlets . getErrorResponse ( e , Response . Status . INTERNAL_SERVER_ERROR ) ) ; }
|
public class ComponentStateHelper { /** * One and only implementation of
* save - state - makes all other implementations
* unnecessary .
* @ param context
* @ return the saved state */
public Object saveState ( FacesContext context ) { } }
|
if ( context == null ) { throw new NullPointerException ( ) ; } if ( component . initialStateMarked ( ) ) { return saveMap ( context , deltaMap ) ; } else { return saveMap ( context , defaultMap ) ; }
|
public class Inputs { /** * Loads an { @ link Inputs } object from am XML file .
* @ param file
* @ return
* @ throws JAXBException */
public static Inputs load ( InputStream in ) throws JAXBException { } }
|
JAXBContext context = JAXBContext . newInstance ( Inputs . class , RF2Input . class , OWLInput . class ) ; Unmarshaller u = context . createUnmarshaller ( ) ; Inputs inputs = ( Inputs ) u . unmarshal ( in ) ; return inputs ;
|
public class Property { /** * { @ inheritDoc } */
public void writeValue ( @ NotNull Object entity , @ Nullable Object value ) { } }
|
try { getWriteMethod ( ) . invoke ( entity , value ) ; } catch ( InvocationTargetException | IllegalAccessException e ) { LOGGER . warn ( "Can't invoker write method" , e ) ; }
|
public class ComponentsInner { /** * Get status for an ongoing purge operation .
* @ param resourceGroupName The name of the resource group .
* @ param resourceName The name of the Application Insights component resource .
* @ param purgeId In a purge status request , this is the Id of the operation the status of which is returned .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < ComponentPurgeStatusResponseInner > getPurgeStatusAsync ( String resourceGroupName , String resourceName , String purgeId , final ServiceCallback < ComponentPurgeStatusResponseInner > serviceCallback ) { } }
|
return ServiceFuture . fromResponse ( getPurgeStatusWithServiceResponseAsync ( resourceGroupName , resourceName , purgeId ) , serviceCallback ) ;
|
public class StringUtils { /** * Splits the input string with the given regex and filters empty strings .
* @ param input the string to split .
* @ return the array of strings computed by splitting this string */
public static String [ ] split ( String input , String regex ) { } }
|
if ( input == null ) { return null ; } String [ ] arr = input . split ( regex ) ; List < String > results = new ArrayList < > ( arr . length ) ; for ( String a : arr ) { if ( ! a . trim ( ) . isEmpty ( ) ) { results . add ( a ) ; } } return results . toArray ( new String [ 0 ] ) ;
|
public class ComponentFactory { /** * Add a new component type to the factory . This method throws an exception
* if the class cannot be resolved . The name of the component IS NOT
* verified to allow component implementations to be overridden .
* @ param name
* @ param cls
* @ throws ClassNotFoundException */
public synchronized void add ( String name , Class < ? > cls ) { } }
|
if ( locked ) { throw new IllegalStateException ( "Component factory is locked. Components cannot be added" ) ; } supported . put ( name , cls ) ; // add name to end of order vector
if ( ! order . contains ( name ) ) order . addElement ( name ) ;
|
public class Mutations { /** * Concatenates this and other */
public Mutations < S > concat ( final Mutations < S > other ) { } }
|
return new MutationsBuilder < > ( alphabet , false ) . ensureCapacity ( this . size ( ) + other . size ( ) ) . append ( this ) . append ( other ) . createAndDestroy ( ) ;
|
public class NetworkServiceRecordAgent { /** * Create a new PhysicalnetworkFunctionRecord and add it ot a NetworkServiceRecord .
* @ param idNsr the ID of the NetworkServiceRecord
* @ param physicalNetworkFunctionRecord the new PhysicalNetworkFunctionRecord
* @ return the new PhysicalNetworkFunctionRecord
* @ throws SDKException if the request fails */
@ Help ( help = "Create the PhysicalNetworkFunctionRecord of a NetworkServiceRecord with specific id" ) public PhysicalNetworkFunctionRecord postPhysicalNetworkFunctionRecord ( final String idNsr , final PhysicalNetworkFunctionRecord physicalNetworkFunctionRecord ) throws SDKException { } }
|
String url = idNsr + "/pnfrecords" + "/" ; return ( PhysicalNetworkFunctionRecord ) requestPost ( url , physicalNetworkFunctionRecord ) ;
|
public class TextBuilder { /** * Print a double to internal buffer or output ( os or writer )
* @ param d
* @ return this builder */
public final TextBuilder p ( double d ) { } }
|
if ( null != __buffer ) __append ( d ) ; else __caller . p ( d ) ; return this ;
|
public class CmsCmisUtil { /** * Converts an OpenCms ACE to a list of basic CMIS permissions . < p >
* @ param ace the access control entry
* @ return the list of permissions */
public static List < String > getCmisPermissions ( CmsAccessControlEntry ace ) { } }
|
int permissionBits = ace . getPermissions ( ) . getPermissions ( ) ; List < String > result = new ArrayList < String > ( ) ; if ( 0 != ( permissionBits & CmsPermissionSet . PERMISSION_READ ) ) { result . add ( A_CmsCmisRepository . CMIS_READ ) ; } if ( 0 != ( permissionBits & CmsPermissionSet . PERMISSION_WRITE ) ) { result . add ( A_CmsCmisRepository . CMIS_WRITE ) ; } int all = CmsPermissionSet . PERMISSION_WRITE | CmsPermissionSet . PERMISSION_READ | CmsPermissionSet . PERMISSION_CONTROL | CmsPermissionSet . PERMISSION_DIRECT_PUBLISH ; if ( ( permissionBits & all ) == all ) { result . add ( A_CmsCmisRepository . CMIS_ALL ) ; } return result ;
|
public class ReferenceStream { /** * removeFirstMatching ( aka DestructiveGet ) .
* @ param filter
* @ param transaction
* must not be null .
* @ return Item may be null .
* @ throws { @ link MessageStoreException } if the item was spilled and could not
* be unspilled . Or if item not found in backing store .
* @ throws { @ link MessageStoreException } indicates that an unrecoverable exception has
* occurred in the underlying persistence mechanism .
* @ throws MessageStoreException */
public final ItemReference removeFirstMatching ( final Filter filter , final Transaction transaction ) throws MessageStoreException { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeFirstMatching" , new Object [ ] { filter , transaction } ) ; ReferenceCollection ic = ( ( ReferenceCollection ) _getMembership ( ) ) ; ItemReference item = null ; if ( ic != null ) { item = ( ItemReference ) ic . removeFirstMatching ( filter , transaction ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeFirstMatching" , item ) ; return item ;
|
public class AppServicePlansInner { /** * Get a Virtual Network associated with an App Service plan .
* Get a Virtual Network associated with an App Service plan .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service plan .
* @ param vnetName Name of the Virtual Network .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < VnetInfoInner > getVnetFromServerFarmAsync ( String resourceGroupName , String name , String vnetName , final ServiceCallback < VnetInfoInner > serviceCallback ) { } }
|
return ServiceFuture . fromResponse ( getVnetFromServerFarmWithServiceResponseAsync ( resourceGroupName , name , vnetName ) , serviceCallback ) ;
|
public class XScreenField { /** * Get the current string value in HTML . < p / >
* May want to check GetRootScreen ( ) . GetScreenType ( ) & INPUT / DISPLAY _ MODE
* @ param strFieldType The field type
* @ exception DBException File exception . */
public void printDisplayControl ( PrintWriter out , String strFieldDesc , String strFieldName , String strFieldType ) { } }
|
if ( this . getScreenField ( ) . getConverter ( ) == null ) return ; String strData = Utility . encodeXML ( this . getScreenField ( ) . getSFieldValue ( true , false ) ) ; if ( ( strData == null ) || ( strData . length ( ) == 0 ) ) strData = DBConstants . BLANK ; // ? " < br > " ;
// + String strHyperlink = this . getScreenField ( ) . getConverter ( ) . getHyperlink ( ) ;
// + if ( strHyperlink ! = null ) if ( strHyperlink . length ( ) > 0)
// + strField = " < A HREF = \ " " + strHyperlink + " \ " > " + strField + " < A > " ;
String strAlignment = this . getControlAlignment ( ) ; if ( strAlignment . length ( ) > 0 ) strAlignment = "align=\"" + strAlignment + "\" " ; if ( strFieldName . length ( ) > 0 ) strFieldName = "ref=\"" + strFieldName + "\"" ; out . println ( "<fo:block " + strAlignment + strFieldName + ">" + strData ) ; out . println ( " <xfm:caption>" + strFieldDesc + "</xfm:caption>" ) ; out . println ( "</fo:block>" ) ;
|
public class DirectoryWatchService { /** * - - - - - private methods - - - - - */
private boolean handleWatchEvent ( final boolean registerWatchKey , final WatchEventItem item ) throws IOException { } }
|
final WatchEvent event = item . getEvent ( ) ; final Path root = item . getRoot ( ) ; final Path parent = item . getPath ( ) ; boolean result = true ; // default is " don ' t cancel watch key "
try ( final Tx tx = StructrApp . getInstance ( ) . tx ( ) ) { final Path path = parent . resolve ( ( Path ) event . context ( ) ) ; final Kind kind = event . kind ( ) ; if ( StandardWatchEventKinds . ENTRY_CREATE . equals ( kind ) ) { if ( Files . isDirectory ( path ) ) { scanDirectoryTree ( registerWatchKey , root , path ) ; } result = listener . onCreate ( root , parent , path ) ; } else if ( StandardWatchEventKinds . ENTRY_DELETE . equals ( kind ) ) { result = listener . onDelete ( root , parent , path ) ; } else if ( StandardWatchEventKinds . ENTRY_MODIFY . equals ( kind ) ) { result = listener . onModify ( root , parent , path ) ; } tx . success ( ) ; } catch ( FrameworkException fex ) { fex . printStackTrace ( ) ; } return result ;
|
public class Matrix4d { /** * Apply rotation of < code > angles . x < / code > radians about the X axis , followed by a rotation of < code > angles . y < / code > radians about the Y axis and
* followed by a rotation of < code > angles . z < / code > radians about the Z axis .
* When used with a right - handed coordinate system , the produced rotation will rotate a vector
* counter - clockwise around the rotation axis , when viewing along the negative axis direction towards the origin .
* When used with a left - handed coordinate system , the rotation is clockwise .
* If < code > M < / code > is < code > this < / code > matrix and < code > R < / code > the rotation matrix ,
* then the new matrix will be < code > M * R < / code > . So when transforming a
* vector < code > v < / code > with the new matrix by using < code > M * R * v < / code > , the
* rotation will be applied first !
* This method is equivalent to calling : < code > rotateX ( angles . x ) . rotateY ( angles . y ) . rotateZ ( angles . z ) < / code >
* @ param angles
* the Euler angles
* @ return this */
public Matrix4d rotateXYZ ( Vector3d angles ) { } }
|
return rotateXYZ ( angles . x , angles . y , angles . z ) ;
|
public class DataService { /** * Method to delete record for the given entity in asynchronous fashion
* @ param entity
* the entity
* @ param callbackHandler
* the callback handler
* @ throws FMSException */
public < T extends IEntity > void deleteAsync ( T entity , CallbackHandler callbackHandler ) throws FMSException { } }
|
IntuitMessage intuitMessage = prepareDelete ( entity ) ; // set callback handler
intuitMessage . getRequestElements ( ) . setCallbackHandler ( callbackHandler ) ; // execute async interceptors
executeAsyncInterceptors ( intuitMessage ) ;
|
public class CommerceShipmentItemPersistenceImpl { /** * Returns a range of all the commerce shipment items .
* 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 set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommerceShipmentItemModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order .
* @ param start the lower bound of the range of commerce shipment items
* @ param end the upper bound of the range of commerce shipment items ( not inclusive )
* @ return the range of commerce shipment items */
@ Override public List < CommerceShipmentItem > findAll ( int start , int end ) { } }
|
return findAll ( start , end , null ) ;
|
public class HttpInputStream { /** * Reads into an array of bytes until all requested bytes have been
* read or a ' \ n ' is encountered , in which case the ' \ n ' is read into
* the array as well .
* @ param b the buffer where data is stored
* @ param off the start offset of the data
* @ param len the length of the data
* @ return the actual number of bytes read , or - 1 if the end of the
* stream is reached or the byte limit has been exceeded
* @ exception IOException if an I / O error has occurred */
public int readLine ( byte [ ] b , int off , int len ) throws IOException { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { // 306998.15
logger . logp ( Level . FINE , CLASS_NAME , "readLine" , "readLine" ) ; } if ( total >= limit ) { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { // 306998.15
logger . logp ( Level . FINE , CLASS_NAME , "readLine" , "readLine Over the limit: -1" ) ; } return - 1 ; } int avail ; // bytes available in buffer
int readlen ; // amount to be read by copyline
int remain = 0 ; // amount remaining to be read
int newlen ; // amount read by copyline
int totalread ; // total amount read so far
remain = len ; avail = count - pos ; if ( avail <= 0 ) { fill ( ) ; avail = count - pos ; if ( avail <= 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { // 306998.15
logger . logp ( Level . FINE , CLASS_NAME , "readLine" , "readLine avail less than 0: -1" ) ; } return - 1 ; } } if ( avail < len ) { readlen = avail ; } else { readlen = len ; } newlen = copyLine ( buf , pos , b , off , readlen ) ; pos += newlen ; total += newlen ; remain -= newlen ; totalread = newlen ; if ( totalread == 0 ) { // should never happen
if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { // 306998.15
logger . logp ( Level . FINE , CLASS_NAME , "readLine" , "readLine totalRead is 0: -1" ) ; } return - 1 ; } while ( remain > 0 && b [ off + totalread - 1 ] != '\n' ) { // loop through until the conditions of the method are satisfied
fill ( ) ; avail = count - pos ; if ( avail <= 0 ) { // The stream is finished , return what we have .
if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { // 306998.15
logger . logp ( Level . FINE , CLASS_NAME , "readLine" , "readLine returning --> " + totalread ) ; } return totalread ; } if ( avail < remain ) { readlen = avail ; } else { readlen = remain ; } newlen = copyLine ( buf , pos , b , off + totalread , readlen ) ; pos += newlen ; total += newlen ; remain -= newlen ; totalread += newlen ; } return totalread ;
|
public class KeyVaultClientBaseImpl { /** * Permanently deletes the specified storage account .
* The purge deleted storage account operation removes the secret permanently , without the possibility of recovery . This operation can only be performed on a soft - delete enabled vault . This operation requires the storage / purge permission .
* @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net .
* @ param storageAccountName The name of the storage account .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws KeyVaultErrorException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */
public void purgeDeletedStorageAccount ( String vaultBaseUrl , String storageAccountName ) { } }
|
purgeDeletedStorageAccountWithServiceResponseAsync ( vaultBaseUrl , storageAccountName ) . toBlocking ( ) . single ( ) . body ( ) ;
|
public class DateBuilder { /** * Returns a date that is rounded to the previous even hour below the given
* date .
* For example an input date with a time of 08:13:54 would result in a date
* with the time of 08:00:00.
* @ param date
* the Date to round , if < code > null < / code > the current time will be
* used
* @ return the new rounded date */
public static Date evenHourDateBefore ( final Date date ) { } }
|
final Calendar c = PDTFactory . createCalendar ( ) ; c . setTime ( date != null ? date : new Date ( ) ) ; c . set ( Calendar . MINUTE , 0 ) ; c . set ( Calendar . SECOND , 0 ) ; c . set ( Calendar . MILLISECOND , 0 ) ; return c . getTime ( ) ;
|
public class Xoauth2Sasl { /** * Builds an XOAUTH2 SASL client response .
* According to https : / / developers . google . com / gmail / xoauth2 _ protocol the SASL XOAUTH2 initial
* client response has the following format :
* { @ code base64 ( " user = " { User } " ^ Aauth = Bearer " { Access Token } " ^ A ^ A " ) }
* using the base64 encoding mechanism defined in RFC 4648 . ^ A represents a Control + A ( \ 001 ) .
* @ return A base - 64 encoded string containing the auth string suitable for login via xoauth2. */
public static String build ( String user , String accessToken ) { } }
|
StringBuilder authString = new StringBuilder ( ) . append ( "user=" ) . append ( user ) . append ( ctrlA ) . append ( "auth=Bearer " ) . append ( accessToken ) . append ( ctrlA ) . append ( ctrlA ) ; return Base64 . encode ( authString . toString ( ) . getBytes ( ) ) ;
|
public class TableModelUtils { /** * Convert database metaData to TableModels , note : < br / >
* 1 ) This method does not close connection , do not forgot close it later < br / >
* 2 ) This method does not read sequence , index , unique constraints */
public static TableModel [ ] db2Models ( Connection con , Dialect dialect ) { } }
|
return TableModelUtilsOfDb . db2Models ( con , dialect ) ;
|
public class LofQuery { /** * { @ inheritDoc } */
@ Override public void execute ( TridentTuple tuple , String result , TridentCollector collector ) { } }
|
collector . emit ( new Values ( result ) ) ;
|
public class RequestedGlobalProperties { /** * This method resets the properties to a state where no properties are given . */
public void reset ( ) { } }
|
this . partitioning = PartitioningProperty . RANDOM_PARTITIONED ; this . ordering = null ; this . partitioningFields = null ; this . dataDistribution = null ; this . customPartitioner = null ;
|
public class MailSender { /** * 配置邮箱
* @ param mailHost 邮件服务器
* @ param personal 个人名称
* @ param from 发件箱
* @ param key 密码 */
public static void config ( MailHost mailHost , String personal , String from , String key ) { } }
|
setHost ( mailHost ) ; setPersonal ( personal ) ; setFrom ( from ) ; setKey ( key ) ;
|
public class DoubleLinkedPoiCategory { /** * This method calculates a unique ID for all nodes in the tree . For each node ' s ' n ' ID named
* ' ID _ ' n at depth ' d ' the following invariants must be true :
* < ul >
* < li > ID > max ( ID of all child nodes ) < / li >
* < li > All nodes ' IDs left of n must be < ID _ n . < / li >
* < li > All nodes ' IDs right of n must be > ID _ n . < / li >
* < / ul >
* @ param rootNode The tree ' s root node . ( < strong > Any other node will result in invalid IDs ! < / strong > )
* @ param maxValue Global maximum ID .
* @ return The root node ' s ID . */
public static int calculateCategoryIDs ( DoubleLinkedPoiCategory rootNode , int maxValue ) { } }
|
int newMax = maxValue ; for ( PoiCategory c : rootNode . childCategories ) { newMax = calculateCategoryIDs ( ( DoubleLinkedPoiCategory ) c , newMax ) ; } rootNode . id = newMax ; return newMax + 1 ;
|
public class DeployTargetResolver { /** * Process user configuration of " projectId " . If set to GCLOUD _ CONFIG then read from gcloud ' s
* global state . If set but not a keyword then just return the set value . */
public String getProject ( String configString ) { } }
|
if ( configString == null || configString . trim ( ) . isEmpty ( ) || configString . equals ( APPENGINE_CONFIG ) ) { throw new GradleException ( PROJECT_ERROR ) ; } if ( configString . equals ( GCLOUD_CONFIG ) ) { try { String gcloudProject = cloudSdkOperations . getGcloud ( ) . getConfig ( ) . getProject ( ) ; if ( gcloudProject == null || gcloudProject . trim ( ) . isEmpty ( ) ) { throw new GradleException ( "Project was not found in gcloud config" ) ; } return gcloudProject ; } catch ( IOException | CloudSdkOutOfDateException | ProcessHandlerException | CloudSdkNotFoundException | CloudSdkVersionFileException ex ) { throw new GradleException ( "Failed to read project from gcloud config" , ex ) ; } } return configString ;
|
public class ZWaveAlarmSensorCommandClass { /** * Gets a SerialMessage with the SENSOR _ ALARM _ GET command
* @ return the serial message */
public SerialMessage getMessage ( AlarmType alarmType ) { } }
|
logger . debug ( "Creating new message for application command SENSOR_ALARM_GET for node {}" , this . getNode ( ) . getNodeId ( ) ) ; SerialMessage result = new SerialMessage ( this . getNode ( ) . getNodeId ( ) , SerialMessage . SerialMessageClass . SendData , SerialMessage . SerialMessageType . Request , SerialMessage . SerialMessageClass . ApplicationCommandHandler , SerialMessage . SerialMessagePriority . Get ) ; byte [ ] newPayload = { ( byte ) this . getNode ( ) . getNodeId ( ) , 3 , ( byte ) getCommandClass ( ) . getKey ( ) , ( byte ) SENSOR_ALARM_GET , ( byte ) alarmType . getKey ( ) } ; result . setMessagePayload ( newPayload ) ; return result ;
|
public class ReflectionUtils { /** * Finds all declared fields in given < tt > clazz < / tt > and its super classes .
* @ param clazz
* @ return */
public static Field [ ] getDeclaredFieldsInHierarchy ( Class < ? > clazz ) { } }
|
List < Field > fields = new ArrayList < Field > ( ) ; for ( Class < ? > acls = clazz ; acls != null ; acls = acls . getSuperclass ( ) ) { for ( Field field : acls . getDeclaredFields ( ) ) { fields . add ( field ) ; } } return fields . toArray ( new Field [ fields . size ( ) ] ) ;
|
public class GetLoadBalancersRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetLoadBalancersRequest getLoadBalancersRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( getLoadBalancersRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getLoadBalancersRequest . getPageToken ( ) , PAGETOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class StandardHlsSettingsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( StandardHlsSettings standardHlsSettings , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( standardHlsSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( standardHlsSettings . getAudioRenditionSets ( ) , AUDIORENDITIONSETS_BINDING ) ; protocolMarshaller . marshall ( standardHlsSettings . getM3u8Settings ( ) , M3U8SETTINGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class FileGenerator { /** * XMLFilter methods */
@ Override public void endElement ( final String uri , final String localName , final String qName ) throws SAXException { } }
|
if ( ! ( DITA_OT_NS . equals ( uri ) && EXTENSION_ELEM . equals ( localName ) ) ) { getContentHandler ( ) . endElement ( uri , localName , qName ) ; }
|
public class Metric { /** * Adds a value to the list of values .
* @ param value The value to add to the list of values */
public void addValue ( String value ) { } }
|
if ( this . values == null ) this . values = new ArrayList < String > ( ) ; this . values . add ( value ) ;
|
public class ComparatorCompat { /** * Adds the comparator , that uses a function for extract
* a { @ link java . lang . Comparable } sort key , to the chain .
* @ param < U > the type of the sort key
* @ param keyExtractor the function that extracts the sort key
* @ return the new { @ code ComparatorCompat } instance */
@ NotNull public < U extends Comparable < ? super U > > ComparatorCompat < T > thenComparing ( @ NotNull Function < ? super T , ? extends U > keyExtractor ) { } }
|
return thenComparing ( comparing ( keyExtractor ) ) ;
|
public class Client { /** * Sends a CSR to the SCEP server for enrolling in a PKI .
* This method enrols the provider < tt > CertificationRequest < / tt > into the
* PKI represented by the SCEP server .
* @ param identity
* the identity of the client .
* @ param key
* the private key to sign the SCEP request .
* @ param csr
* the CSR to enrol .
* @ param profile
* the SCEP server profile .
* @ return the certificate store returned by the server .
* @ throws ClientException
* if any client error occurs .
* @ throws TransactionException
* if there is a problem with the SCEP transaction .
* @ see CertStoreInspector */
public EnrollmentResponse enrol ( final X509Certificate identity , final PrivateKey key , final PKCS10CertificationRequest csr , final String profile ) throws ClientException , TransactionException { } }
|
LOGGER . debug ( "Enrolling certificate with CA" ) ; if ( isSelfSigned ( identity ) ) { LOGGER . debug ( "Certificate is self-signed" ) ; X500Name csrSubject = csr . getSubject ( ) ; X500Name idSubject = X500Utils . toX500Name ( identity . getSubjectX500Principal ( ) ) ; if ( ! csrSubject . equals ( idSubject ) ) { LOGGER . error ( "The self-signed certificate MUST use the same subject name as in the PKCS#10 request." ) ; } } // TRANSACTIONAL
// Certificate enrollment
final Transport transport = createTransport ( profile ) ; PkiMessageEncoder encoder = getEncoder ( identity , key , profile ) ; PkiMessageDecoder decoder = getDecoder ( identity , key , profile ) ; final EnrollmentTransaction trans = new EnrollmentTransaction ( transport , encoder , decoder , csr ) ; try { MessageDigest digest = getCaCapabilities ( profile ) . getStrongestMessageDigest ( ) ; byte [ ] hash = digest . digest ( csr . getEncoded ( ) ) ; LOGGER . debug ( "{} PKCS#10 Fingerprint: [{}]" , digest . getAlgorithm ( ) , new String ( Hex . encodeHex ( hash ) ) ) ; } catch ( IOException e ) { LOGGER . error ( "Error getting encoded CSR" , e ) ; } return send ( trans ) ;
|
public class BackendBucketClient { /** * Deletes the specified BackendBucket resource .
* < p > Sample code :
* < pre > < code >
* try ( BackendBucketClient backendBucketClient = BackendBucketClient . create ( ) ) {
* ProjectGlobalBackendBucketName backendBucket = ProjectGlobalBackendBucketName . of ( " [ PROJECT ] " , " [ BACKEND _ BUCKET ] " ) ;
* Operation response = backendBucketClient . deleteBackendBucket ( backendBucket ) ;
* < / code > < / pre >
* @ param backendBucket Name of the BackendBucket resource to delete .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final Operation deleteBackendBucket ( ProjectGlobalBackendBucketName backendBucket ) { } }
|
DeleteBackendBucketHttpRequest request = DeleteBackendBucketHttpRequest . newBuilder ( ) . setBackendBucket ( backendBucket == null ? null : backendBucket . toString ( ) ) . build ( ) ; return deleteBackendBucket ( request ) ;
|
public class BeetlUtil { /** * 判断一个路径是否指到外部了 , 比如 . . / . . / test . txt就指到外部
* @ param child
* @ return */
public static boolean isOutsideOfRoot ( String child ) { } }
|
if ( child == null ) return true ; char [ ] array = child . toCharArray ( ) ; int root = 0 ; if ( array . length == 0 ) return true ; int start = 0 ; if ( array [ 0 ] == '/' || array [ 0 ] == '\\' ) { start = 1 ; } StringBuilder dir = new StringBuilder ( ) ; for ( int i = start ; i < array . length ; i ++ ) { char c = array [ i ] ; if ( c == '/' || c == '\\' ) { if ( dir . toString ( ) . equals ( ".." ) ) { root ++ ; if ( root == 1 ) { return true ; } } else if ( dir . length ( ) == 0 ) { // 非法的格式
return true ; } else { root -- ; } dir . setLength ( 0 ) ; } else { dir . append ( c ) ; } } if ( root <= 0 ) { return false ; } else { return true ; }
|
public class VersionUtil { /** * 获取下一个版本
* @ param nextVersionClass
* @ param current
* @ return
* @ throws VersionException */
public static Object nextVersion ( Class < ? extends NextVersion > nextVersionClass , Object current ) throws VersionException { } }
|
try { NextVersion nextVersion ; if ( CACHE . containsKey ( nextVersionClass ) ) { nextVersion = CACHE . get ( nextVersionClass ) ; } else { LOCK . lock ( ) ; try { if ( ! CACHE . containsKey ( nextVersionClass ) ) { CACHE . put ( nextVersionClass , nextVersionClass . newInstance ( ) ) ; } nextVersion = CACHE . get ( nextVersionClass ) ; } finally { LOCK . unlock ( ) ; } } return nextVersion . nextVersion ( current ) ; } catch ( Exception e ) { throw new VersionException ( "获取下一个版本号失败!" , e ) ; }
|
public class LicenseKeyFilter { /** * Adds the License key to the client request .
* @ param request The client request */
public void filter ( ClientRequestContext request ) throws IOException { } }
|
if ( ! request . getHeaders ( ) . containsKey ( "X-License-Key" ) ) request . getHeaders ( ) . add ( "X-License-Key" , this . licensekey ) ;
|
public class ExportImportHelper { public void exportTo ( OutputStream stream ) { } }
|
XStream xStream = createXStream ( ) ; xStream . toXML ( dataSets , stream ) ; logger . info ( "Exported to Stream: size=[{}] keys={}" , dataSets . size ( ) , dataSets . keySet ( ) ) ;
|
public class XMLUtil { /** * Replies the color that corresponds to the specified attribute ' s path .
* < p > The path is an ordered list of tag ' s names and ended by the name of
* the attribute .
* Be careful about the fact that the names are case sensitives .
* @ param document is the XML document to explore .
* @ param path is the list of and ended by the attribute ' s name .
* @ return the color of the specified attribute . */
@ Pure public static int getAttributeColor ( Node document , String ... path ) { } }
|
assert document != null : AssertMessages . notNullParameter ( 0 ) ; return getAttributeColorWithDefault ( document , true , 0 , path ) ;
|
public class ExpandableRecyclerAdapter { /** * Given the index relative to the entire RecyclerView for a child item ,
* returns the child position within the child list of the parent . */
@ UiThread int getChildPosition ( int flatPosition ) { } }
|
if ( flatPosition == 0 ) { return 0 ; } int childCount = 0 ; for ( int i = 0 ; i < flatPosition ; i ++ ) { ExpandableWrapper < P , C > listItem = mFlatItemList . get ( i ) ; if ( listItem . isParent ( ) ) { childCount = 0 ; } else { childCount ++ ; } } return childCount ;
|
public class NamespaceNotifierClient { /** * Called right after a reconnect to resubscribe to all events . Must be
* called with the connection lock acquired . */
private boolean resubscribe ( ) throws TransactionIdTooOldException , InterruptedException { } }
|
for ( NamespaceEventKey eventKey : watchedEvents . keySet ( ) ) { NamespaceEvent event = eventKey . getEvent ( ) ; if ( ! subscribe ( event . getPath ( ) , EventType . fromByteValue ( event . getType ( ) ) , watchedEvents . get ( eventKey ) ) ) { return false ; } } return true ;
|
public class LangPropsService { /** * Gets a value from { @ link org . b3log . latke . Latkes # getLocale ( ) the current locale } specified language properties
* file with the specified key .
* @ param key the specified key
* @ return value */
public String get ( final String key ) { } }
|
return get ( Keys . LANGUAGE , key , Locales . getLocale ( ) ) ;
|
public class SerialInterrupt { /** * Java consumer code can all this method to register itself as a listener for pin state
* changes .
* @ see com . pi4j . jni . SerialInterruptListener
* @ see com . pi4j . jni . SerialInterruptEvent
* @ param fileDescriptor the serial file descriptor / handle
* @ param listener A class instance that implements the GpioInterruptListener interface . */
public static synchronized void addListener ( int fileDescriptor , SerialInterruptListener listener ) { } }
|
if ( ! listeners . containsKey ( fileDescriptor ) ) { listeners . put ( fileDescriptor , listener ) ; enableSerialDataReceiveCallback ( fileDescriptor ) ; }
|
public class DecomposeHomography { /** * W = [ H * a , H * b , hat ( H * a ) * H * b ] */
private void setW ( DMatrixRMaj W , DMatrixRMaj H , Vector3D_F64 a , Vector3D_F64 b ) { } }
|
GeometryMath_F64 . mult ( H , b , tempV ) ; setColumn ( W , 1 , tempV ) ; GeometryMath_F64 . mult ( H , a , tempV ) ; setColumn ( W , 0 , tempV ) ; GeometryMath_F64 . crossMatrix ( tempV , Hv2 ) ; CommonOps_DDRM . mult ( Hv2 , H , tempM ) ; GeometryMath_F64 . mult ( tempM , b , tempV ) ; setColumn ( W , 2 , tempV ) ;
|
public class SailthruClient { /** * Delete existing blast
* @ param blastId
* @ throws IOException */
public JsonResponse deleteBlast ( Integer blastId ) throws IOException { } }
|
Blast blast = new Blast ( ) ; blast . setBlastId ( blastId ) ; return apiDelete ( blast ) ;
|
public class XMLConfigAdmin { /** * remove a CFX Tag
* @ param name
* @ throws ExpressionException
* @ throws SecurityException */
public void removeCFX ( String name ) throws ExpressionException , SecurityException { } }
|
checkWriteAccess ( ) ; // check parameters
if ( name == null || name . length ( ) == 0 ) throw new ExpressionException ( "name for CFX Tag can be a empty value" ) ; renameOldstyleCFX ( ) ; Element mappings = _getRootElement ( "ext-tags" ) ; Element [ ] children = XMLConfigWebFactory . getChildren ( mappings , "ext-tag" ) ; for ( int i = 0 ; i < children . length ; i ++ ) { String n = children [ i ] . getAttribute ( "name" ) ; if ( n != null && n . equalsIgnoreCase ( name ) ) { mappings . removeChild ( children [ i ] ) ; } }
|
public class JumboCyclicVertexSearch { /** * AND the to bit sets together and return the result . Neither input is
* modified .
* @ param x first bit set
* @ param y second bit set
* @ return the AND of the two bit sets */
static BitSet and ( BitSet x , BitSet y ) { } }
|
BitSet z = copy ( x ) ; z . and ( y ) ; return z ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.