signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ComputerVisionImpl { /** * This operation generates a description of an image in human readable language with complete sentences . The description is based on a collection of content tags , which are also returned by the operation . More than one description can be generated for each image . Descriptions a... | return describeImageWithServiceResponseAsync ( url , describeImageOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class RocksDbQueue { /** * { @ inheritDoc } */
@ Override public boolean queue ( IQueueMessage < ID , DATA > _msg ) { } } | IQueueMessage < ID , DATA > msg = _msg . clone ( ) ; Date now = new Date ( ) ; msg . setNumRequeues ( 0 ) . setQueueTimestamp ( now ) . setTimestamp ( now ) ; try { return putToQueue ( msg , false ) ; } catch ( RocksDBException e ) { throw new QueueException ( e ) ; } |
public class SqlParamUtils { /** * 1つのパラメータの設定
* パラメータ値は以下の表記が可能
* < dl >
* < dh > [ NULL ] < / dh >
* < dd > < code > null < / code > を設定する < / dd >
* < dh > [ EMPTY ] < / dh >
* < dd > " " ( 空文字 ) を設定する < / dd >
* < dh > ' 値 ' < / dh >
* < dd > 文字列として設定する . 空白を含めることもできる < / dd >
* < dh > [ 値1 , ... | if ( val . startsWith ( "[" ) && val . endsWith ( "]" ) && ! ( val . equals ( "[NULL]" ) || val . equals ( "[EMPTY]" ) ) ) { // [ ] で囲まれた値は配列に変換する 。 ex ) [ 1 , 2 ] = > { " 1 " , " 2 " }
String [ ] parts = val . substring ( 1 , val . length ( ) - 1 ) . split ( "\\s*,\\s*" ) ; Object [ ] vals = new Object [ parts . leng... |
public class SparseLongArray { /** * Puts a key / value pair into the array , optimizing for the case where
* the key is greater than all existing keys in the array . */
public void append ( int key , long value ) { } } | if ( mSize != 0 && key <= mKeys [ mSize - 1 ] ) { put ( key , value ) ; return ; } int pos = mSize ; if ( pos >= mKeys . length ) { growKeyAndValueArrays ( pos + 1 ) ; } mKeys [ pos ] = key ; mValues [ pos ] = value ; mSize = pos + 1 ; |
public class MQLinkHandler { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . MQLinkLocalization # delete ( ) */
public void delete ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "delete" ) ; // Mark the destination for deletion
try { // Set the deletion flag in the DH persistently . A transaction per DH ? ?
LocalTransaction siTran = txManager . createLocalTransaction ( true ) ; setToBeDeleted ( true... |
public class AuthRequest { /** * Return the full IDP redirect url with encoded SAML request
* @ return String SAML request url
* @ throws XMLStreamException
* @ throws IOException */
public String getRedirectUrl ( ) throws XMLStreamException , IOException { } } | String url = this . settings . getIdpSsoTargetUrl ( ) ; url += "?SAMLRequest=" ; url += URLEncoder . encode ( this . getXmlBase64Request ( ) , "UTF-8" ) ; if ( this . parameters != null ) { for ( Map . Entry < String , String > param : this . parameters . entrySet ( ) ) { String key = URLEncoder . encode ( param . getK... |
public class SibDiagnosticModule { /** * Generates a string representation of an object for FFDC .
* @ param obj
* Object to generate a string representation of
* @ return
* The string representation of the object */
protected String toFFDCStringSingleObject ( Object obj ) { } } | if ( obj == null ) { return "<null>" ; } else if ( obj instanceof Traceable ) { return ( ( Traceable ) obj ) . toTraceString ( ) ; } else if ( obj instanceof String ) { return ( ( String ) obj ) ; } else if ( obj instanceof byte [ ] ) { return toFFDCString ( ( byte [ ] ) obj ) ; } else { return obj . toString ( ) ; } |
public class KeyVaultCredentials { /** * Builds request with authenticated header . Protects request body if supported .
* @ param originalRequest
* unprotected request without auth token .
* @ param challengeMap
* the challenge map .
* @ return Pair of protected request and HttpMessageSecurity used for
* e... | Boolean supportsPop = supportsMessageProtection ( originalRequest . url ( ) . toString ( ) , challengeMap ) ; // if the service supports pop and a clientEncryptionKey has not been generated yet , generate
// the key that will be used for encryption on this and all subsequent protected requests
if ( supportsPop && this ... |
public class RegisterInstanceRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RegisterInstanceRequest registerInstanceRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( registerInstanceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( registerInstanceRequest . getStackId ( ) , STACKID_BINDING ) ; protocolMarshaller . marshall ( registerInstanceRequest . getHostname ( ) , HOSTNAME_BINDING ) ; p... |
public class VoltTrace { /** * Creates a begin duration trace event . This method does not queue the
* event . Call { @ link TraceEventBatch # add ( Supplier ) } to queue the event . */
public static TraceEvent beginDuration ( String name , Object ... args ) { } } | return new TraceEvent ( TraceEventType . DURATION_BEGIN , name , null , args ) ; |
public class FileBasedJobLockFactory { /** * Try locking the lock .
* @ return < em > true < / em > if the lock is successfully locked ,
* < em > false < / em > if otherwise .
* @ throws JobLockException thrown if the { @ link JobLock } fails to be acquired */
boolean tryLock ( Path lockFile ) throws JobLockExcep... | log . debug ( "Attempting lock: {}" , lockFile ) ; try { return this . fs . createNewFile ( lockFile ) ; } catch ( IOException e ) { throw new JobLockException ( e ) ; } |
public class SelfCalibrationLinearRotationMulti { /** * Extracts calibration for the reference frame */
void extractReferenceW ( DMatrixRMaj nv ) { } } | W0 . a11 = nv . data [ 0 ] ; W0 . a12 = W0 . a21 = nv . data [ 1 ] ; W0 . a13 = W0 . a31 = nv . data [ 2 ] ; W0 . a22 = nv . data [ 3 ] ; W0 . a23 = W0 . a32 = nv . data [ 4 ] ; W0 . a33 = nv . data [ 5 ] ; |
public class Hex { /** * Gets escaped hex string corresponding to the given bytes .
* @ param bytes bytes .
* @ return escaped hex string */
public static String getEscaped ( byte ... bytes ) { } } | final StringBuilder bld = new StringBuilder ( ) ; for ( byte b : bytes ) { bld . append ( "\\" ) . append ( Hex . get ( b ) ) ; } return bld . toString ( ) ; |
public class SymbolUtils { /** * Creates a map of { @ link Symbol } s from a map of { @ link String } s . No keys or values may be
* null . */
public static ImmutableMap < Symbol , Symbol > mapFrom ( Map < String , String > stringMap ) { } } | final ImmutableMap . Builder < Symbol , Symbol > ret = ImmutableMap . builder ( ) ; for ( Map . Entry < String , String > stringEntry : stringMap . entrySet ( ) ) { ret . put ( Symbol . from ( stringEntry . getKey ( ) ) , Symbol . from ( stringEntry . getValue ( ) ) ) ; } return ret . build ( ) ; |
public class Category { /** * Log a localized message . The user supplied parameter { @ code key } is replaced by its localized version from the
* resource bundle .
* @ param priority
* Priority for log entry
* @ param key
* Resource key for translation
* @ param t
* Exception to log
* @ see # setResour... | ResourceBundle bundle = this . bundle ; String message = bundle == null ? key : bundle . getString ( key ) ; provider . log ( STACKTRACE_DEPTH , null , translatePriority ( priority ) , t , message , ( Object [ ] ) null ) ; |
public class BindUploader { /** * Compute the number of array bind values in the given bind map
* @ param bindValues the bind map
* @ return 0 if bindValues is null , has no binds , or is not an array bind
* n otherwise , where n is the number of binds in the array bind */
public static int arrayBindValueCount ( ... | if ( ! isArrayBind ( bindValues ) ) { return 0 ; } else { ParameterBindingDTO bindSample = bindValues . values ( ) . iterator ( ) . next ( ) ; List < String > bindSampleValues = ( List < String > ) bindSample . getValue ( ) ; return bindValues . size ( ) * bindSampleValues . size ( ) ; } |
public class StrUtils { /** * Return first postion ignore case , return - 1 if not found */
public static int indexOfIgnoreCase ( final String str , final String searchStr ) { } } | // NOSONAR
if ( searchStr . isEmpty ( ) || str . isEmpty ( ) ) { return str . indexOf ( searchStr ) ; } for ( int i = 0 ; i < str . length ( ) ; ++ i ) { if ( i + searchStr . length ( ) > str . length ( ) ) { return - 1 ; } int j = 0 ; int ii = i ; while ( ii < str . length ( ) && j < searchStr . length ( ) ) { char c ... |
public class ObjectUtil { /** * Checks that the given argument is neither null nor empty .
* If it is , throws { @ link NullPointerException } or { @ link IllegalArgumentException } .
* Otherwise , returns the argument . */
public static < T > T [ ] checkNonEmpty ( T [ ] array , String name ) { } } | checkNotNull ( array , name ) ; checkPositive ( array . length , name + ".length" ) ; return array ; |
public class Resource { /** * Set an enterprise custom field value .
* @ param index field index
* @ param value field value */
public void setEnterpriseCustomField ( int index , String value ) { } } | set ( selectField ( ResourceFieldLists . ENTERPRISE_CUSTOM_FIELD , index ) , value ) ; |
public class CommerceDiscountLocalServiceBaseImpl { /** * Returns all the commerce discounts matching the UUID and company .
* @ param uuid the UUID of the commerce discounts
* @ param companyId the primary key of the company
* @ return the matching commerce discounts , or an empty list if no matches were found *... | return commerceDiscountPersistence . findByUuid_C ( uuid , companyId ) ; |
public class CmsPermissionView { /** * Checks if a certain permission of a permission set is denied . < p >
* @ param p the current CmsPermissionSet
* @ param value the int value of the permission to check
* @ return true if the permission is denied , otherwise false */
protected Boolean isDenied ( CmsPermissionS... | if ( ( p . getDeniedPermissions ( ) & value ) > 0 ) { return Boolean . TRUE ; } return Boolean . FALSE ; |
public class FullSegmentation { /** * 从树叶开始反向遍历生成全切分结果
* @ param node 树叶节点
* @ return 全切分结果 */
private List < Word > toWords ( Node node ) { } } | Stack < String > stack = new Stack < > ( ) ; while ( node != null ) { stack . push ( node . getText ( ) ) ; node = node . getParent ( ) ; } int len = stack . size ( ) ; List < Word > list = new ArrayList < > ( len ) ; for ( int i = 0 ; i < len ; i ++ ) { list . add ( new Word ( stack . pop ( ) ) ) ; } return list ; |
public class ModelsImpl { /** * Get one entity role for a given entity .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param hEntityId The hierarchical entity extractor ID .
* @ param roleId entity role ID .
* @ throws IllegalArgumentException thrown if parameters fail the vali... | if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgu... |
public class TypeToken { /** * Returns the { @ link Invokable } for { @ code method } , which must be a member of { @ code T } .
* @ since 14.0 */
public final Invokable < T , Object > method ( Method method ) { } } | checkArgument ( of ( method . getDeclaringClass ( ) ) . isAssignableFrom ( this ) , "%s not declared by %s" , method , this ) ; return new Invokable . MethodInvokable < T > ( method ) { @ Override Type getGenericReturnType ( ) { return resolveType ( super . getGenericReturnType ( ) ) . getType ( ) ; } @ Override Type [... |
public class IonLobLite { /** * Calculate LOB hash code as XOR of seed with CRC - 32 of the LOB data .
* This distinguishes BLOBs from CLOBs
* @ param seed Seed value
* @ return hash code */
protected int lobHashCode ( int seed , SymbolTableProvider symbolTableProvider ) { } } | int result = seed ; if ( ! isNullValue ( ) ) { CRC32 crc = new CRC32 ( ) ; crc . update ( getBytes ( ) ) ; result ^= ( int ) crc . getValue ( ) ; } return hashTypeAnnotations ( result , symbolTableProvider ) ; |
public class InMemoryEventLoggingListener { /** * Convenience method for getting only the names of the events .
* @ return list of event names , by order of selection . */
public List < String > eventNames ( ) { } } | return events . stream ( ) . map ( BEvent :: getName ) . collect ( toList ( ) ) ; |
public class CorrelationIdPlugin { /** * Postprocessor method that assigns the Correlation - Id from the
* request to a header on the Response .
* @ param request the incoming Request .
* @ param response the outgoing Response . */
@ Override public void process ( Request request , Response response ) { } } | if ( ! response . hasHeader ( CORRELATION_ID ) ) { response . addHeader ( CORRELATION_ID , request . getHeader ( CORRELATION_ID ) ) ; } |
public class MagickUtil { /** * Converts a bi - level { @ code MagickImage } to a { @ code BufferedImage } , of
* type { @ code TYPE _ BYTE _ BINARY } .
* @ param pImage the original { @ code MagickImage }
* @ return a new { @ code BufferedImage }
* @ throws MagickException if an exception occurs during convers... | // As there is no way to get the binary representation of the image ,
// convert to gray , and the create a binary image from it
BufferedImage temp = grayToBuffered ( pImage , false ) ; BufferedImage image = new BufferedImage ( temp . getWidth ( ) , temp . getHeight ( ) , BufferedImage . TYPE_BYTE_BINARY , CM_MONOCHROM... |
public class Codecs { /** * Return a scala { @ code Codec } with the given allele { @ link Supplier } ,
* allele { @ code validator } and { @ code Chromosome } length . The
* { @ code supplier } is responsible for creating new random alleles , and the
* { @ code validator } can verify it .
* @ param < A > the a... | return ofVector ( supplier , validator , Predicates . < ISeq < A > > True ( ) , length ) ; |
public class Connector { /** * Create a name from the given namespace URI and local name . This is equivalent to calling "
* < code > factories ( ) . getNameFactory ( ) . create ( namespaceUri , localName ) < / code > " , and is simply provided for convenience .
* @ param namespaceUri the namespace URI
* @ param ... | return factories ( ) . getNameFactory ( ) . create ( namespaceUri , localName ) ; |
public class JMatrix { /** * Finds all eigenvalues of an upper Hessenberg matrix A [ 0 . . n - 1 ] [ 0 . . n - 1 ] .
* On input A can be exactly as output from elmhes and eltran . On output , d and e
* contain the eigenvalues of A , while V is a matrix whose columns contain
* the corresponding eigenvectors . The ... | int n = A . nrows ( ) ; int nn , m , l , k , j , its , i , mmin , na ; double z = 0.0 , y , x , w , v , u , t , s = 0.0 , r = 0.0 , q = 0.0 , p = 0.0 , anorm = 0.0 , ra , sa , vr , vi ; for ( i = 0 ; i < n ; i ++ ) { for ( j = Math . max ( i - 1 , 0 ) ; j < n ; j ++ ) { anorm += Math . abs ( A . get ( i , j ) ) ; } } n... |
public class Disjunction { /** * Adds all assertions for the given IDisjunct to this disjunction . */
public Disjunction add ( IDisjunct disjunct ) { } } | for ( Iterator < IAssertion > assertions = disjunct . getAssertions ( ) ; assertions . hasNext ( ) ; ) { add ( assertions . next ( ) ) ; } return this ; |
public class EventHubConnectionsInner { /** * Checks that the Event Hub data connection parameters are valid .
* @ param resourceGroupName The name of the resource group containing the Kusto cluster .
* @ param clusterName The name of the Kusto cluster .
* @ param databaseName The name of the database in the Kust... | return eventhubConnectionValidationWithServiceResponseAsync ( resourceGroupName , clusterName , databaseName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class Histogram3D { /** * Generate the frequency table . */
private void init ( double [ ] [ ] data , int xbins , int ybins , boolean prob ) { } } | // Generate the histogram .
if ( data . length == 0 ) { throw new IllegalArgumentException ( "array is empty." ) ; } if ( data [ 0 ] . length != 2 ) { throw new IllegalArgumentException ( "dimension is not 2." ) ; } double xmin = data [ 0 ] [ 0 ] ; double xmax = data [ 0 ] [ 0 ] ; double ymin = data [ 0 ] [ 1 ] ; doubl... |
public class ApiOvhEmailmxplan { /** * Accounts associated to this mxplan service
* REST : GET / email / mxplan / { service } / account
* @ param id [ required ] Filter the value of id property ( like )
* @ param primaryEmailAddress [ required ] Filter the value of primaryEmailAddress property ( like )
* @ para... | String qPath = "/email/mxplan/{service}/account" ; StringBuilder sb = path ( qPath , service ) ; query ( sb , "id" , id ) ; query ( sb , "primaryEmailAddress" , primaryEmailAddress ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t1 ) ; |
public class JQMListItem { /** * Sets the transition to be used by this list item when loading the URL . */
@ Override public void setTransition ( Transition transition ) { } } | if ( anchor == null ) { if ( transition != null ) { setUrl ( "#" ) ; } else { return ; } } if ( anchor != null ) JQMCommon . setTransition ( anchor , transition ) ; |
public class MapTransitionExtractor { /** * Get the tile transition with one group only .
* @ param groups The groups ( must contain one group ) .
* @ return The tile transition . */
private static Transition getTransitionSingleGroup ( Collection < String > groups ) { } } | final Iterator < String > iterator = groups . iterator ( ) ; final String group = iterator . next ( ) ; return new Transition ( TransitionType . CENTER , group , group ) ; |
public class FileAuditHandler { /** * Checks for disk access .
* @ param path
* the path
* @ return true , if successful */
static boolean hasDiskAccess ( final String path ) { } } | try { AccessController . checkPermission ( new FilePermission ( path , "read,write" ) ) ; return true ; } catch ( AccessControlException e ) { return false ; } |
public class RandomAccessFile { /** * Reads { @ code byteCount } bytes from this stream and stores them in the byte
* array { @ code dst } starting at { @ code offset } . If { @ code byteCount } is zero , then this
* method returns without reading any bytes . Otherwise , this method blocks until
* { @ code byteCo... | Arrays . checkOffsetAndCount ( dst . length , offset , byteCount ) ; while ( byteCount > 0 ) { int result = read ( dst , offset , byteCount ) ; if ( result < 0 ) { throw new EOFException ( ) ; } offset += result ; byteCount -= result ; } |
public class BaseDfuImpl { /** * Requests given MTU . This method is only supported on Android Lollipop or newer versions .
* Only DFU from SDK 14.1 or newer supports MTU > 23.
* @ param mtu new MTU to be requested . */
@ RequiresApi ( api = Build . VERSION_CODES . LOLLIPOP ) void requestMtu ( @ IntRange ( from = 0... | if ( mAborted ) throw new UploadAbortedException ( ) ; mRequestCompleted = false ; mService . sendLogBroadcast ( DfuBaseService . LOG_LEVEL_VERBOSE , "Requesting new MTU..." ) ; mService . sendLogBroadcast ( DfuBaseService . LOG_LEVEL_DEBUG , "gatt.requestMtu(" + mtu + ")" ) ; if ( ! mGatt . requestMtu ( mtu ) ) return... |
public class CFIRGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . CFIRG__FCS_NAME : setFCSName ( FCS_NAME_EDEFAULT ) ; return ; case AfplibPackage . CFIRG__CP_NAME : setCPName ( CP_NAME_EDEFAULT ) ; return ; case AfplibPackage . CFIRG__SV_SIZE : setSVSize ( SV_SIZE_EDEFAULT ) ; return ; case AfplibPackage . CFIRG__SH_SCALE : setSHScale ( SH... |
public class DescribeAssessmentTemplatesRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeAssessmentTemplatesRequest describeAssessmentTemplatesRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeAssessmentTemplatesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeAssessmentTemplatesRequest . getAssessmentTemplateArns ( ) , ASSESSMENTTEMPLATEARNS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientE... |
public class AbstractRegexParser { /** * Regex Patterns */
private Pattern findingSteps ( ) { } } | String initialStartingWords = concatenateInitialStartingWords ( ) ; String followingStartingWords = concatenateFollowingStartingWords ( ) ; return compile ( "((" + initialStartingWords + ")\\s(.)*?)\\s*(\\Z|" + followingStartingWords + "|\\n" + keywords ( ) . examplesTable ( ) + ")" , DOTALL ) ; |
public class TfIdf { /** * 一系列文档的倒排词频
* @ param documentVocabularies 词表
* @ param smooth 平滑参数 , 视作额外有一个文档 , 该文档含有smooth个每个词语
* @ param addOne tf - idf加一平滑
* @ param < TERM > 词语类型
* @ return 一个词语 - > 倒排文档的Map */
public static < TERM > Map < TERM , Double > idf ( Iterable < Iterable < TERM > > documentVocabular... | Map < TERM , Integer > df = new HashMap < TERM , Integer > ( ) ; int d = smooth ? 1 : 0 ; int a = addOne ? 1 : 0 ; int n = d ; for ( Iterable < TERM > documentVocabulary : documentVocabularies ) { n += 1 ; for ( TERM term : documentVocabulary ) { Integer t = df . get ( term ) ; if ( t == null ) t = d ; df . put ( term ... |
public class ObjectInputStream { /** * Reads the persistent fields of the object that is currently being read
* from the source stream . The values read are stored in a GetField object
* that provides access to the persistent fields . This GetField object is
* then returned .
* @ return the GetField object from... | if ( currentObject == null ) { throw new NotActiveException ( ) ; } EmulatedFieldsForLoading result = new EmulatedFieldsForLoading ( currentClass ) ; readFieldValues ( result ) ; return result ; |
public class ModuleImpl { /** * For any extra modules specified by { @ code cacheEntry } , obtain a build
* future from the module cache manager and add it to the { @ link ModuleBuildReader }
* specified by { @ code reader } .
* @ param reader
* the { @ link ModuleBuildReader } to add the extra modules to
* @... | List < String > extraModules = cacheEntry . getExtraModules ( ) ; if ( ! extraModules . isEmpty ( ) ) { IAggregator aggr = ( IAggregator ) request . getAttribute ( IAggregator . AGGREGATOR_REQATTRNAME ) ; IConfig config = aggr . getConfig ( ) ; for ( String mid : cacheEntry . getExtraModules ( ) ) { ModuleIdentifier id... |
public class FileBytes { /** * Allocates a randomAccessFile buffer .
* If the underlying randomAccessFile is empty , the randomAccessFile count will expand dynamically as bytes are written to the randomAccessFile .
* @ param file The randomAccessFile to allocate .
* @ param mode The mode in which to open the unde... | return new FileBytes ( file , mode , Memory . Util . toPow2 ( size ) ) ; |
public class MiniSatStyleSolver { /** * Compares two variables by their activity .
* @ param x the first variable
* @ param y the second variable
* @ return { @ code true } if the first variable ' s activity is larger then the second one ' s */
public boolean lt ( int x , int y ) { } } | return this . vars . get ( x ) . activity ( ) > this . vars . get ( y ) . activity ( ) ; |
public class MonthView { /** * Sets all the parameters for displaying this week . The only required
* parameter is the week number . Other parameters have a default value and
* will only update if a new value is included , except for focus month ,
* which will always default to no focus month if no value is passe... | if ( month == - 1 && year == - 1 ) { throw new InvalidParameterException ( "You must specify month and year for this view" ) ; } mSelectedDay = selectedDay ; // Allocate space for caching the day numbers and focus values
mMonth = month ; mYear = year ; // Figure out what day today is
// final Time today = new Time ( Ti... |
public class ServerConnectionPoliciesInner { /** * Creates or updates the server ' s connection policy .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverName The name of the server .... | if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( serverN... |
public class ServerKeysInner { /** * Gets a list of server keys .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; ServerKeyInner & gt ; object */... | return listByServerNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < ServerKeyInner > > , Page < ServerKeyInner > > ( ) { @ Override public Page < ServerKeyInner > call ( ServiceResponse < Page < ServerKeyInner > > response ) { return response . body ( ) ; } } ) ; |
public class ShardingTransactionManagerEngine { /** * Initialize sharding transaction managers .
* @ param databaseType database type
* @ param dataSourceMap data source map */
public void init ( final DatabaseType databaseType , final Map < String , DataSource > dataSourceMap ) { } } | for ( Entry < TransactionType , ShardingTransactionManager > entry : transactionManagerMap . entrySet ( ) ) { entry . getValue ( ) . init ( databaseType , getResourceDataSources ( dataSourceMap ) ) ; } |
public class AjaxInterceptor { /** * Check if process this trigger only .
* @ param triggerWithContext the trigger with its context
* @ param operation current ajax operation
* @ return true if process this trigger only */
private boolean isProcessTriggerOnly ( final ComponentWithContext triggerWithContext , fina... | // Target container implies only process the trigger or is Internal Ajax
if ( operation . getTargetContainerId ( ) != null || operation . isInternalAjaxRequest ( ) ) { return true ; } WComponent trigger = triggerWithContext . getComponent ( ) ; // Check if trigger is a polling AJAX control
if ( trigger instanceof WAjax... |
public class Points { /** * Returns the squared Euclidian distance between the specified two points . */
public static int distanceSq ( int x1 , int y1 , int x2 , int y2 ) { } } | x2 -= x1 ; y2 -= y1 ; return x2 * x2 + y2 * y2 ; |
public class XESLogParser { /** * Parses the specified log file and returns a collection of processes .
* @ param inputStream
* { @ link InputStream } to parse
* @ param parsingMode
* @ return Collection of processes , which consist of a collection of instances , which again consist of a collection of { @ link ... | try { inputStream . available ( ) ; } catch ( IOException e ) { throw new ParameterException ( "Unable to read input file: " + e . getMessage ( ) ) ; } Collection < XLog > logs = null ; XParser parser = ParserFileFormat . XES . getParser ( ) ; try { logs = parser . parse ( inputStream ) ; } catch ( Exception e ) { thro... |
public class Tensor { /** * Divides the value from the idx ' th entry . */
public void divideValue ( int idx , double val ) { } } | values [ idx ] = s . divide ( values [ idx ] , val ) ; |
public class GVRPlaneEmitter { /** * Generate random time stamps from the current time upto the next one second .
* Passed as texture coordinates to the vertex shader , an unused field is present
* with every pair passed .
* @ param totalTime
* @ return */
private float [ ] generateParticleTimeStamps ( float to... | float timeStamps [ ] = new float [ mEmitRate * 2 ] ; for ( int i = 0 ; i < mEmitRate * 2 ; i += 2 ) { timeStamps [ i ] = totalTime + mRandom . nextFloat ( ) ; timeStamps [ i + 1 ] = 0 ; } return timeStamps ; |
public class ExcelSerde { /** * Initializes the SerDe \ n
* You can define in the table properties ( additionally to the standard Hive properties ) the following options \ n
* office . hive . write . defaultSheetName : The sheetname to which data should be written ( note : as an input any sheets can be read or sele... | LOG . debug ( "Initializing Excel Hive Serde" ) ; LOG . debug ( "Configuring Hive-only options" ) ; // configure hadoopoffice specific hive options
String defaultSheetNameStr = prop . getProperty ( ExcelSerde . CONF_DEFAULTSHEETNAME ) ; if ( defaultSheetNameStr != null ) { this . defaultSheetName = defaultSheetNameStr ... |
public class base { /** * Binary exponentiation algorithm .
* @ param b the base number .
* @ param e the exponent .
* @ return { @ code b ^ e } . */
public static long pow ( final long b , final long e ) { } } | long base = b ; long exp = e ; long result = 1 ; while ( exp != 0 ) { if ( ( exp & 1 ) != 0 ) { result *= base ; } exp >>>= 1 ; base *= base ; } return result ; |
public class Static { /** * Converts the given iterable to a { @ link List } . Note : traversing the iterable may destroy the original .
* @ param iterable The iterable
* @ param < T > The base type of the iterable
* @ return A list that contains the elements of the given iterable */
public static < T > List < T ... | List < T > result = new ArrayList < > ( ) ; for ( T item : iterable ) { result . add ( item ) ; } return result ; |
public class InternalFedoraBinary { /** * Retrieve the JCR Binary object
* @ return a JCR - wrapped Binary object */
private javax . jcr . Binary getBinaryContent ( ) { } } | try { return getProperty ( JCR_DATA ) . getBinary ( ) ; } catch ( final PathNotFoundException e ) { throw new PathNotFoundRuntimeException ( e ) ; } catch ( final RepositoryException e ) { throw new RepositoryRuntimeException ( e ) ; } |
public class Util { /** * decode bytes from an input stream into Mikrotik protocol sentences */
private static void decode ( InputStream in , StringBuilder result ) throws ApiDataException , ApiConnectionException { } } | try { int len = readLen ( in ) ; if ( len > 0 ) { byte buf [ ] = new byte [ len ] ; for ( int i = 0 ; i < len ; ++ i ) { int c = in . read ( ) ; if ( c < 0 ) { throw new ApiDataException ( "Truncated data. Expected to read more bytes" ) ; } buf [ i ] = ( byte ) ( c & 0xFF ) ; } String res = new String ( buf , Charset .... |
public class LeaderRetrievalUtils { /** * Retrieves the leader akka url and the current leader session ID . The values are stored in a
* { @ link LeaderConnectionInfo } instance .
* @ param leaderRetrievalService Leader retrieval service to retrieve the leader connection
* information
* @ param timeout Timeout ... | LeaderConnectionInfoListener listener = new LeaderConnectionInfoListener ( ) ; try { leaderRetrievalService . start ( listener ) ; Future < LeaderConnectionInfo > connectionInfoFuture = listener . getLeaderConnectionInfoFuture ( ) ; return Await . result ( connectionInfoFuture , timeout ) ; } catch ( Exception e ) { th... |
public class PactDslJsonArray { /** * Attribute that must be equal to the provided value .
* @ param value Value that will be used for comparisons */
public PactDslJsonArray equalsTo ( Object value ) { } } | body . put ( value ) ; matchers . addRule ( rootPath + appendArrayIndex ( 0 ) , EqualsMatcher . INSTANCE ) ; return this ; |
public class CmsCategoryTree { /** * Updates the content of the categories list . < p >
* @ param treeItemsToShow the updates list of categories tree item beans */
public void updateContentList ( List < CmsTreeItem > treeItemsToShow ) { } } | m_scrollList . clearList ( ) ; if ( ( treeItemsToShow != null ) && ! treeItemsToShow . isEmpty ( ) ) { for ( CmsTreeItem dataValue : treeItemsToShow ) { dataValue . removeOpener ( ) ; m_scrollList . add ( dataValue ) ; CmsScrollPanel scrollparent = ( CmsScrollPanel ) m_scrollList . getParent ( ) ; scrollparent . onResi... |
public class MavenJDOMWriter { /** * Method updateModelBase .
* @ param value
* @ param element
* @ param counter
* @ param xmlTag */
protected void updateModelBase ( ModelBase value , String xmlTag , Counter counter , Element element ) { } } | boolean shouldExist = value != null ; Element root = updateElement ( counter , element , xmlTag , shouldExist ) ; if ( shouldExist ) { Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleLists ( innerCount , root , value . getModules ( ) , "modules" , "module" ) ; iterateRepository ( i... |
public class OjbTagsHandler { /** * Returns the value of a property of the current object on the specified level .
* @ param attributes The attributes of the tag
* @ return The property value
* @ exception XDocletException If an error occurs
* @ doc . tag type = " content "
* @ doc . param name = " level " op... | String value = getPropertyValue ( attributes . getProperty ( ATTRIBUTE_LEVEL ) , attributes . getProperty ( ATTRIBUTE_NAME ) ) ; if ( value == null ) { value = attributes . getProperty ( ATTRIBUTE_DEFAULT ) ; } return value ; |
public class authenticationvserver_stats { /** * Use this API to fetch statistics of authenticationvserver _ stats resource of given name . */
public static authenticationvserver_stats get ( nitro_service service , String name ) throws Exception { } } | authenticationvserver_stats obj = new authenticationvserver_stats ( ) ; obj . set_name ( name ) ; authenticationvserver_stats response = ( authenticationvserver_stats ) obj . stat_resource ( service ) ; return response ; |
public class Heritrix3Wrapper { /** * TODO
* @ param tries
* @ param interval
* @ return engine state and a list of registered jobs */
public EngineResult waitForEngineReady ( int tries , int interval ) { } } | EngineResult engineResult = null ; if ( tries <= 0 ) { tries = 1 ; } if ( interval <= 99 ) { interval = 1000 ; } boolean bLoop = true ; while ( bLoop && tries > 0 ) { engineResult = rescanJobDirectory ( ) ; // debug
// System . out . println ( engineResult . status + " - " + ResultStatus . OK ) ;
if ( engineResult . st... |
public class Application { /** * If no calls have been made to < code > addELContextListener ( javax . el . ELContextListener ) < / code > , this method must
* return an empty array
* Otherwise , return an array representing the list of listeners added by calls to
* < code > addELContextListener ( javax . el . EL... | Application application = getMyfacesApplicationInstance ( ) ; if ( application != null ) { return application . getELContextListeners ( ) ; } throw new UnsupportedOperationException ( ) ; |
public class ValueMapImpl { /** * Add a MapItemValue to the map .
* @ param miv map value item . */
@ Override public void add ( MapItemValue miv ) { } } | if ( len >= items . length ) { items = Arry . grow ( items ) ; } items [ len ] = miv ; len ++ ; |
public class ElasticsearchEmbeddedNode { /** * This method closes the elasticsearch node . */
public void close ( ) { } } | if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "Close Elasticsearch node=" + node + " client=" + client ) ; } if ( client != null ) { client . close ( ) ; client = null ; } if ( node != null ) { node . stop ( ) ; node = null ; } |
public class BoxCollaborationWhitelist { /** * Creates a new Collaboration Whitelist for a domain .
* @ param api the API connection to be used by the resource .
* @ param domain the domain to be added to a collaboration whitelist for a Box Enterprise .
* @ param direction an enum representing the direction of th... | URL url = COLLABORATION_WHITELIST_ENTRIES_URL_TEMPLATE . build ( api . getBaseURL ( ) ) ; BoxJSONRequest request = new BoxJSONRequest ( api , url , HttpMethod . POST ) ; JsonObject requestJSON = new JsonObject ( ) . add ( "domain" , domain ) . add ( "direction" , direction . toString ( ) ) ; request . setBody ( request... |
public class WebSocketHandlerAdapter { /** * Send authorize token to the Gateway */
@ Override public synchronized void processAuthorize ( WebSocketChannel channel , String authorizeToken ) { } } | nextHandler . processAuthorize ( channel , authorizeToken ) ; |
public class Handler { /** * Updatable */
@ Override public void update ( double extrp ) { } } | updateRemove ( ) ; updateAdd ( ) ; for ( final ComponentUpdater component : updaters ) { component . update ( extrp , featurables ) ; } |
public class Region { /** * Finds a region based on a label or name .
* A region name is lower - cased label with spaces removed .
* @ param labelOrName the region name or label
* @ return the found region or null if there ' s no such region */
public static Region findByLabelOrName ( String labelOrName ) { } } | if ( labelOrName == null ) { return null ; } return VALUES_BY_NAME . get ( labelOrName . toLowerCase ( ) . replace ( " " , "" ) ) ; |
public class NodeTraversal { /** * Returns the current scope ' s root . */
public Node getScopeRoot ( ) { } } | int roots = scopeRoots . size ( ) ; if ( roots > 0 ) { return scopeRoots . get ( roots - 1 ) ; } else { AbstractScope < ? , ? > s = scopes . peek ( ) ; return s != null ? s . getRootNode ( ) : null ; } |
public class UriMapping { /** * Creates a UriMapping instance based on the mapping definition given as parameter .
* Mapping is split in 3 parts :
* < ul >
* < li > Host , including the scheme and port : http : / / www . example : 8080 < / li >
* < li > path , left part before the wildcard caracter * < / li >
... | Matcher matcher = MAPPING_PATTERN . matcher ( mapping ) ; if ( ! matcher . matches ( ) ) { throw new ConfigurationException ( "Unrecognized URI pattern: " + mapping ) ; } String host = StringUtils . trimToNull ( matcher . group ( 1 ) ) ; String path = StringUtils . trimToNull ( matcher . group ( 5 ) ) ; if ( path != nu... |
public class LocalisationManager { /** * Method updateQueuePointOutputHandler .
* @ param outputHandler
* < p > Add the outputHandler to the set of queuePointOutputHanders < / p > */
public void updateQueuePointOutputHandler ( SIBUuid8 newLocalisingMEUuid , OutputHandler outputHandler , SIBUuid8 existingUuid ) { } ... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "updateQueuePointOutputHandler" , new Object [ ] { newLocalisingMEUuid , outputHandler , existingUuid } ) ; synchronized ( _queuePointOutputHandlers ) { _queuePointOutputHandlers . remove ( existingUuid ) ; _queuePointOutput... |
public class Misc { /** * Loads a file into memory from the classpath */
public static File getResourceAsFile ( String resource ) { } } | ClassLoader cl = Thread . currentThread ( ) . getContextClassLoader ( ) ; try { return new File ( URLDecoder . decode ( cl . getResource ( resource ) . getFile ( ) , "UTF-8" ) ) ; } catch ( UnsupportedEncodingException uee ) { return null ; } |
public class AccountsInner { /** * Updates a Cognitive Services account .
* @ param resourceGroupName The name of the resource group within the user ' s subscription .
* @ param accountName The name of Cognitive Services account .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ ... | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( accountName == null ) { throw new IllegalArgumentException ( "Parameter accountName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { ... |
public class Lists { /** * Returns the length of the longest trailing partial sublist of the
* target list within the specified source list , or 0 if there is no such
* occurrence . More formally , returns the length < tt > i < / tt >
* such that
* { @ code source . subList ( source . size ( ) - i , source . si... | final int s = source . size ( ) - 1 ; final int t = target . size ( ) - 1 ; int l = 0 ; while ( l <= s && l <= t && source . get ( s - l ) . equals ( target . get ( t - l ) ) ) { l ++ ; } return l ; |
public class EvaluatorRegistry { /** * Returns the evaluator instance for the given type and the
* defined parameterText
* @ param type the type of the attributes this evaluator will
* operate on . This is important because the evaluator
* may do optimizations and type coercion based on the
* types it is eval... | return this . getEvaluatorDefinition ( operator ) . getEvaluator ( type , operator ) ; |
public class UriComponentsBuilder { /** * Returns a builder that is initialized with the given { @ code URI } .
* @ param uri the URI to initialize with
* @ return the new { @ code UriComponentsBuilder } */
public static UriComponentsBuilder fromUri ( URI uri ) { } } | UriComponentsBuilder builder = new UriComponentsBuilder ( ) ; builder . uri ( uri ) ; return builder ; |
public class Orders { /** * 构建查询订单参数
* @ param queryParams 查询参数 */
private void buildQueryParams ( Map < String , String > queryParams ) { } } | buildConfigParams ( queryParams ) ; put ( queryParams , WepayField . NONCE_STR , RandomStrs . generate ( 16 ) ) ; buildSignParams ( queryParams ) ; |
public class NeuralNetwork { /** * Returns the activation function of output layer based on natural pairing .
* @ param error the error function .
* @ param k the number of output nodes .
* @ return the activation function of output layer based on natural pairing */
private static ActivationFunction natural ( Err... | if ( error == ErrorFunction . CROSS_ENTROPY ) { if ( k == 1 ) { return ActivationFunction . LOGISTIC_SIGMOID ; } else { return ActivationFunction . SOFTMAX ; } } else { return ActivationFunction . LOGISTIC_SIGMOID ; } |
public class Branch { /** * Branch collect the URLs in the incoming intent for better attribution . Branch SDK extensively check for any sensitive data in the URL and skip if exist .
* However the following method provisions application to set SDK to collect only URLs in particular form . This method allow applicatio... | if ( urlWhiteListPattern != null ) { UniversalResourceAnalyser . getInstance ( context_ ) . addToAcceptURLFormats ( urlWhiteListPattern ) ; } return this ; |
public class Assert2 { /** * Asserts that every file that exists relative to expected also exists
* relative to actual .
* @ param expected the expected path
* @ param actual the actual path
* @ throws IOException if the paths cannot be walked */
public static void containsAll ( final Path expected , final Path... | final Assertion < Path > exists = existsIn ( expected , actual ) ; if ( Files . exists ( expected ) ) { walkFileTree ( expected , new SimpleFileVisitor < Path > ( ) { @ Override public FileVisitResult visitFile ( final Path file , final BasicFileAttributes attrs ) throws IOException { assertThat ( file , exists ) ; ret... |
public class Dictionaries { /** * Load the dictionaries .
* @ param inputDir
* the input directory
* @ throws IOException
* throws an exception if directory does not exist */
private void loadDictionaries ( final String inputDir ) throws IOException { } } | final List < File > fileList = StringUtils . getFilesInDir ( new File ( inputDir ) ) ; dictNames = new ArrayList < String > ( fileList . size ( ) ) ; dictionaries = new ArrayList < Map < String , String > > ( fileList . size ( ) ) ; dictionariesIgnoreCase = new ArrayList < Map < String , String > > ( fileList . size ( ... |
public class RdKNNTree { /** * Performs necessary operations before inserting the specified entry .
* @ param entry the entry to be inserted */
@ Override protected void preInsert ( RdKNNEntry entry ) { } } | KNNHeap knns_o = DBIDUtil . newHeap ( settings . k_max ) ; preInsert ( entry , getRootEntry ( ) , knns_o ) ; |
public class TryWithResourcesASTTransformation { /** * # primaryExc . addSuppressed ( # suppressedExc ) ; */
private ExpressionStatement createAddSuppressedStatement ( String primaryExcName , String suppressedExcName ) { } } | MethodCallExpression addSuppressedMethodCallExpression = new MethodCallExpression ( new VariableExpression ( primaryExcName ) , "addSuppressed" , new ArgumentListExpression ( Collections . singletonList ( new VariableExpression ( suppressedExcName ) ) ) ) ; addSuppressedMethodCallExpression . setImplicitThis ( false ) ... |
public class Events { /** * Creates a network event with the source set to the object passed in as
* parameter and the { @ link DeliveryGuaranty } set to the incoming
* parameter .
* @ param source
* The payload of the event . This is the actual data that gets
* transmitted to remote machine .
* @ param del... | Event event = event ( source , Events . NETWORK_MESSAGE ) ; NetworkEvent networkEvent = new DefaultNetworkEvent ( event ) ; networkEvent . setDeliveryGuaranty ( deliveryGuaranty ) ; return networkEvent ; |
public class InjectorImpl { /** * / * ( non - Javadoc )
* @ see org . jboss . arquillian . api . Injector # inject ( java . lang . Object ) */
@ Override public < T > T inject ( T target ) { } } | Validate . notNull ( target , "Target must be specified." ) ; manager . inject ( target ) ; return target ; |
public class LineManager { /** * Set the LineTranslateAnchor property
* Controls the frame of reference for { @ link PropertyFactory # lineTranslate } .
* @ param value property wrapper value around String */
public void setLineTranslateAnchor ( @ Property . LINE_TRANSLATE_ANCHOR String value ) { } } | PropertyValue propertyValue = lineTranslateAnchor ( value ) ; constantPropertyUsageMap . put ( PROPERTY_LINE_TRANSLATE_ANCHOR , propertyValue ) ; layer . setProperties ( propertyValue ) ; |
public class Get { /** * Executes a getter ( < tt > getX ( ) < / tt > ) on the target object which returns String [ ] .
* If the specified attribute is , for example , " < tt > name < / tt > " , the called method
* will be " < tt > getName ( ) < / tt > " .
* @ param attributeName the name of the attribute
* @ r... | return new Get < Object , String [ ] > ( Types . ARRAY_OF_STRING , attributeName ) ; |
public class AgentPremain { /** * Print the start message to System . err with the time NOW , and register a
* shutdown hook which will print the stop message to System . err with the
* time then and the number of milliseconds passed since . */
private static void printStartStopTimes ( ) { } } | final long start = System . currentTimeMillis ( ) ; System . err . println ( "Start at " + new Date ( ) ) ; Thread hook = new Thread ( ) { @ Override public void run ( ) { long timePassed = System . currentTimeMillis ( ) - start ; System . err . println ( "Stop at " + new Date ( ) + ", execution time = " + timePassed +... |
public class GetUserLists { /** * Usage : java twitter4j . examples . list . GetUserLists [ list owner screen name ]
* @ param args message */
public static void main ( String [ ] args ) { } } | if ( args . length < 1 ) { System . out . println ( "Usage: java twitter4j.examples.list.GetUserLists [list owner screen name]" ) ; System . exit ( - 1 ) ; } try { Twitter twitter = new TwitterFactory ( ) . getInstance ( ) ; ResponseList < UserList > lists = twitter . getUserLists ( args [ 0 ] ) ; for ( UserList list :... |
public class ESigService { /** * Removes the item of the specified type and id from the list .
* @ param esigType The esig type .
* @ param id The unique id . */
@ Override public void remove ( IESigType esigType , String id ) { } } | eSigList . remove ( esigType , id ) ; |
public class Utils { /** * Checks whether the given tuples specify a valid range for a sub - array
* of an array with the given parent size , and throws an
* < code > IllegalArgumentException < / code > if not .
* @ param parentSize The parent size
* @ param fromIndices The start indices , inclusive
* @ param... | if ( fromIndices . getSize ( ) != parentSize . getSize ( ) ) { throw new IllegalArgumentException ( "Parent is " + parentSize . getSize ( ) + "-dimensional, " + "but fromIndices is " + fromIndices . getSize ( ) + "-dimensional" ) ; } if ( toIndices . getSize ( ) != parentSize . getSize ( ) ) { throw new IllegalArgument... |
public class NarUtil { /** * Returns the header file name ( javah ) corresponding to the given class file
* name
* @ param filename
* the absolute file name of the class
* @ return the header file name . */
public static String getHeaderName ( final String basename , final String filename ) { } } | final String base = basename . replaceAll ( "\\\\" , "/" ) ; final String file = filename . replaceAll ( "\\\\" , "/" ) ; if ( ! file . startsWith ( base ) ) { throw new IllegalArgumentException ( "Error " + file + " does not start with " + base ) ; } String header = file . substring ( base . length ( ) + 1 ) ; header ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.