signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Input { /** * Check if the controller has the left direction pressed * @ param controller The index of the controller to check * @ return True if the controller is pressed to the left */ public boolean isControllerLeft ( int controller ) { } }
if ( controller >= getControllerCount ( ) ) { return false ; } if ( controller == ANY_CONTROLLER ) { for ( int i = 0 ; i < controllers . size ( ) ; i ++ ) { if ( isControllerLeft ( i ) ) { return true ; } } return false ; } return ( ( Controller ) controllers . get ( controller ) ) . getXAxisValue ( ) < - 0.5f || ( ( C...
public class PrettyTime { /** * Get the unmodifiable { @ link List } of the current configured { @ link TimeUnit } instances in calculations . */ public List < TimeUnit > getUnits ( ) { } }
if ( cachedUnits == null ) { List < TimeUnit > result = new ArrayList < TimeUnit > ( units . keySet ( ) ) ; Collections . sort ( result , new TimeUnitComparator ( ) ) ; cachedUnits = Collections . unmodifiableList ( result ) ; } return cachedUnits ;
public class ExpressionUtil { /** * Find any listed expressions that qualify as potential partitioning where filters , * which is to say are equality comparisons with a TupleValueExpression on at least one side , * and a TupleValueExpression , ConstantValueExpression , or ParameterValueExpression on the other . *...
for ( AbstractExpression expr : filterList ) { if ( ! expr . isColumnEquivalenceFilter ( ) ) { continue ; } AbstractExpression leftExpr = expr . getLeft ( ) ; AbstractExpression rightExpr = expr . getRight ( ) ; // Any two asserted - equal expressions need to map to the same equivalence set , // which must contain them...
public class MockArtifactStore { /** * { @ inheritDoc } */ public synchronized void set ( Artifact artifact , InputStream content ) throws IOException { } }
try { set ( artifact , new BytesContent ( IOUtils . toByteArray ( content ) ) ) ; } finally { IOUtils . closeQuietly ( content ) ; }
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcPhysicalOrVirtualEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class UniformDistributionTypeImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case BpsimPackage . UNIFORM_DISTRIBUTION_TYPE__MAX : setMax ( ( Double ) newValue ) ; return ; case BpsimPackage . UNIFORM_DISTRIBUTION_TYPE__MIN : setMin ( ( Double ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class ExecutionTimesReport { /** * Remember execution time for all executed suites . */ @ Subscribe public void onSuiteResult ( AggregatedSuiteResultEvent e ) { } }
long millis = e . getExecutionTime ( ) ; String suiteName = e . getDescription ( ) . getDisplayName ( ) ; List < Long > values = hints . get ( suiteName ) ; if ( values == null ) { hints . put ( suiteName , values = new ArrayList < > ( ) ) ; } values . add ( millis ) ; while ( values . size ( ) > historyLength ) values...
public class PermitMonitor { /** * 查询是否允许授权处理 , 非阻塞 , 指定是否强制刷新 */ public boolean isPermit ( boolean reload ) { } }
if ( reload ) { // 判断是否需要重新reload reload ( ) ; } boolean result = channelStatus . isStart ( ) && mainStemStatus . isOverTake ( ) ; if ( existOpposite ) { // 判断是否存在反向同步 result &= oppositeMainStemStatus . isOverTake ( ) ; } return result ;
public class ThrottledApiHandler { /** * All champions in the game . * This method does not count towards the rate limit and is not affected by the throttle * @ param champData Additional information to retrieve * @ return All champions in the game */ public Future < Collection < Champion > > getChampions ( Champ...
return new DummyFuture < > ( handler . getChampions ( champData ) ) ;
public class FileWatcher { /** * Start watching file path and notify watcher for updates on that file . * The watcher will be kept in a weak reference and will allow GC to delete * the instance . * @ param file The file path to watch . * @ param watcher The watcher to be notified . */ public void weakAddWatcher...
synchronized ( mutex ) { startWatchingInternal ( file ) . add ( new WeakReference < > ( watcher ) :: get ) ; }
public class MinimalWordCount { /** * 输出有向无环图的结构 * @ param dag */ private void dumpDAG ( Node [ ] [ ] dag ) { } }
if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "有向无环图:" ) ; for ( int i = 0 ; i < dag . length - 1 ; i ++ ) { Node [ ] nodes = dag [ i ] ; StringBuilder line = new StringBuilder ( ) ; for ( Node node : nodes ) { int following = node . getFollowing ( ) ; StringBuilder followingNodeTexts = new StringBuilder ( ) ; ...
public class BluetoothEndpoint { /** * Helpers */ protected BluetoothDevicesProvider resolveBluetoothDeviceProvider ( ) { } }
if ( bluetoothDevicesProvider == null ) { Set < BluetoothDevicesProvider > providers = getCamelContext ( ) . getRegistry ( ) . findByType ( BluetoothDevicesProvider . class ) ; if ( providers . size ( ) == 1 ) { BluetoothDevicesProvider provider = providers . iterator ( ) . next ( ) ; LOG . info ( "Found single instanc...
public class Status { /** * Create a derived instance of { @ link Status } augmenting the current description with * additional detail . Leading and trailing whitespace may be removed ; this may change in the * future . */ public Status augmentDescription ( String additionalDetail ) { } }
if ( additionalDetail == null ) { return this ; } else if ( this . description == null ) { return new Status ( this . code , additionalDetail , this . cause ) ; } else { return new Status ( this . code , this . description + "\n" + additionalDetail , this . cause ) ; }
public class DateTimePeriod { /** * Converts this period to a list of five minute periods . Partial five minute periods will not be * included . For example , a period of " January 20 , 2009 7 to 8 AM " will return a list * of 12 five minute periods - one for each 5 minute block of time 0 , 5 , 10 , 15 , etc . * ...
ArrayList < DateTimePeriod > list = new ArrayList < DateTimePeriod > ( ) ; // default " current " five minutes to start datetime DateTime currentStart = getStart ( ) ; // calculate " next " five minutes DateTime nextStart = currentStart . plusMinutes ( 5 ) ; // continue adding until we ' ve reached the end while ( next...
public class DirectoryLoaderAdaptor { /** * Load implementation for FileCacheKey : must return the metadata of the * requested file . */ private FileMetadata loadIntern ( final FileCacheKey key ) throws IOException { } }
final String fileName = key . getFileName ( ) ; final long fileLength = directory . fileLength ( fileName ) ; // We ' re forcing the buffer size of a to - be - read segment to the full file size : final int bufferSize = ( int ) Math . min ( fileLength , ( long ) autoChunkSize ) ; final FileMetadata meta = new FileMetad...
public class TopicPool { /** * Rolls back any new topics that were created . Since existing topics are stored * in revision data when edited we can ' t roll back that data properly . */ public void rollbackPool ( ) { } }
if ( newTopicPool == null || newTopicPool . isEmpty ( ) ) return ; final List < Integer > topicIds = new ArrayList < Integer > ( ) ; for ( final TopicWrapper topic : newTopicPool . getItems ( ) ) { topicIds . add ( topic . getTopicId ( ) ) ; } try { topicProvider . deleteTopics ( topicIds ) ; initialised = false ; } ca...
public class AtomixFuture { /** * Returns a new completed Atomix future . * @ param result the future result * @ param < T > the future result type * @ return the completed future */ public static < T > CompletableFuture < T > completedFuture ( T result ) { } }
CompletableFuture < T > future = new AtomixFuture < > ( ) ; future . complete ( result ) ; return future ;
public class LegacySpy { /** * Alias for { @ link # verifyBetween ( int , int , Threads , Query ) } with arguments 0 , 1 , { @ code threads } , { @ link Query # ANY } * @ since 2.0 */ @ Deprecated public C verifyAtMostOnce ( Threads threadMatcher ) throws WrongNumberOfQueriesError { } }
return verify ( SqlQueries . atMostOneQuery ( ) . threads ( threadMatcher ) ) ;
public class CompositeInputSplit { /** * Write splits in the following format . * { @ code * < count > < class1 > < class2 > . . . < classn > < split1 > < split2 > . . . < splitn > */ public void write ( DataOutput out ) throws IOException { } }
WritableUtils . writeVInt ( out , splits . length ) ; for ( InputSplit s : splits ) { Text . writeString ( out , s . getClass ( ) . getName ( ) ) ; } for ( InputSplit s : splits ) { s . write ( out ) ; }
public class InJamp { /** * Reads the next HMTP packet from the stream , returning false on * end of file . */ public int readMessages ( Reader is ) throws IOException { } }
// InboxAmp oldInbox = null ; try ( OutboxAmp outbox = OutboxAmp . currentOrCreate ( getManager ( ) ) ) { // OutboxThreadLocal . setCurrent ( _ outbox ) ; return readMessages ( is , outbox ) ; } finally { // OutboxThreadLocal . setCurrent ( null ) ; }
public class DescribeVpcEndpointsRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < DescribeVpcEndpointsRequest > getDryRunRequest ( ) { } }
Request < DescribeVpcEndpointsRequest > request = new DescribeVpcEndpointsRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class SinkExecutor { /** * Add task to invoke processRecord method when the WakeableLooper is waken up */ private void addSinkTasks ( ) { } }
Runnable sinkTasks = new Runnable ( ) { @ Override public void run ( ) { while ( ! metricsInSinkQueue . isEmpty ( ) ) { metricsSink . processRecord ( metricsInSinkQueue . poll ( ) ) ; } } } ; slaveLooper . addTasksOnWakeup ( sinkTasks ) ;
public class GlobalTypeImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setIdentifier ( String newIdentifier ) { } }
String oldIdentifier = identifier ; identifier = newIdentifier ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , DroolsPackage . GLOBAL_TYPE__IDENTIFIER , oldIdentifier , identifier ) ) ;
public class Analysis { /** * 一整句话分词 , 用户设置的歧异优先 * @ param temp * @ return */ private List < Term > analysisStr ( String temp ) { } }
Graph gp = new Graph ( temp ) ; int startOffe = 0 ; if ( this . ambiguityForest != null ) { GetWord gw = new GetWord ( this . ambiguityForest , gp . chars ) ; String [ ] params = null ; while ( ( gw . getFrontWords ( ) ) != null ) { if ( gw . offe > startOffe ) { analysis ( gp , startOffe , gw . offe ) ; } params = gw ...
public class Participant { /** * Create a ParticipantCreator to execute create . * @ param pathAccountSid The SID of the Account that will create the resource * @ param pathConferenceSid The SID of the participant ' s conference * @ param from The ` from ` phone number used to invite a participant * @ param to ...
return new ParticipantCreator ( pathAccountSid , pathConferenceSid , from , to ) ;
public class LexiconAttributesMarshaller { /** * Marshall the given parameter object . */ public void marshall ( LexiconAttributes lexiconAttributes , ProtocolMarshaller protocolMarshaller ) { } }
if ( lexiconAttributes == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( lexiconAttributes . getAlphabet ( ) , ALPHABET_BINDING ) ; protocolMarshaller . marshall ( lexiconAttributes . getLanguageCode ( ) , LANGUAGECODE_BINDING ) ; protocolM...
public class IdolFieldPathNormaliserImpl { /** * We have to do it this way to break the circular dependency between the FieldsInfo deserializer and this . */ public Pattern updatePattern ( final Collection < String > prefixes ) { } }
final String XML_PREFIX = prefixes . stream ( ) . map ( s -> Pattern . quote ( s + "/" ) ) . collect ( Collectors . joining ( "|" ) ) ; return XML_PATH_PATTERN = Pattern . compile ( "^/?(?:" + XML_PREFIX + ")?(?:" + IDX_PREFIX + ")?(?<fieldPath>[^/]+(?:/[^/]+)*)$" ) ;
public class NewYearStrategy { /** * < p > Determines the date of New Year . < / p > * @ param era historic era * @ param yearOfDisplay historic year of era as displayed ( deviating from standard calendar year ) * @ return historic date of New Year * @ since 3.14/4.11 */ HistoricDate newYear ( HistoricEra era ,...
return rule ( era , yearOfDisplay ) . newYear ( era , yearOfDisplay ) ;
public class MSExcelParser { /** * Parses the given InputStream containing Excel data . The type of InputStream ( e . g . FileInputStream , BufferedInputStream etc . ) does not matter here , but it is recommended to use an appropriate * type to avoid performance issues . * @ param in InputStream containing Excel da...
// read xls try { this . currentWorkbook = WorkbookFactory . create ( in , this . hocr . getPassword ( ) ) ; } catch ( EncryptedDocumentException | IOException e ) { LOG . error ( e ) ; throw new FormatNotUnderstoodException ( e . toString ( ) ) ; } finally { if ( this . in != null ) { try { this . in . close ( ) ; } c...
public class ClasspathFileReader { /** * Finds a file if it exists in a list of provided paths * @ param fileName the name of the file * @ param path a list of file paths * @ return a file or null if none is found */ private File findFile ( String fileName , List path ) { } }
final String methodName = "findFile(): " ; String fileSeparator = System . getProperty ( "file.separator" ) ; for ( Iterator i = path . iterator ( ) ; i . hasNext ( ) ; ) { String directory = ( String ) i . next ( ) ; if ( ! directory . endsWith ( fileSeparator ) && ! fileName . startsWith ( fileSeparator ) ) { directo...
public class CrossOriginResourceSharingFilter { /** * ( non - Javadoc ) * @ see org . restlet . routing . Filter # afterHandle ( org . restlet . Request , org . restlet . Response ) */ @ SuppressWarnings ( "unchecked" ) @ Override protected void afterHandle ( final Request request , final Response response ) { } }
super . afterHandle ( request , response ) ; final ConcurrentMap < String , Object > responseAttributes = response . getAttributes ( ) ; Series < Header > responseHeaders = ( Series < Header > ) responseAttributes . get ( HeaderConstants . ATTRIBUTE_HEADERS ) ; if ( responseHeaders == null ) { responseHeaders = new Ser...
public class MkdirCommand { /** * - - - - - private methods - - - - - */ private void createFolder ( final StructrShellCommand parent , final Folder currentFolder , final String target ) throws FrameworkException , IOException { } }
final App app = StructrApp . getInstance ( ) ; if ( target . contains ( "/" ) ) { final int lastSlashIndex = target . lastIndexOf ( "/" ) ; final String targetFolderPath = target . substring ( 0 , lastSlashIndex ) ; final String targetFolderName = target . substring ( lastSlashIndex + 1 ) ; final Folder parentFolder = ...
public class Compatibility { /** * Check whether data already written to a provided partition can be read * using the new partition type . * For example , existing ints can be read as strings , but existing strings * can ' t be read as ints . * @ param providedClass the class from a provided partitioner * @ p...
if ( Integer . class . isAssignableFrom ( providedClass ) ) { return ( replacementClass == String . class || replacementClass == Integer . class || replacementClass == Long . class ) ; } else if ( Long . class . isAssignableFrom ( providedClass ) ) { return ( replacementClass == String . class || replacementClass == Lo...
public class LBiObjSrtPredicateBuilder { /** * Adds full new case for the argument that are of specific classes ( matched by instanceOf , null is a wildcard ) . */ @ Nonnull public < V1 extends T1 , V2 extends T2 > LBiObjSrtPredicateBuilder < T1 , T2 > aCase ( Class < V1 > argC1 , Class < V2 > argC2 , LBiObjSrtPredicat...
PartialCaseWithBoolProduct . The pc = partialCaseFactoryMethod ( ( a1 , a2 , a3 ) -> ( argC1 == null || argC1 . isInstance ( a1 ) ) && ( argC2 == null || argC2 . isInstance ( a2 ) ) ) ; pc . evaluate ( function ) ; return self ( ) ;
public class SemaphoreGuard { /** * Acquires the semaphore . Also , the first execution of this method retrieves the semaphore by name and stores it locally . * This method is called when the task is entered . */ @ Override public void start ( ) { } }
if ( semaphore == null ) { semaphore = NonBlockingSemaphoreRepository . getSemaphore ( name ) ; } semaphoreAcquired = semaphore . acquire ( ) ; super . start ( ) ;
public class EditorComponentPane { /** * Returns the view specific menubar if the underlying view * implementation supports it . */ protected JComponent createViewMenuBar ( ) { } }
if ( getPageComponent ( ) instanceof AbstractEditor ) { AbstractEditor editor = ( AbstractEditor ) getPageComponent ( ) ; return editor . getEditorMenuBar ( ) ; } return null ;
public class ChainLight { /** * Calculates ray positions and angles along chain . This should be called * any time the number or values of elements changes in { @ link # chain } . */ public void updateChain ( ) { } }
Vector2 v1 = Pools . obtain ( Vector2 . class ) ; Vector2 v2 = Pools . obtain ( Vector2 . class ) ; Vector2 vSegmentStart = Pools . obtain ( Vector2 . class ) ; Vector2 vDirection = Pools . obtain ( Vector2 . class ) ; Vector2 vRayOffset = Pools . obtain ( Vector2 . class ) ; Spinor tmpAngle = Pools . obtain ( Spinor ....
public class SyntaxHighlighter { /** * / * ( non - Javadoc ) * @ see org . opoo . press . converter . Highlighter # containsHighlightCodeBlock ( java . lang . String ) */ @ Override public boolean containsHighlightCodeBlock ( String content ) { } }
return StringUtils . contains ( content , "<pre class='brush:" ) || StringUtils . contains ( content , "<pre class=\"brush:" ) ;
public class Proposal { /** * Gets the billingBase value for this Proposal . * @ return billingBase * The billing base of this { @ code Proposal } . For example , for * a flat fee * { @ link BillingSource # CONTRACTED contracted } { @ link * # billingSource } , set this to * { @ link BillingBase # REVENUE } ....
return billingBase ;
public class SvgPathData { /** * Checks an ' L ' command . */ private void checkL ( ) throws DatatypeException , IOException { } }
if ( context . length ( ) == 0 ) { appendToContext ( current ) ; } current = reader . read ( ) ; appendToContext ( current ) ; skipSpaces ( ) ; _checkL ( 'L' , true ) ;
public class Tokenizer { /** * Determines if the underlying input is looking at a bracket . * By default all supplied < tt > brackets < / tt > are checked . If < tt > treatSinglePipeAsBracket < / tt > is true , a * single ' | ' is also treated as bracket . * @ param inSymbol determines if we ' re already parsing ...
return input . current ( ) . is ( brackets ) || ! inSymbol && treatSinglePipeAsBracket && input . current ( ) . is ( '|' ) && ! input . next ( ) . is ( '|' ) ;
public class ControlFlowAnalysis { /** * Determines if the subtree might throw an exception . */ public static boolean mayThrowException ( Node n ) { } }
switch ( n . getToken ( ) ) { case CALL : case TAGGED_TEMPLATELIT : case GETPROP : case GETELEM : case THROW : case NEW : case ASSIGN : case INC : case DEC : case INSTANCEOF : case IN : case YIELD : case AWAIT : return true ; case FUNCTION : return false ; default : break ; } for ( Node c = n . getFirstChild ( ) ; c !=...
public class MessageProcessor { /** * Set _ discardMsgsAfterQueueDeletion to true . */ public void setDiscardMsgsAfterQueueDeletion ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "setDiscardMsgsAfterQueueDeletion" ) ; SibTr . exit ( tc , "setDiscardMsgsAfterQueueDeletion" ) ; } _discardMsgsAfterQueueDeletion = true ;
public class XsdEmitter { /** * Create an XML schema totalDigits facet . * @ param totalDigits the value to set * @ return an XML schema totalDigits facet */ protected XmlSchemaTotalDigitsFacet createTotalDigitsFacet ( final int totalDigits ) { } }
XmlSchemaTotalDigitsFacet xmlSchemaTotalDigitsFacet = new XmlSchemaTotalDigitsFacet ( ) ; xmlSchemaTotalDigitsFacet . setValue ( totalDigits ) ; return xmlSchemaTotalDigitsFacet ;
public class AbstractFileRoutesLoader { /** * Helper method . Creates a { @ link Route } object from the input string . * @ param input the string to parse . * @ return a { @ link Route } object . * @ throws ParseException if the line has an invalid format . */ private Route parse ( String input , int line ) thro...
StringTokenizer st = new StringTokenizer ( input , " \t" ) ; if ( st . countTokens ( ) != 3 ) { throw new ParseException ( "Unrecognized format" , line ) ; } // retrieve and validate the three arguments String httpMethod = validateHttpMethod ( st . nextToken ( ) . trim ( ) , line ) ; String path = validatePath ( st . n...
public class CPAttachmentFileEntryPersistenceImpl { /** * Returns the cp attachment file entry where uuid = & # 63 ; and groupId = & # 63 ; or throws a { @ link NoSuchCPAttachmentFileEntryException } if it could not be found . * @ param uuid the uuid * @ param groupId the group ID * @ return the matching cp attac...
CPAttachmentFileEntry cpAttachmentFileEntry = fetchByUUID_G ( uuid , groupId ) ; if ( cpAttachmentFileEntry == null ) { StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . append ( ", groupId=" ) ; msg . append ( groupId ) ; ...
public class UploadObjectObserver { /** * Notified from { @ link MultiFileOutputStream # fos ( ) } when a part ready for * upload has been successfully created on disk . By default , this method * performs the following : * < ol > * < li > calls { @ link # newUploadPartRequest ( PartCreationEvent , File ) } to ...
final File part = event . getPart ( ) ; final UploadPartRequest reqUploadPart = newUploadPartRequest ( event , part ) ; final OnFileDelete fileDeleteObserver = event . getFileDeleteObserver ( ) ; appendUserAgent ( reqUploadPart , AmazonS3EncryptionClient . USER_AGENT ) ; futures . add ( es . submit ( new Callable < Upl...
public class QueryInfo { /** * Deprecated : Since return doesn ' t contain method information , { @ link # getParametersList ( ) } is now used . * @ return list of parameter map , key is first arg as string , value is second arg . * @ deprecated use { @ link # getParametersList ( ) } */ @ Deprecated public List < M...
// simulate old implementation behavior List < Map < String , Object > > result = new ArrayList < Map < String , Object > > ( ) ; for ( List < ParameterSetOperation > paramsList : this . parametersList ) { Map < String , Object > map = new HashMap < String , Object > ( ) ; for ( ParameterSetOperation param : paramsList...
public class AuthenticationApi { /** * Perform authorization * Perform authorization based on the code grant type & amp ; mdash ; either Authorization Code Grant or Implicit Grant . For more information , see [ Authorization Endpoint ] ( https : / / tools . ietf . org / html / rfc6749 # section - 3.1 ) . * * Note : *...
authorizeWithHttpInfo ( clientId , redirectUri , responseType , authorization , hideTenant , scope ) ;
public class BoundCodeableConceptDt { /** * Sets the { @ link # getCoding ( ) } to contain a coding with the code and * system defined by the given enumerated types , AND clearing any existing * codings first . If theValue is null , existing codings are cleared and no * codings are added . * @ param theValues ...
Validate . notNull ( myBinder , "This object does not have a binder. Constructor BoundCodeableConceptDt() should not be called!" ) ; getCoding ( ) . clear ( ) ; if ( theValues != null ) { for ( T next : theValues ) { getCoding ( ) . add ( new CodingDt ( myBinder . toSystemString ( next ) , myBinder . toCodeString ( nex...
public class MaterialNavigationDrawer { /** * / * Chiamata dopo l ' invalidateOptionsMenu ( ) */ @ Override public boolean onPrepareOptionsMenu ( Menu menu ) { } }
if ( layout . isDrawerOpen ( drawer ) && ! deviceSupportMultiPane ( ) ) { menu . clear ( ) ; } return super . onPrepareOptionsMenu ( menu ) ;
public class AssetFiltersInner { /** * Get an Asset Filter . * Get the details of an Asset Filter associated with the specified Asset . * @ param resourceGroupName The name of the resource group within the Azure subscription . * @ param accountName The Media Services account name . * @ param assetName The Asset...
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , accountName , assetName , filterName ) , serviceCallback ) ;
public class CmdLine { /** * Parse command line arguments for the example * @ param args Command - line arguments for HDFS example * @ return a ChartExec object resulting from the parsing of command - line options * @ throws ParseException when args cannot be parsed * @ throws IOException when input file cannot...
// create the command line parser CommandLineParser parser = new GnuParser ( ) ; // create the Options final Options options = new Options ( ) . addOption ( "h" , "help" , false , "print help." ) . addOption ( "i" , "inputfile" , true , "the scxml input file" ) . addOption ( "n" , "numberoftimes" , true , "an integer, ...
public class Gravatar { /** * Set the default image which will be retrieved when there is no avatar * for the given email , when the avatar can ' t be shown due to the rating * or when you enforce the default avatar . * @ param standardDefaultImage One of multiple default avatar choices . * @ return Fluent inte...
assert standardDefaultImage != null ; this . standardDefaultImage = standardDefaultImage ; customDefaultImage = null ; return this ;
public class PlayRecordContext { /** * If set to true , clears the digit buffer before playing the initial prompt . * < b > Defaults to false . < / b > Valid values are the text strings " true " and " false " . * @ return */ public boolean getClearDigitBuffer ( ) { } }
String value = Optional . fromNullable ( getParameter ( SignalParameters . CLEAR_DIGIT_BUFFER . symbol ( ) ) ) . or ( "false" ) ; return Boolean . parseBoolean ( value ) ;
public class DefaultBlitz4jConfig { /** * ( non - Javadoc ) * @ see * com . netflix . blitz4j . BlitzConfig # getAsyncAppenderImplementationNames ( ) */ @ Override public String [ ] getAsyncAppenderImplementationNames ( ) { } }
return CONFIGURATION . getStringProperty ( BLITZ4J_ASYNC_APPENDERS , this . getPropertyValue ( BLITZ4J_ASYNC_APPENDERS , "com.netflix.blitz4j.AsyncAppender" ) ) . get ( ) . split ( "," ) ;
public class SiteTracker { /** * Get an array of local sites that need heartbeats . This will get individually generated heartbeats . */ public long [ ] getLocalSites ( ) { } }
int hostId = VoltDB . instance ( ) . getHostMessenger ( ) . getHostId ( ) ; return longListToArray ( m_hostsToSitesImmutable . get ( hostId ) ) ;
public class TextStylist { @ Override public void formatMap ( Map < Object , Object > map ) throws FormatException { } }
if ( map == null || map . isEmpty ( ) ) return ; // nothing to process // format properties Object key = null ; Object value = null ; String text = null ; for ( Map . Entry < Object , Object > entry : map . entrySet ( ) ) { key = entry . getKey ( ) ; value = entry . getValue ( ) ; if ( ! ( value instanceof String ) ) c...
public class ReconciliationReportRow { /** * Gets the manualRevenue value for this ReconciliationReportRow . * @ return manualRevenue * The revenue calculated based on the { @ link # costPerUnit } , { @ link * # costType } , * { @ link # manualClicks } , { @ link # manualImpressions } * and { @ link # manualLin...
return manualRevenue ;
public class GVRCameraRig { /** * Map a three - component { @ code float } vector to { @ code key } . * @ param key * Key to map the vector to . * @ param x * ' X ' component of vector . * @ param y * ' Y ' component of vector . * @ param z * ' Z ' component of vector . */ public void setVec3 ( String k...
checkStringNotNullOrEmpty ( "key" , key ) ; NativeCameraRig . setVec3 ( getNative ( ) , key , x , y , z ) ;
public class PostalCodeManager { /** * Check if the passed postal code is valid for the passed country . * @ param aCountry * The country to check . May be < code > null < / code > . * @ param sPostalCode * The postal code to check . May be < code > null < / code > . * @ return { @ link ETriState # UNDEFINED ...
final IPostalCodeCountry aPostalCountry = getPostalCountryOfCountry ( aCountry ) ; if ( aPostalCountry == null ) return ETriState . UNDEFINED ; return ETriState . valueOf ( aPostalCountry . isValidPostalCode ( sPostalCode ) ) ;
public class Director { /** * Uninstalls product depending on dependencies * @ param checkDependency if uninstall should check for dependencies * @ param productIds Ids of product to uninstall * @ param toBeDeleted Collection of files to uninstall * @ throws InstallException */ public void uninstall ( boolean c...
getUninstallDirector ( ) . uninstall ( checkDependency , productIds , toBeDeleted ) ;
public class CrossTab { /** * Returns a table containing the column percents made from a source table , after first calculating the counts * cross - tabulated from the given columns */ public static Table columnPercents ( Table table , String column1 , String column2 ) { } }
return columnPercents ( table , table . categoricalColumn ( column1 ) , table . categoricalColumn ( column2 ) ) ;
public class Partition { /** * Fill the elements of a permutation from the first element of each * cell , up to the point < code > upTo < / code > . * @ param upTo take values from cells up to this one * @ return the permutation representing the first element of each cell */ public Permutation setAsPermutation ( ...
int [ ] p = new int [ upTo ] ; for ( int i = 0 ; i < upTo ; i ++ ) { p [ i ] = this . cells . get ( i ) . first ( ) ; } return new Permutation ( p ) ;
public class CudaMemoryManager { /** * This method detaches off - heap memory from passed INDArray instances , and optionally stores them in cache for future reuse * PLEASE NOTE : Cache options depend on specific implementations * @ param arrays */ @ Override public void collect ( INDArray ... arrays ) { } }
// we basically want to free memory , without touching INDArray itself . // so we don ' t care when gc is going to release object : memory is already cached Nd4j . getExecutioner ( ) . commit ( ) ; int cnt = - 1 ; AtomicAllocator allocator = AtomicAllocator . getInstance ( ) ; for ( INDArray array : arrays ) { cnt ++ ;...
public class Cache { /** * Special handling for msg . */ private boolean handleMessageMessengerMsg ( Message . MSG message ) { } }
if ( ! message . isMessenger ( ) ) return false ; if ( receiver == null ) return true ; setOwnerClockPut ( message ) ; if ( message . getLine ( ) == - 1 ) { receiver . receive ( message ) ; if ( message . isReplyRequired ( ) ) send ( Message . MSGACK ( message ) ) ; return true ; } CacheLine line = getLine ( message . ...
public class CliState { /** * This method initializes the { @ link BasicDoubleLinkedNode node } { @ link BasicDoubleLinkedNode # getValue ( ) containing } * an { @ link CliArgumentContainer } in order to determine the appropriate order of the { @ link CliArgument } s . * @ param node is the node to initialize ( lin...
CliArgumentContainer argumentContainer = node . getValue ( ) ; InitializationState state = argumentContainer . getState ( ) ; if ( ! state . isInitialized ( ) ) { if ( state . isInitializing ( ) ) { // cycle detected List < String > cycle = new ArrayList < > ( ) ; cycle . add ( argumentContainer . getId ( ) ) ; return ...
public class RPCParameter { /** * Adds ( or removes ) a vector value at the specified subscript . * @ param subscript Subscript specifier * @ param value Value ( if null , any existing value is removed ) . */ public void put ( String subscript , Object value ) { } }
if ( value == null ) { values . remove ( subscript ) ; } else { values . put ( subscript , value ) ; }
public class EditText { /** * Returns the value of the enum { @ link Typeface } , which corresponds to a specific value . * @ param value * The value * @ return The value of the enum { @ link Typeface } , which corresponds to the given value */ private Typeface parseTypeface ( final int value ) { } }
switch ( value ) { case TYPEFACE_SANS_SERIF_VALUE : return Typeface . SANS_SERIF ; case TYPEFACE_SERIF_VALUE : return Typeface . SERIF ; case TYPEFACE_MONOSPACE_VALUE : return Typeface . MONOSPACE ; default : return Typeface . DEFAULT ; }
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertTextOrientationBAxisToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class AbstractSocket { /** * Sets the most recently seen remote address . * If the provided value is different than the previous , will notify all listeners . */ protected void setRemoteSocketAddress ( final SocketAddress newRemoteSocketAddress ) { } }
synchronized ( remoteSocketAddressLock ) { final SocketAddress oldRemoteSocketAddress = this . remoteSocketAddress ; if ( ! newRemoteSocketAddress . equals ( oldRemoteSocketAddress ) ) { this . remoteSocketAddress = newRemoteSocketAddress ; listenerManager . enqueueEvent ( new ConcurrentListenerManager . Event < Socket...
public class VehicleManager { /** * Remove a previously registered source from the data pipeline . */ public void removeSource ( VehicleDataSource source ) { } }
if ( source != null ) { Log . i ( TAG , "Removing data source " + source ) ; mUserOriginPipeline . removeSource ( source ) ; }
public class SFSUtilities { /** * Find the first geometry field name of a resultSet . * Return - 1 if there is no geometry column * @ param resultSet ResultSet to analyse * @ return The name of first geometry field * @ throws SQLException */ public static String getFirstGeometryFieldName ( ResultSet resultSet )...
ResultSetMetaData meta = resultSet . getMetaData ( ) ; int columnCount = meta . getColumnCount ( ) ; for ( int i = 1 ; i <= columnCount ; i ++ ) { if ( meta . getColumnTypeName ( i ) . equalsIgnoreCase ( "geometry" ) ) { return meta . getColumnName ( i ) ; } } throw new SQLException ( "The query doesn't contain any geo...
public class JavaSoundPlayer { /** * = = = = End of public methods = = = = */ @ Override protected void play ( String pkgPath , String key , float pan ) { } }
addToPlayQueue ( new SoundKey ( PLAY , pkgPath , key , 0 , _clipVol , pan ) ) ;
public class SamlAssertionDecoder { /** * { @ inheritDoc } */ protected void doDecode ( MessageContext messageContext ) throws MessageDecodingException { } }
if ( ! ( messageContext instanceof SAMLMessageContext ) ) { log . error ( "Invalid message context type, this decoder only support SAMLMessageContext" ) ; throw new MessageDecodingException ( "Invalid message context type, this decoder only support SAMLMessageContext" ) ; } if ( ! ( messageContext . getInboundMessageTr...
public class RecurringData { /** * Retrieve the ordinal text for a given integer . * @ param value integer value * @ return ordinal text */ private String getOrdinal ( Integer value ) { } }
String result ; int index = value . intValue ( ) ; if ( index >= ORDINAL . length ) { result = "every " + index + "th" ; } else { result = ORDINAL [ index ] ; } return result ;
public class TrafficEstimatorServiceLocator { /** * For the given interface , get the stub implementation . * If this service has no port for the given interface , * then ServiceException is thrown . */ public java . rmi . Remote getPort ( Class serviceEndpointInterface ) throws javax . xml . rpc . ServiceException...
try { if ( com . google . api . ads . adwords . axis . v201809 . o . TrafficEstimatorServiceInterface . class . isAssignableFrom ( serviceEndpointInterface ) ) { com . google . api . ads . adwords . axis . v201809 . o . TrafficEstimatorServiceSoapBindingStub _stub = new com . google . api . ads . adwords . axis . v2018...
public class DifferentialFunctionFactory { /** * Max pooling 3d operation . * @ param input the inputs to pooling * @ param pooling3DConfig the configuration * @ return */ public SDVariable maxPooling3d ( SDVariable input , Pooling3DConfig pooling3DConfig ) { } }
pooling3DConfig . setType ( Pooling3D . Pooling3DType . MAX ) ; return pooling3d ( input , pooling3DConfig ) ;
public class InstancesController { /** * Register an instance . * @ param registration registration info * @ param builder UriComponentsBuilder * @ return The registered instance id ; */ @ PostMapping ( path = "/instances" , consumes = MediaType . APPLICATION_JSON_VALUE ) public Mono < ResponseEntity < Map < Stri...
Registration withSource = Registration . copyOf ( registration ) . source ( "http-api" ) . build ( ) ; LOGGER . debug ( "Register instance {}" , withSource ) ; return registry . register ( withSource ) . map ( id -> { URI location = builder . replacePath ( "/instances/{id}" ) . buildAndExpand ( id ) . toUri ( ) ; retur...
public class CPOptionUtil { /** * Returns the last cp option in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last m...
return getPersistence ( ) . fetchByUuid_C_Last ( uuid , companyId , orderByComparator ) ;
public class Bean { /** * Read the accelerometer range . * @ param callback the callback for the result */ public void readAccelerometerRange ( Callback < AccelerometerRange > callback ) { } }
addCallback ( BeanMessageID . CC_ACCEL_GET_RANGE , callback ) ; sendMessageWithoutPayload ( BeanMessageID . CC_ACCEL_GET_RANGE ) ;
public class AsyncBenchmark { /** * Main routine creates a benchmark instance and kicks off the run method . * @ param args Command line arguments . * @ throws Exception if anything goes wrong . * @ see { @ link VoterConfig } */ public static void main ( String [ ] args ) throws Exception { } }
// create a configuration from the arguments VoterConfig config = new VoterConfig ( ) ; config . parse ( AsyncBenchmark . class . getName ( ) , args ) ; AsyncBenchmark benchmark = new AsyncBenchmark ( config ) ; benchmark . runBenchmark ( ) ;
public class Right { /** * Supports column level rights */ boolean canTrigger ( Table table , boolean [ ] columnCheckList ) { } }
if ( isFull || isFullTrigger ) { return true ; } return containsAllColumns ( triggerColumnSet , table , columnCheckList ) ;
public class RelatedObjectSet { /** * Returns whether the current user has permission to alter the status of * the relation between the parent object and the given child objects . * @ param identifiers * The identifiers of all objects on the child side of the one - to - many * relation being changed . * @ ret...
// System administrators may alter any relations if ( getCurrentUser ( ) . getUser ( ) . isAdministrator ( ) ) return true ; // Non - admin users require UPDATE permission on the parent object . . . if ( ! getParentObjectEffectivePermissionSet ( ) . hasPermission ( ObjectPermission . Type . UPDATE , parent . getIdentif...
public class CacheManagementHelper { /** * Call { @ link # clearCache ( String ) } on ALL caches . */ public void clearAllCaches ( ) { } }
logger . warn ( "beginning request to clear all caches" ) ; for ( final String cacheName : this . cacheManager . getCacheNames ( ) ) { clearCache ( cacheName ) ; } logger . warn ( "completed request to clear all caches" ) ;
public class KnowledgeBuilderImpl { /** * This adds a package from a Descr / AST This will also trigger a compile , if * there are any generated classes to compile of course . */ public void addPackage ( final PackageDescr packageDescr ) { } }
PackageRegistry pkgRegistry = getOrCreatePackageRegistry ( packageDescr ) ; if ( pkgRegistry == null ) { return ; } // merge into existing package mergePackage ( pkgRegistry , packageDescr ) ; compileKnowledgePackages ( packageDescr , pkgRegistry ) ; wireAllRules ( ) ; compileRete ( packageDescr ) ;
public class Index { /** * Browse all index content */ public IndexBrowser browse ( Query params ) throws AlgoliaException { } }
return new IndexBrowser ( client , encodedIndexName , params , null , RequestOptions . empty ) ;
public class Command { /** * Finds out if a command is supported by Doradus * @ param commandsJson * @ param commandName * @ param storageService * @ return */ public static JsonObject matchCommand ( JsonObject commandsJson , String commandName , String storageService ) { } }
for ( String key : commandsJson . keySet ( ) ) { if ( key . equals ( storageService ) ) { JsonObject commandCats = commandsJson . getJsonObject ( key ) ; if ( commandCats . containsKey ( commandName ) ) { return commandCats . getJsonObject ( commandName ) ; } } } return null ;
public class State { /** * necessary different ) mode , and then a code . */ State latchAndAppend ( int mode , int value ) { } }
// assert binaryShiftByteCount = = 0; int bitCount = this . bitCount ; Token token = this . token ; if ( mode != this . mode ) { int latch = HighLevelEncoder . LATCH_TABLE [ this . mode ] [ mode ] ; token = token . add ( latch & 0xFFFF , latch >> 16 ) ; bitCount += latch >> 16 ; } int latchModeBitCount = mode == HighLe...
public class EmptyOperator { /** * Applies the operator to the given value */ public Object apply ( Object pValue , Object pContext , Logger pLogger ) throws ELException { } }
// See if the value is null if ( pValue == null ) { return PrimitiveObjects . getBoolean ( true ) ; } // See if the value is a zero - length String else if ( "" . equals ( pValue ) ) { return PrimitiveObjects . getBoolean ( true ) ; } // See if the value is a zero - length array else if ( pValue . getClass ( ) . isArra...
public class Beacon { /** * Required for making object Parcelable . If you override this class , you must override this * method if you add any additional fields . */ @ Deprecated public void writeToParcel ( Parcel out , int flags ) { } }
out . writeInt ( mIdentifiers . size ( ) ) ; for ( Identifier identifier : mIdentifiers ) { out . writeString ( identifier == null ? null : identifier . toString ( ) ) ; } out . writeDouble ( getDistance ( ) ) ; out . writeInt ( mRssi ) ; out . writeInt ( mTxPower ) ; out . writeString ( mBluetoothAddress ) ; out . wri...
public class ExampleLookupTable { /** * { @ inheritDoc } */ @ Override public List < Object > getTable ( final Object table ) { } }
List < Object > data = new ArrayList < > ( ) ; String tableName ; if ( table instanceof TableWithNullOption ) { // Get source table name tableName = ( ( TableWithNullOption ) table ) . getTableName ( ) ; // Insert null option data . add ( null ) ; } else { tableName = ( String ) table ; } for ( String [ ] row : TABLE_D...
public class RiakClient { /** * Static factory method to create a new client instance . * @ since 2.0.6 */ public static RiakClient newClient ( Collection < HostAndPort > hosts , RiakNode . Builder nodeBuilder ) throws UnknownHostException { } }
final RiakCluster cluster = new RiakCluster . Builder ( hosts , nodeBuilder ) . build ( ) ; cluster . start ( ) ; return new RiakClient ( cluster ) ;
public class WebJsMessageFactoryImpl { /** * Decode a map message */ private static JsJmsMessage decodeMapBody ( String body ) throws MessageDecodeFailedException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "decodeMapBody" ) ; JsJmsMapMessage result = new JsJmsMapMessageImpl ( MfpConstants . CONSTRUCTOR_NO_OP ) ; if ( body != null ) { try { StringTokenizer st = new StringTokenizer ( body , "&" ) ; while ( st . hasMoreTokens ( )...
public class LazySetterMethod { /** * Invokes the getter / setter chain based on the source object . First of all * the actual arguments are determined by invoking LazyGetterMethod objects * that have been passed during construction . Then the getter chain is * invoked to determine the actual object on which to i...
Object valueToPass = value ; if ( valueToPass != null && valueToPass instanceof LazyGetterMethod ) { valueToPass = ( ( LazyGetterMethod ) valueToPass ) . invoke ( ) ; } expression . setValue ( target , valueToPass ) ;
public class A_CmsAjaxGallery { /** * Creates a JSON object with the information found on the given gallery URL . < p > * @ param galleryUrl the given gallery URL */ protected void buildJsonGalleryItem ( String galleryUrl ) { } }
try { JspWriter out = getJsp ( ) . getJspContext ( ) . getOut ( ) ; if ( getCms ( ) . existsResource ( galleryUrl ) ) { JSONObject jsonObj = new JSONObject ( ) ; try { CmsResource res = getCms ( ) . readResource ( galleryUrl ) ; String path = getCms ( ) . getSitePath ( res ) ; // read the gallery title String title = g...
public class CloudwatchLogsExportConfiguration { /** * The list of log types to disable . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setDisableLogTypes ( java . util . Collection ) } or { @ link # withDisableLogTypes ( java . util . Collection ) } if you...
if ( this . disableLogTypes == null ) { setDisableLogTypes ( new com . amazonaws . internal . SdkInternalList < String > ( disableLogTypes . length ) ) ; } for ( String ele : disableLogTypes ) { this . disableLogTypes . add ( ele ) ; } return this ;
public class RowSetUtil { /** * Splits the provided { @ link RowSet } into segments partitioned by the provided { @ code * splitPoints } . Each split point represents the last row of the corresponding segment . The row * keys contained in the provided { @ link RowSet } will be distributed across the segments . Each...
return split ( rowSet , splitPoints , false ) ;
public class MESubscription { /** * Gets the object that was stored in the Matchspace * @ return */ public ControllableProxySubscription getMatchspaceSub ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getMatchspaceSub" ) ; SibTr . exit ( tc , "getMatchspaceSub" , _controllableProxySubscription ) ; } return _controllableProxySubscription ;
public class UTF8String { /** * Concatenates input strings together into a single string using the separator . * A null input is skipped . For example , concat ( " , " , " a " , null , " c " ) would yield " a , c " . */ public static UTF8String concatWs ( UTF8String separator , UTF8String ... inputs ) { } }
if ( separator == null ) { return null ; } int numInputBytes = 0 ; // total number of bytes from the inputs int numInputs = 0 ; // number of non - null inputs for ( int i = 0 ; i < inputs . length ; i ++ ) { if ( inputs [ i ] != null ) { numInputBytes += inputs [ i ] . numBytes ; numInputs ++ ; } } if ( numInputs == 0 ...