signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CellFinder { /** * 起点なる位置を指定する 。 * @ param address セルのアドレス * @ return 自身のインスタンス 。 メソッドチェーンとして続ける 。 * @ throws NullPointerException { @ literal address = = null . } */ public CellFinder startPosition ( final CellPosition address ) { } }
ArgUtils . notNull ( address , "address" ) ; return startPosition ( address . getColumn ( ) , address . getRow ( ) ) ;
public class ERiCNeighborPredicate { /** * Full instantiation interface . * @ param database Database * @ param relation Relation * @ return Instance */ public Instance instantiate ( Database database , Relation < V > relation ) { } }
DistanceQuery < V > dq = database . getDistanceQuery ( relation , EuclideanDistanceFunction . STATIC ) ; KNNQuery < V > knnq = database . getKNNQuery ( dq , settings . k ) ; WritableDataStore < PCAFilteredResult > storage = DataStoreUtil . makeStorage ( relation . getDBIDs ( ) , DataStoreFactory . HINT_HOT | DataStoreF...
public class ApiOvhCloud { /** * Usage information on your project * REST : GET / cloud / project / { serviceName } / usage / history * @ param from [ required ] Filter results having date superior to from * @ param serviceName [ required ] Service name * @ param to [ required ] Filter results having date infer...
String qPath = "/cloud/project/{serviceName}/usage/history" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "from" , from ) ; query ( sb , "to" , to ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t20 ) ;
public class SqlContextImpl { /** * { @ inheritDoc } * @ see jp . co . future . uroborosql . parser . TransformContext # getParam ( java . lang . String ) */ @ Override public Parameter getParam ( final String paramName ) { } }
Parameter param = getBindParameter ( paramName ) ; if ( param == null ) { Map < String , Parameter > constParams = getConstParameterMap ( ) ; if ( constParams != null ) { param = constParams . get ( paramName . toUpperCase ( ) ) ; } } return param ;
public class EventhubDataWriter { /** * A signature which contains the duration . * After the duration is expired , the signature becomes invalid */ public void refreshSignature ( ) { } }
if ( postStartTimestamp == 0 || ( System . nanoTime ( ) - postStartTimestamp ) > Duration . ofMinutes ( sigExpireInMinute ) . toNanos ( ) ) { // generate signature try { signature = SharedAccessSignatureTokenProvider . generateSharedAccessSignature ( sasKeyName , sasKey , namespaceName , Duration . ofMinutes ( sigExpir...
public class IOUtil { /** * Writing the specified contents to the specified OutputStream using an internal buffer . Flushing the stream when * completed . Caller is responsible for opening and closing the specified stream . * @ param output * The OutputStream * @ param content * The content to write to the sp...
final int size = 4096 ; int offset = 0 ; while ( content . length - offset > size ) { output . write ( content , offset , size ) ; offset += size ; } output . write ( content , offset , content . length - offset ) ; output . flush ( ) ;
public class ProxyUtil { /** * Creates a { @ link Proxy } of the given { @ code proxyInterface } * that uses the given { @ link JsonRpcClient } . * @ param < T > the proxy type * @ param classLoader the { @ link ClassLoader } * @ param proxyInterface the interface to proxy * @ param client the { @ link JsonRp...
return createClientProxy ( classLoader , proxyInterface , client , socket . getInputStream ( ) , socket . getOutputStream ( ) ) ;
public class Base64Serializer { /** * Deserialze base 64 encoded string data to Object . */ public Object deserialize ( String data ) { } }
if ( ( data == null ) || ( data . length ( ) == 0 ) ) { return null ; } ObjectInputStream ois = null ; ByteArrayInputStream bis = null ; try { bis = new ByteArrayInputStream ( Base64 . decodeBase64 ( data . getBytes ( ) ) ) ; ois = new ObjectInputStream ( bis ) ; return ois . readObject ( ) ; } catch ( ClassNotFoundExc...
public class Op { /** * Creates an < i > operation expression < / i > on the specified target object . * @ param target the target object on which the expression will execute * @ return an operator , ready for chaining */ public static < T > Level0ListOperator < List < T > , T > onList ( final List < T > target ) {...
return new Level0ListOperator < List < T > , T > ( ExecutionTarget . forOp ( target , Normalisation . LIST ) ) ;
public class CheckTypeQualifiers { /** * ( non - Javadoc ) * @ see * edu . umd . cs . findbugs . bcel . CFGDetector # visitClass ( edu . umd . cs . findbugs . classfile * . ClassDescriptor ) */ @ Override public void visitClass ( ClassDescriptor classDescriptor ) throws CheckedAnalysisException { } }
if ( ! checked ) { checked = true ; Collection < TypeQualifierValue < ? > > allKnownTypeQualifiers = TypeQualifierValue . getAllKnownTypeQualifiers ( ) ; int size = allKnownTypeQualifiers . size ( ) ; if ( size == 1 ) { TypeQualifierValue < ? > value = Util . first ( allKnownTypeQualifiers ) ; if ( ! value . typeQualif...
public class ForeignKeyConstraint { /** * creates a single - attribute foreign key * @ param name * @ param attribute * @ param reference * @ return */ public static ForeignKeyConstraint of ( String name , Attribute attribute , Attribute reference ) { } }
return new Builder ( ( DatabaseRelationDefinition ) attribute . getRelation ( ) , ( DatabaseRelationDefinition ) reference . getRelation ( ) ) . add ( attribute , reference ) . build ( name ) ;
public class Util { /** * Replaces any occurnace of the specified " oldChar " with the nes string . * This is used to replace occurances if ' $ ' in corba names since ' $ ' is a special character */ private static String replace ( String source , char oldChar , String newString ) { } }
StringBuilder StringBuilder = new StringBuilder ( source . length ( ) ) ; for ( int i = 0 ; i < source . length ( ) ; i ++ ) { char c = source . charAt ( i ) ; if ( c == oldChar ) { StringBuilder . append ( newString ) ; } else { StringBuilder . append ( c ) ; } } return StringBuilder . toString ( ) ;
public class cachepolicy_binding { /** * Use this API to fetch cachepolicy _ binding resource of given name . */ public static cachepolicy_binding get ( nitro_service service , String policyname ) throws Exception { } }
cachepolicy_binding obj = new cachepolicy_binding ( ) ; obj . set_policyname ( policyname ) ; cachepolicy_binding response = ( cachepolicy_binding ) obj . get_resource ( service ) ; return response ;
public class CacheableWorkspaceDataManager { /** * Initialization remote commands . */ private void initRemoteCommands ( ) { } }
if ( rpcService != null ) { // register commands suspend = rpcService . registerCommand ( new RemoteCommand ( ) { public String getId ( ) { return "org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager-suspend-" + dataContainer . getUniqueName ( ) ; } public Serializable execute ( Serializ...
public class JBBPDslBuilder { /** * Add named double field . * @ param name name of the field , can be null for anonymous * @ return the builder instance , must not be null */ public JBBPDslBuilder Double ( final String name ) { } }
final Item item = new Item ( BinType . DOUBLE , name , this . byteOrder ) ; this . addItem ( item ) ; return this ;
public class Task { /** * call should not be synchronized since can run only once in queue cycle */ public void run ( ) { } }
if ( this . isActive ) { try { perform ( ) ; // notify listener if ( this . listener != null ) { this . listener . onTerminate ( ) ; } } catch ( Exception e ) { logger . error ( "Could not execute task " + this . taskId + ": " + e . getMessage ( ) , e ) ; if ( this . listener != null ) { listener . handlerError ( e ) ;...
public class Schema { /** * Adds a field with the field name and the type information . Required . * This method can be called multiple times . The call order of this method defines * also the order of the fields in a row . * @ param fieldName the field name * @ param fieldType the type information of the field...
field ( fieldName , TypeStringUtils . writeTypeInfo ( fieldType ) ) ; return this ;
public class ShExGenerator { /** * Generate a definition for a referenced element * @ param sd Containing structure definition * @ param ed Inner element * @ return ShEx representation of element reference */ private String genInnerTypeDef ( StructureDefinition sd , ElementDefinition ed ) { } }
String path = ed . hasBase ( ) ? ed . getBase ( ) . getPath ( ) : ed . getPath ( ) ; ; ST element_reference = tmplt ( SHAPE_DEFINITION_TEMPLATE ) ; element_reference . add ( "resourceDecl" , "" ) ; // Not a resource element_reference . add ( "id" , path ) ; String comment = ed . getShort ( ) ; element_reference . add (...
public class Stream { /** * Zip together the " a " and " b " iterators until all of them runs out of values . * Each pair of values is combined into a single value using the supplied zipFunction function . * @ param a * @ param b * @ param valueForNoneA value to fill if " a " runs out of values first . * @ pa...
return zip ( ObjIteratorEx . of ( a ) , ObjIteratorEx . of ( b ) , valueForNoneA , valueForNoneB , zipFunction ) ;
public class RemoteTaskRunner { /** * Adds a task to the pending queue */ @ VisibleForTesting RemoteTaskRunnerWorkItem addPendingTask ( final Task task ) { } }
log . info ( "Added pending task %s" , task . getId ( ) ) ; final RemoteTaskRunnerWorkItem taskRunnerWorkItem = new RemoteTaskRunnerWorkItem ( task . getId ( ) , task . getType ( ) , null , null , task . getDataSource ( ) ) ; pendingTaskPayloads . put ( task . getId ( ) , task ) ; pendingTasks . put ( task . getId ( ) ...
public class SegmentMeanShiftSearch { /** * Returns the Euclidean distance squared between the two vectors */ public static float distanceSq ( float [ ] a , float [ ] b ) { } }
float ret = 0 ; for ( int i = 0 ; i < a . length ; i ++ ) { float d = a [ i ] - b [ i ] ; ret += d * d ; } return ret ;
public class ConnectionWriteCompletedCallback { /** * being F176003 , F181603.2 , D192359 */ protected void proddle ( ) throws SIConnectionDroppedException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "proddle" ) ; boolean useThisThread = false ; synchronized ( priorityQueue ) { synchronized ( this ) { if ( idle ) { useThisThread = isWorkAvailable ( ) ; idle = ! useThisThread ; } } } if ( useThisThread ) { doWork (...
public class AbstractSoundUploadQuery { /** * Specify an individual tag associated with the sound . * @ param tag The tag associated with the sound * @ return The current { @ link UploadSound } instance */ @ SuppressWarnings ( "unchecked" ) public T tag ( final String tag ) { } }
if ( this . tags == null ) { this . tags = new HashSet < > ( ) ; } this . tags . add ( tag ) ; return ( T ) this ;
public class WebApplicationContext { public void destroy ( ) { } }
super . destroy ( ) ; if ( isStarted ( ) ) throw new IllegalStateException ( ) ; _defaultsDescriptor = null ; _war = null ; _configurationClassNames = null ; if ( _resourceAliases != null ) _resourceAliases . clear ( ) ; _resourceAliases = null ; _contextListeners = null ; if ( _errorPages != null ) _errorPages . clear...
public class HadoopInputSplit { private void writeObject ( ObjectOutputStream out ) throws IOException { } }
// serialize the parent fields and the final fields out . defaultWriteObject ( ) ; // the job conf knows how to serialize itself jobConf . write ( out ) ; // write the input split hadoopInputSplit . write ( out ) ;
public class ShowProducerAction { /** * Allows to set all stats to decorator except cumulated stat . * Stats will be sorted using given sort type . * @ param statDecoratorBean { @ link StatDecoratorBean } * @ param allStatLines list of { @ link StatLineAO } , all stats present in producer * @ param sortType { @...
if ( allStatLines == null || allStatLines . isEmpty ( ) ) { LOGGER . warn ( "Producer's stats are empty" ) ; return ; } final int cumulatedIndex = getCumulatedIndex ( allStatLines ) ; // stats int allStatLinesSize = allStatLines . size ( ) ; final List < StatBean > statBeans = new ArrayList < > ( allStatLinesSize ) ; f...
public class DescribeTrailsResult { /** * The list of trail objects . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setTrailList ( java . util . Collection ) } or { @ link # withTrailList ( java . util . Collection ) } if you want to * override the existi...
if ( this . trailList == null ) { setTrailList ( new com . amazonaws . internal . SdkInternalList < Trail > ( trailList . length ) ) ; } for ( Trail ele : trailList ) { this . trailList . add ( ele ) ; } return this ;
public class Datatype_Builder { /** * Sets the value to be returned by { @ link Datatype # getRebuildableType ( ) } . * @ return this { @ code Builder } object * @ throws NullPointerException if { @ code rebuildableType } is null */ public Datatype . Builder setRebuildableType ( TypeClass rebuildableType ) { } }
this . rebuildableType = Objects . requireNonNull ( rebuildableType ) ; return ( Datatype . Builder ) this ;
public class Sherdog { /** * Get a fighter via it ; s sherdog URL . * @ param sherdogUrl the shergod url of the fighter * @ return a Fighter an all his fights * @ throws IOException if connecting to sherdog fails * @ throws ParseException if the page structure has changed * @ throws SherdogParserException if ...
return new FighterParser ( pictureProcessor , zoneId ) . parse ( sherdogUrl ) ;
public class ApplicationUtils { /** * ( non - Javadoc ) * @ see com . ibm . ws . webcontainer . security . WebAppSecurityConfigChangeListener # notifyWebAppSecurityConfigChanged ( com . ibm . ws . webcontainer . security . WebAppSecurityConfigChangeEvent ) */ @ Override public void notifyWebAppSecurityConfigChanged (...
List < String > attributes = event . getModifiedAttributeList ( ) ; if ( isAppRestartRequired ( attributes ) ) { recycleApplications ( ) ; }
public class TopologyContext { /** * Register a IMetric instance . * Storm will then call getValueAndReset on the metric every timeBucketSizeInSecs * and the returned value is sent to all metrics consumers . * You must call this during IBolt : : prepare or ISpout : : open . * @ return The IMetric argument uncha...
MetricDelegate d = new MetricDelegate ( metric ) ; delegate . registerMetric ( name , d , timeBucketSizeInSecs ) ; return metric ;
public class CustomerSyncSelector { /** * Gets the dateTimeRange value for this CustomerSyncSelector . * @ return dateTimeRange * Only return entities that have changed during the specified * time range . String Format : yyyyMMdd * HHmmss < Timezone ID > ( for example , 20100609 150223 * America / New _ York ) ...
return dateTimeRange ;
public class LayerableConfig { /** * Imports the layerable config from node . * @ param root The root reference ( must not be < code > null < / code > ) . * @ return The layerable data . * @ throws LionEngineException If unable to read node or invalid integer . */ public static LayerableConfig imports ( Xml root ...
Check . notNull ( root ) ; final Xml node = root . getChild ( NODE_LAYERABLE ) ; final int layerRefresh = node . readInteger ( ATT_REFRESH ) ; final int layerDisplay = node . readInteger ( ATT_DISPLAY ) ; return new LayerableConfig ( layerRefresh , layerDisplay ) ;
public class BucketInfoMarshaller { /** * Marshall the given parameter object . */ public void marshall ( BucketInfo bucketInfo , ProtocolMarshaller protocolMarshaller ) { } }
if ( bucketInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( bucketInfo . getBuckets ( ) , BUCKETS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ;...
public class CommonOps_DDF3 { /** * < p > Performs the following operation : < br > * < br > * a = a - b < br > * a < sub > i < / sub > = a < sub > i < / sub > - b < sub > i < / sub > < br > * @ param a A Vector . Modified . * @ param b A Vector . Not modified . */ public static void subtractEquals ( DMatrix3...
a . a1 -= b . a1 ; a . a2 -= b . a2 ; a . a3 -= b . a3 ;
public class AddThenHideOldStrategy { /** * Take in two resources . If one ( only ) is beta return the non beta one */ private RepositoryResource returnNonBetaResourceOrNull ( RepositoryResource res1 , RepositoryResource res2 ) { } }
if ( isBeta ( res1 ) && ! isBeta ( res2 ) ) { return res2 ; } else if ( ! isBeta ( res1 ) && isBeta ( res2 ) ) { return res1 ; } else { return null ; }
public class SuffixDictionary { /** * 查找是否有该后缀 * @ param suffix * @ return */ public int get ( String suffix ) { } }
suffix = reverse ( suffix ) ; Integer length = trie . get ( suffix ) ; if ( length == null ) return 0 ; return length ;
public class DefaultPageMounter { /** * { @ inheritDoc } * A convenience method that uses a default coding strategy . */ @ Override public void addMountPoint ( String path , Class < ? extends Page > pageClass ) { } }
LOGGER . debug ( "Adding mount point for path {} = {}" , path , pageClass . getName ( ) ) ; mountPoints . add ( new DefaultMountPointInfo ( path , pageClass ) ) ;
public class DownloadDispatcher { /** * / * read data from input stream */ int readFromInputStream ( byte [ ] buffer , InputStream is ) { } }
try { return is . read ( buffer ) ; } catch ( IOException e ) { if ( END_OF_STREAM . equals ( e . getMessage ( ) ) ) { return - 2 ; } return Integer . MIN_VALUE ; }
public class DynamicConfigManager { /** * < p > Method to reload the configuration from admin for a given destination * and apply any changes to the in memory DestinationHandler . < / p > * @ param destinationHandler * @ throws SIStoreException * @ throws SICommsException * @ throws SIResourceException * @ ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reloadDestinationFromAdmin" ) ; try { // 577657 Lookup dest by uuid . We want to find destinations that have been altered - not ones // that have been deleted and recreated . BaseDestinationDefinition bdd = _messageProcesso...
public class DefaultAESCBCCipher { /** * A method to decrypt the provided cipher text . * @ param cipherText AES encrypted cipherText * @ return decrypted text */ @ Override public String decrypt ( String cipherText ) { } }
this . decryptionLock . lock ( ) ; try { String decryptedValue = null ; try { byte [ ] bytes = Base64 . getDecoder ( ) . decode ( cipherText ) ; decryptedValue = new String ( decryptCipher . doFinal ( bytes ) , charset ) ; } catch ( UnsupportedEncodingException | IllegalBlockSizeException | BadPaddingException e ) { lo...
public class LatencyMetrics { /** * takes nanoseconds * */ public void addNano ( long nanos ) { } }
// convert to microseconds . 1 millionth latency . update ( nanos , TimeUnit . NANOSECONDS ) ; totalLatency . inc ( nanos / 1000 ) ; totalLatencyHistogram . add ( nanos / 1000 ) ; recentLatencyHistogram . add ( nanos / 1000 ) ; for ( LatencyMetrics parent : parents ) { parent . addNano ( nanos ) ; }
public class Session { /** * Check whether the remote maestrano session is still valid * package private for testing */ boolean performRemoteCheck ( MnoHttpClient httpClient ) { } }
// Prepare request String url = sso . getSessionCheckUrl ( this . uid , this . sessionToken ) ; String respStr ; try { respStr = httpClient . get ( url ) ; } catch ( AuthenticationException e1 ) { // TODO log error e1 . printStackTrace ( ) ; return false ; } catch ( ApiException e1 ) { // TODO log error e1 . printStack...
public class Checker { /** * Reads a list of API signatures from the given URL . */ public void parseSignaturesFile ( URL url ) throws IOException , ParseException { } }
parseSignaturesFile ( url . openStream ( ) , url . toString ( ) ) ;
public class IFixCompareCommandTask { /** * { @ inheritDoc } */ @ Override protected void doExecute ( ExecutionContext context ) { } }
CommandConsole console = context . getCommandConsole ( ) ; /* * There are two uses of the compare command , they may have supplied the - - apar option or the - - to option , if neither is supplied then this is illegal use so put an error * out */ boolean toSet = context . optionExists ( INSTALL_LOCATION_TO_COMPARE_TO...
public class EnvironmentPlatform { /** * The list of programming languages that are available for the specified platform . * @ param languages * The list of programming languages that are available for the specified platform . */ public void setLanguages ( java . util . Collection < EnvironmentLanguage > languages ...
if ( languages == null ) { this . languages = null ; return ; } this . languages = new java . util . ArrayList < EnvironmentLanguage > ( languages ) ;
public class BooleansConverter { /** * Create a boolean value from given string . Returns boolean true only if string is one of next constants : < em > true < / em > , * < em > yes < / em > , < em > 1 < / em > , < em > on < / em > ; otherwise returns false . Note that comparison is not case sensitive . */ @ Override ...
// at this point value type is a boolean or a boxing boolean string = string . toLowerCase ( ) ; if ( string . equals ( "true" ) ) { return ( T ) ( Boolean ) true ; } if ( string . equals ( "yes" ) ) { return ( T ) ( Boolean ) true ; } if ( string . equals ( "1" ) ) { return ( T ) ( Boolean ) true ; } if ( string . equ...
public class GConvertImage { /** * Converts an image from one type to another type . Creates a new image instance if * an output is not provided . * @ param src Input image . Not modified . * @ param dst Converted output image . If null a new one will be declared . Modified . * @ param typeDst The type of outpu...
if ( dst == null ) { dst = ( T ) GeneralizedImageOps . createSingleBand ( typeDst , src . width , src . height ) ; } else { InputSanityCheck . checkSameShape ( src , dst ) ; } convert ( src , dst ) ; return dst ;
public class ListView { /** * Adds the given item to this view . * @ since 1.389 */ @ Override public void add ( TopLevelItem item ) throws IOException { } }
synchronized ( this ) { jobNames . add ( item . getRelativeNameFrom ( getOwner ( ) . getItemGroup ( ) ) ) ; } save ( ) ;
public class BsonUuidSerializer { /** * Utility routine for converting UUIDs to bytes in little endian format . * @ param uuid The UUID to convert * @ return a byte array representing the UUID in little endian format */ protected static byte [ ] uuidToLittleEndianBytes ( UUID uuid ) { } }
long msb = uuid . getMostSignificantBits ( ) ; long lsb = uuid . getLeastSignificantBits ( ) ; byte [ ] buffer = new byte [ 16 ] ; for ( int i = 0 ; i < 8 ; i ++ ) { buffer [ i ] = ( byte ) ( msb >>> 8 * i ) ; } for ( int i = 8 ; i < 16 ; i ++ ) { buffer [ i ] = ( byte ) ( lsb >>> 8 * ( i - 16 ) ) ; } return buffer ;
public class AbstractMetricsDispatcher { /** * Register Jackson module that maps enums as lowercase . Per http : / / stackoverflow . com / a / 24173645. */ @ SuppressWarnings ( "rawtypes" ) private static void registerEnumModule ( ObjectMapper mapper ) { } }
SimpleModule module = new SimpleModule ( ) ; module . setDeserializerModifier ( new BeanDeserializerModifier ( ) { @ Override public JsonDeserializer < Enum > modifyEnumDeserializer ( DeserializationConfig config , final JavaType type , BeanDescription beanDesc , final JsonDeserializer < ? > deserializer ) { return new...
public class StringParser { /** * Parse the given { @ link String } as { @ link Byte } with radix * { @ value # DEFAULT _ RADIX } . * @ param sStr * The String to parse . May be < code > null < / code > . * @ return < code > null < / code > if the string does not represent a valid value . */ @ Nullable public s...
return parseByteObj ( sStr , DEFAULT_RADIX , null ) ;
public class IntervalRBTree { /** * Checks if is red . * @ param n the n * @ return true , if is red */ private boolean isRed ( IntervalRBTreeNode < T > n ) { } }
if ( n == null ) { return false ; } return n . color == IntervalRBTreeNode . RED ;
public class BottomSheet { /** * Inflates the layout , which is used to show the bottom sheet ' s content . The layout may either * be the default one or a custom view , if one has been set before . */ private void inflateContentView ( ) { } }
contentContainer = rootView . findViewById ( R . id . content_container ) ; contentContainer . removeAllViews ( ) ; if ( customView != null ) { contentContainer . setVisibility ( View . VISIBLE ) ; contentContainer . addView ( customView ) ; } else if ( customViewId != - 1 ) { contentContainer . setVisibility ( View . ...
public class AWSIotClient { /** * Configures or reconfigures the Device Defender audit settings for this account . Settings include how audit * notifications are sent and which audit checks are enabled or disabled . * @ param updateAccountAuditConfigurationRequest * @ return Result of the UpdateAccountAuditConfig...
request = beforeClientExecution ( request ) ; return executeUpdateAccountAuditConfiguration ( request ) ;
public class StudioModel { /** * Sets JDBC | url | . * @ param url JDBC URL * @ see # getUrl */ public void setUrl ( final String url ) { } }
final String old = this . url ; this . url = url ; this . connectionConfig = System . currentTimeMillis ( ) ; this . connectionValidated = false ; this . pcs . firePropertyChange ( "url" , old , this . url ) ;
public class Bounds { /** * Create a new { @ code Bounds } object with the given extent . * @ param minLatitude the minimum latitude * @ param minLongitude the minimum longitude * @ param maxLatitude the maximum latitude * @ param maxLongitude the maximum longitude * @ return a new { @ code Bounds } object wi...
return new Bounds ( minLatitude , minLongitude , maxLatitude , maxLongitude ) ;
public class MessageSetImpl { /** * Gets up to a given amount of messages in the given channel around a given message in any channel . * The given message will be part of the result in addition to the messages around if it was sent in the given * channel and does not count towards the limit . * Half of the messag...
CompletableFuture < MessageSet > future = new CompletableFuture < > ( ) ; channel . getApi ( ) . getThreadPool ( ) . getExecutorService ( ) . submit ( ( ) -> { try { // calculate the half limit . int halfLimit = limit / 2 ; // get the newer half MessageSet newerMessages = getMessagesAfter ( channel , halfLimit , around...
public class ArrayKit { /** * Arr1 union Arr2 * @ param arr1 * @ param arr2 */ public static String [ ] union ( String [ ] arr1 , String [ ] arr2 ) { } }
Set < String > set = new HashSet < String > ( ) ; for ( String str : arr1 ) { set . add ( str ) ; } for ( String str : arr2 ) { set . add ( str ) ; } String [ ] result = { } ; return set . toArray ( result ) ;
public class Container { /** * Get the free level space , i . e . container height with height of * levels subtracted . * @ return free height and box dimension */ public Dimension getFreeLevelSpace ( ) { } }
int remainder = height - getStackHeight ( ) ; if ( remainder < 0 ) { throw new IllegalArgumentException ( "Remaining free space is negative at " + remainder + " for " + this ) ; } return new Dimension ( width , depth , remainder ) ;
public class FRAG { /** * Send all fragments as separate messages ( with same ID ! ) . * Example : * < pre > * Given the generated ID is 2344 , number of fragments = 3 , message { dst , src , buf } * would be fragmented into : * [ 2344,3,0 ] { dst , src , buf1 } , * [ 2344,3,1 ] { dst , src , buf2 } and *...
Address dest = msg . getDest ( ) , src = msg . getSrc ( ) ; long frag_id = curr_id . getAndIncrement ( ) ; // used as seqnos int num_frags ; try { // write message into a byte buffer and fragment it ByteArrayDataOutputStream dos = new ByteArrayDataOutputStream ( ( int ) ( size + 50 ) ) ; msg . writeTo ( dos ) ; byte [ ...
public class Fat { /** * Write the contents of this FAT to the given device at the given offset . * @ param offset the device offset where to write the FAT copy * @ throws IOException on write error */ public void writeCopy ( long offset ) throws IOException { } }
final byte [ ] data = new byte [ sectorCount * sectorSize ] ; for ( int index = 0 ; index < entries . length ; index ++ ) { fatType . writeEntry ( data , index , entries [ index ] ) ; } device . write ( offset , ByteBuffer . wrap ( data ) ) ;
public class IpcLogEntry { /** * Add a request header value . For special headers in { @ link NetflixHeader } it will * automatically fill in the more specific fields based on the header values . */ public IpcLogEntry addRequestHeader ( String name , String value ) { } }
if ( clientAsg == null && name . equalsIgnoreCase ( NetflixHeader . ASG . headerName ( ) ) ) { withClientAsg ( value ) ; } else if ( clientZone == null && name . equalsIgnoreCase ( NetflixHeader . Zone . headerName ( ) ) ) { withClientZone ( value ) ; } else if ( clientNode == null && name . equalsIgnoreCase ( NetflixH...
public class ExampleStereoTwoViewsOneCamera { /** * Show results as a point cloud */ public static void showPointCloud ( ImageGray disparity , BufferedImage left , Se3_F64 motion , DMatrixRMaj rectifiedK , DMatrixRMaj rectifiedR , int minDisparity , int maxDisparity ) { } }
DisparityToColorPointCloud d2c = new DisparityToColorPointCloud ( ) ; double baseline = motion . getT ( ) . norm ( ) ; d2c . configure ( baseline , rectifiedK , rectifiedR , new DoNothing2Transform2_F64 ( ) , minDisparity , maxDisparity ) ; d2c . process ( disparity , left ) ; CameraPinhole rectifiedPinhole = Perspecti...
public class IoUtil { /** * Read and return the entire contents of the supplied { @ link File file } . * @ param file the file containing the contents ; may be null * @ return the contents , or an empty byte array if the supplied file is null * @ throws IOException if there is an error reading the content */ publ...
if ( file == null ) return new byte [ ] { } ; InputStream stream = new BufferedInputStream ( new FileInputStream ( file ) ) ; boolean error = false ; try { return readBytes ( stream ) ; } catch ( IOException e ) { error = true ; // this error should be thrown , even if there is an error closing stream throw e ; } catch...
public class Unique { /** * { @ inheritDoc } * @ throws SuperCsvCellProcessorException * if value is null * @ throws SuperCsvConstraintViolationException * if a non - unique value is encountered */ public Object execute ( final Object value , final CsvContext context ) { } }
validateInputNotNull ( value , context ) ; if ( ! encounteredElements . add ( value ) ) { throw new SuperCsvConstraintViolationException ( String . format ( "duplicate value '%s' encountered" , value ) , context , this ) ; } return next . execute ( value , context ) ;
public class DeleteVpnConnectionRouteRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < DeleteVpnConnectionRouteRequest > getDryRunRequest ( ) { } }
Request < DeleteVpnConnectionRouteRequest > request = new DeleteVpnConnectionRouteRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class DateUtil { /** * Get the minute of the date * @ param date date * @ return minute of the date */ public static int getMinute ( Date date ) { } }
Calendar c = Calendar . getInstance ( ) ; c . setTime ( date ) ; return c . get ( Calendar . MINUTE ) ;
public class AssociativeArray { /** * Adds a particular key - value into the internal map . It returns the previous * value which was associated with that key . * @ param key * @ param value * @ return */ public final Object put ( Object key , Object value ) { } }
return internalData . put ( key , value ) ;
public class DepictionGenerator { /** * Generate a bound element that is the title of the provided molecule . If title * is not specified an empty bounds is returned . * @ param chemObj molecule or reaction * @ return bound element */ private Bounds generateTitle ( IChemObject chemObj , double scale ) { } }
String title = chemObj . getProperty ( CDKConstants . TITLE ) ; if ( title == null || title . isEmpty ( ) ) return new Bounds ( ) ; scale = 1 / scale * getParameterValue ( RendererModel . TitleFontScale . class ) ; return new Bounds ( MarkedElement . markup ( StandardGenerator . embedText ( font , title , getParameterV...
public class CmsMenuItemVisibilityMode { /** * Adds the name of the message key for the visibility mode . < p > * @ param messageKey the name of the message key for the visibility mode * @ return an extended visibility mode containing the message key */ public CmsMenuItemVisibilityMode addMessageKey ( String messag...
CmsMenuItemVisibilityMode mode = clone ( ) ; mode . m_messageKey = messageKey ; return mode ;
public class Sql { /** * Performs the given SQL query calling the given Closure with each row of the result set . * The row will be a < code > GroovyResultSet < / code > which is a < code > ResultSet < / code > * that supports accessing the fields using property style notation and ordinal index values . * The que...
eachRow ( gstring , null , closure ) ;
public class StandardRoadConnection { /** * Add a segment to this connection point . * < p > The segments are ordered according to there * geo - localization along a trigonometric cicle . * The first segment has the nearest angle to the * vector ( 1,0 ) , and the following segments are * ordered according to ...
if ( segment == null ) { return ; } if ( this . connectedSegments . isEmpty ( ) ) { this . connectedSegments . add ( new Connection ( segment , attachToStartPoint ) ) ; } else { // Compute the angle to the unit vector for the new segment final double newSegmentAngle = computeAngle ( segment , attachToStartPoint ) ; // ...
public class InternalXtextParser { /** * InternalXtext . g : 64:1 : entryRuleGrammar returns [ EObject current = null ] : iv _ ruleGrammar = ruleGrammar EOF ; */ public final EObject entryRuleGrammar ( ) throws RecognitionException { } }
EObject current = null ; EObject iv_ruleGrammar = null ; try { // InternalXtext . g : 64:48 : ( iv _ ruleGrammar = ruleGrammar EOF ) // InternalXtext . g : 65:2 : iv _ ruleGrammar = ruleGrammar EOF { newCompositeNode ( grammarAccess . getGrammarRule ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_1 ) ; iv_ruleGrammar = rul...
public class DomHelper { /** * Move an element from on group to another . The elements name will remain the same . * @ param name * The name of the element within the sourceParent group . * @ param sourceParent * The original parent group of the element . * @ param targetParent * The target parent group for...
Element sourceGroup = null ; Element targetGroup = null ; Element element = null ; if ( sourceParent != null ) { sourceGroup = getGroup ( sourceParent ) ; element = getElement ( sourceParent , name ) ; } if ( targetParent != null ) { targetGroup = getGroup ( targetParent ) ; } if ( sourceGroup == null || targetGroup ==...
public class Observable { /** * Returns an Observable that , when an observer subscribes to it , invokes a function you specify and then * emits the value returned from that function . * < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operato...
ObjectHelper . requireNonNull ( supplier , "supplier is null" ) ; return RxJavaPlugins . onAssembly ( new ObservableFromCallable < T > ( supplier ) ) ;
public class SqlContextImpl { /** * { @ inheritDoc } * @ see jp . co . future . uroborosql . fluent . SqlFluent # inOutParamIfAbsent ( java . lang . String , java . lang . Object , int ) */ @ Override public SqlContext inOutParamIfAbsent ( final String parameterName , final Object value , final int sqlType ) { } }
if ( ! hasParam ( parameterName ) ) { inOutParam ( parameterName , value , sqlType ) ; } return this ;
public class AutoAuthCriteriaParser { /** * Parses the provided criteria expression , which must have a * boolean value . * @ param criteria the criteria expression string . If < code > null < / code > , * this method returns < code > true < / code > . * @ param attributes any user attribute - value pairs . The...
if ( criteria == null ) { return true ; } else { try { return Boolean . parseBoolean ( FREEMARKER_BUILTINS . eval ( criteria , attributes ) ) ; } catch ( TemplateException ex ) { throw new CriteriaParseException ( ex ) ; } }
public class Forward { /** * Get the type of return as a String , if this is a < code > return - to < / code > type . * @ return one of the following values : < code > currentPage < / code > , < code > previousPage < / code > , < code > page < / code > , * ( deprecated ) , < code > previousAction < / code > , < cod...
switch ( _returnToType ) { case RETURN_TO_CURRENT_PAGE : return RETURN_TO_CURRENT_PAGE_STR ; case RETURN_TO_PREVIOUS_PAGE : return RETURN_TO_PREVIOUS_PAGE_STR ; case RETURN_TO_PAGE : return RETURN_TO_PAGE_LEGACY_STR ; case RETURN_TO_PREVIOUS_ACTION : return RETURN_TO_PREVIOUS_ACTION_STR ; case RETURN_TO_ACTION : return...
public class GeometryMergeService { /** * Remove a geometry from the merging list again . * @ param geometry The geometry to remove . * @ throws GeometryMergeException In case the merging process has not been started . */ public void removeGeometry ( Geometry geometry ) throws GeometryMergeException { } }
if ( ! busy ) { throw new GeometryMergeException ( "Can't remove a geometry if no merging process is active." ) ; } geometries . remove ( geometry ) ; eventBus . fireEvent ( new GeometryMergeRemovedEvent ( geometry ) ) ;
public class Stopwatch { /** * Stops the stopwatch . Future reads will return the fixed duration that had elapsed up to this * point . * @ return this { @ code Stopwatch } instance * @ throws IllegalStateException if the stopwatch is already stopped . */ public Stopwatch stop ( ) { } }
long tick = ticker . read ( ) ; checkState ( isRunning , "This stopwatch is already stopped." ) ; isRunning = false ; elapsedNanos += tick - startTick ; return this ;
public class Signatures { /** * Fixes an arguments array to fit a given length , * the last value is an array filled with varargs . * @ param length * @ param varArgType * @ param arguments * @ return fixed arguments array */ @ SuppressWarnings ( "SuspiciousSystemArraycopy" ) public static Object [ ] fixVarAr...
final Object [ ] result ; if ( arguments . length == length && varArgType . isInstance ( arguments [ length - 1 ] ) ) { return arguments ; } else { result = Arrays . copyOf ( arguments , length , Object [ ] . class ) ; } final Object varArgs ; Class < ? > varArgElementType = varArgType . getComponentType ( ) ; if ( var...
public class HolidayProcessor { /** * Get the date of the Shrove - Tide week in a given year * @ author Elena Klyachko * @ param year * @ return date */ public String getShroveTideWeekOrthodox ( int year ) { } }
String easterOrthodox = getEasterSundayOrthodox ( year ) ; SimpleDateFormat formatter = new SimpleDateFormat ( "yyyy-MM-dd" ) ; try { Calendar calendar = Calendar . getInstance ( ) ; Date date = formatter . parse ( easterOrthodox ) ; calendar . setTime ( date ) ; calendar . add ( Calendar . DAY_OF_MONTH , - 49 ) ; int ...
public class Code { /** * Executes { @ code op } and sets { @ code target } to the result . */ public < T > void op ( UnaryOp op , Local < T > target , Local < T > source ) { } }
addInstruction ( new PlainInsn ( op . rop ( source . type ) , sourcePosition , target . spec ( ) , source . spec ( ) ) ) ;
public class MultipleFieldConverter { /** * For binary fields , set the current state . * @ param state The state to set this field . * @ param bDisplayOption Display changed fields if true . * @ param iMoveMode The move mode . * @ return The error code ( or NORMAL _ RETURN ) . */ public int setData ( Object st...
// Must be overidden m_bSetData = true ; // Make sure getNextConverter is called correctly ( if it is called ) . int iErrorCode = super . setData ( state , bDisplayOption , iMoveMode ) ; m_bSetData = false ; return iErrorCode ;
public class CPMeasurementUnitPersistenceImpl { /** * Returns the cp measurement units before and after the current cp measurement unit in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; . * @ param CPMeasurementUnitId the primary key of the current cp measurement unit * @ param uuid the uuid * @ p...
CPMeasurementUnit cpMeasurementUnit = findByPrimaryKey ( CPMeasurementUnitId ) ; Session session = null ; try { session = openSession ( ) ; CPMeasurementUnit [ ] array = new CPMeasurementUnitImpl [ 3 ] ; array [ 0 ] = getByUuid_C_PrevAndNext ( session , cpMeasurementUnit , uuid , companyId , orderByComparator , true ) ...
public class ResourceManager { /** * Sync existing IVdmSource files with the build path of the project . This is used when the build path changed and * the project should be updated . This method removed old IVdmSource files which no longer is withing the build * path . * @ param project * @ throws CoreExceptio...
List < IVdmSourceUnit > syncedVdmSourceUnits = project . getSpecFiles ( ) ; List < IFile > removedFiles = new Vector < IFile > ( ) ; IProject p = ( IProject ) project . getAdapter ( IProject . class ) ; for ( IFile file : vdmSourceUnits . keySet ( ) ) { if ( file . getProject ( ) . equals ( p ) && ! syncedVdmSourceUnit...
public class Gmap3WicketToDoItems { /** * region > programmatic helpers */ @ Programmatic // for use by fixtures public Gmap3ToDoItem newToDo ( final String description , final String userName ) { } }
final Gmap3ToDoItem toDoItem = repositoryService . instantiate ( Gmap3ToDoItem . class ) ; toDoItem . setDescription ( description ) ; toDoItem . setOwnedBy ( userName ) ; toDoItem . setLocation ( new Location ( 51.5172 + random ( - 0.05 , + 0.05 ) , 0.1182 + random ( - 0.05 , + 0.05 ) ) ) ; repositoryService . persist...
public class LinearLayoutHelper { /** * In { @ link LinearLayoutHelper } , each iteration only consume one item , * so it can let parent LayoutManager to decide whether the next item is in the range of this helper */ @ Override public void layoutViews ( RecyclerView . Recycler recycler , RecyclerView . State state , ...
// reach the end of this layout if ( isOutOfRange ( layoutState . getCurrentPosition ( ) ) ) { return ; } int currentPosition = layoutState . getCurrentPosition ( ) ; // find corresponding layout container View view = nextView ( recycler , layoutState , helper , result ) ; if ( view == null ) { return ; } final boolean...
public class Is { /** * Determines whether the element is enabled or not . * @ return Boolean : whether the element is enabled or not */ public boolean enabled ( ) { } }
boolean isEnabled = false ; try { // adding additional check for disabled attribute , due to issues with safari isEnabled = ( element . getWebElement ( ) . isEnabled ( ) && ! element . get ( ) . allAttributes ( ) . containsKey ( "disabled" ) ) ; } catch ( NullPointerException | NoSuchElementException e ) { // Null poin...
public class UTCDateTimeUtils { /** * Returns the { @ link Date } for the values of the UTCDateBox and * UTCTimeBox which were edited in the specified { @ link TimeZone } . * @ param zone * The { @ link TimeZone } in which the Date was edited . * @ param dateBoxValue * The value of the { @ link UTCDateBox } c...
if ( dateBoxValue == null ) return null ; Calendar gmt = GregorianCalendar . getInstance ( TimeZone . getTimeZone ( "GMT" ) ) ; gmt . setTimeInMillis ( dateBoxValue . longValue ( ) ) ; Calendar cal = GregorianCalendar . getInstance ( zone ) ; cal . set ( gmt . get ( Calendar . YEAR ) , gmt . get ( Calendar . MONTH ) , ...
public class LocationBasedPerformanceTiersInner { /** * List all the performance tiers at specified location in a given subscription . * @ param locationName The name of the location . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the List & lt ; Perform...
return listWithServiceResponseAsync ( locationName ) . map ( new Func1 < ServiceResponse < List < PerformanceTierPropertiesInner > > , List < PerformanceTierPropertiesInner > > ( ) { @ Override public List < PerformanceTierPropertiesInner > call ( ServiceResponse < List < PerformanceTierPropertiesInner > > response ) {...
public class RangedBeacon { /** * Done at the end of each cycle before data are sent to the client */ public void commitMeasurements ( ) { } }
if ( ! getFilter ( ) . noMeasurementsAvailable ( ) ) { double runningAverage = getFilter ( ) . calculateRssi ( ) ; mBeacon . setRunningAverageRssi ( runningAverage ) ; mBeacon . setRssiMeasurementCount ( getFilter ( ) . getMeasurementCount ( ) ) ; LogManager . d ( TAG , "calculated new runningAverageRssi: %s" , running...
public class Dialogs { /** * 获得一个 { @ link Dialog } 对象 * @ param title 标题 * @ param ok 确认按钮 * @ return { @ link Dialog } */ public static Dialog < String [ ] > getDialog ( String title , ButtonType ok ) { } }
Dialog < String [ ] > dialog = new Dialog < > ( ) ; dialog . setTitle ( title ) ; dialog . setHeaderText ( null ) ; dialog . initModality ( Modality . APPLICATION_MODAL ) ; // 自定义确认和取消按钮 ButtonType cancel = new ButtonType ( CANCEL_BUTTON_TEXT , ButtonData . CANCEL_CLOSE ) ; dialog . getDialogPane ( ) . getButtonTypes (...
public class CommonIronJacamarParser { /** * Store a pool * @ param pool The pool * @ param writer The writer * @ exception Exception Thrown if an error occurs */ protected void storePool ( Pool pool , XMLStreamWriter writer ) throws Exception { } }
writer . writeStartElement ( CommonXML . ELEMENT_POOL ) ; if ( pool . getType ( ) != null ) writer . writeAttribute ( CommonXML . ATTRIBUTE_TYPE , pool . getValue ( CommonXML . ATTRIBUTE_TYPE , pool . getType ( ) ) ) ; if ( pool . getJanitor ( ) != null ) writer . writeAttribute ( CommonXML . ATTRIBUTE_JANITOR , pool ....
public class GBSTree { /** * Delete from current or successor . * < ol > * < li > There is no right child * < li > There may or may not be a left child . * < li > DELETE _ KEY > MEDIAN of current node . * < li > DELETE _ KEY < MEDIAN of successor ( if there is one ) * < / ol > * < p > In the example below...
if ( l == null ) /* There is no upper successor */ rightDeleteNoSuccessor ( p , deleteKey , point ) ; else /* There is an upper successor */ rightDeleteWithSuccessor ( p , l , deleteKey , point ) ;
public class SVGForTextInBoxTree { /** * generating */ private void generateEdges ( StringBuilder result , TextInBox parent ) { } }
if ( ! getTree ( ) . isLeaf ( parent ) ) { Rectangle2D . Double b1 = getBoundsOfNode ( parent ) ; double x1 = b1 . getCenterX ( ) ; double y1 = b1 . getCenterY ( ) ; for ( TextInBox child : getChildren ( parent ) ) { Rectangle2D . Double b2 = getBoundsOfNode ( child ) ; result . append ( line ( x1 , y1 , b2 . getCenter...
public class LayoutStructure { /** * Add a parameter to this LayoutStructure . * @ param paramName the name of the parameter * @ param paramValue the value of the parameter */ public void addParameter ( String paramName , String paramValue ) { } }
this . parameters . add ( new StructureParameter ( paramName , paramValue ) ) ;
public class CmsSolrIndex { /** * Default search method . < p > * @ param cms the current CMS object * @ param query the query * @ return the results * @ throws CmsSearchException if something goes wrong * @ see # search ( CmsObject , String ) */ public CmsSolrResultList search ( CmsObject cms , SolrQuery que...
return search ( cms , CmsEncoder . decode ( query . toString ( ) ) ) ;
public class ConvertDMatrixStruct { /** * Converts { @ link DMatrix6x6 } into { @ link DMatrixRMaj } . * @ param input Input matrix . * @ param output Output matrix . If null a new matrix will be declared . * @ return Converted matrix . */ public static DMatrixRMaj convert ( DMatrix6x6 input , DMatrixRMaj output ...
if ( output == null ) output = new DMatrixRMaj ( 6 , 6 ) ; output . reshape ( input . getNumRows ( ) , input . getNumCols ( ) ) ; output . data [ 0 ] = input . a11 ; output . data [ 1 ] = input . a12 ; output . data [ 2 ] = input . a13 ; output . data [ 3 ] = input . a14 ; output . data [ 4 ] = input . a15 ; output . d...