signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class DataSet { /** * Returns a new version of this data set that is of the same type , and
* contains a different listing pointing to shallow data point copies .
* Because the data point object contains the weight itself , the weight
* is not shared - while the vector and array information is . This
* a... | DataSet clone = shallowClone ( ) ; for ( int i = 0 ; i < clone . size ( ) ; i ++ ) { DataPoint d = getDataPoint ( i ) ; DataPoint sd = new DataPoint ( d . getNumericalValues ( ) , d . getCategoricalValues ( ) , d . getCategoricalData ( ) ) ; clone . setDataPoint ( i , sd ) ; } return clone ; |
public class ScheduleAsyncPersistencePRequest { /** * < code > optional . alluxio . grpc . file . ScheduleAsyncPersistencePOptions options = 2 ; < / code > */
public alluxio . grpc . ScheduleAsyncPersistencePOptions getOptions ( ) { } } | return options_ == null ? alluxio . grpc . ScheduleAsyncPersistencePOptions . getDefaultInstance ( ) : options_ ; |
public class LogSequenceNumber { /** * Create LSN instance by string represent LSN .
* @ param strValue not null string as two hexadecimal numbers of up to 8 digits each , separated by
* a slash . For example { @ code 16/3002D50 } , { @ code 0/15D68C50}
* @ return not null LSN instance where if specified string r... | int slashIndex = strValue . lastIndexOf ( '/' ) ; if ( slashIndex <= 0 ) { return INVALID_LSN ; } String logicalXLogStr = strValue . substring ( 0 , slashIndex ) ; int logicalXlog = ( int ) Long . parseLong ( logicalXLogStr , 16 ) ; String segmentStr = strValue . substring ( slashIndex + 1 , strValue . length ( ) ) ; i... |
public class JspVisitor { /** * validate the children ) . */
protected boolean shouldSkipChildren ( Element jspElement ) throws JspCoreException { } } | if ( ! shouldSkipChildrenForThisVisitor ( ) ) { return false ; } String uri = jspElement . getNamespaceURI ( ) ; String name = jspElement . getLocalName ( ) ; NodeList children ; // First , see if this is a < jsp : body > tag .
if ( uri . equalsIgnoreCase ( Constants . JSP_NAMESPACE ) && name . equalsIgnoreCase ( Const... |
public class BundleArchive { /** * This method will return a bundle entry URL for the supplied path , it will test for both a normal entry and a directory entry for it .
* @ param pathAndName The path to the entry
* @ return The URL for the bundle entry */
@ FFDCIgnore ( IllegalStateException . class ) public URL g... | try { URL bundleEntry = bundleToTest . getEntry ( pathAndName ) ; /* * Defect 54588 discovered that if a directory does not have a zip entry then calling getEntry will return null unless the path has a " / " on the end so if we have null
* still then add a " / " on the end of the path and retest */
if ( bundleEntry =... |
public class HostActiveDirectoryAuthentication { /** * Install a trust anchor certificate for smart card authentication .
* @ param cert SSL certificate in PEM format
* @ throws HostConfigFault
* @ throws RuntimeFault
* @ throws RemoteException
* @ since 6.0 */
public void installSmartCardTrustAnchor ( String... | getVimService ( ) . installSmartCardTrustAnchor ( getMOR ( ) , cert ) ; |
public class CommonServerReceiveListener { /** * This method is used to inform the client that we are rejecting their handshake . Typically
* this will never happen unless a third party client is written , or an internal error occurs .
* However , we should check for an inproperly formatted handshake and inform the... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "rejectHandshake" , new Object [ ] { conversation , requestNumber , rejectedField } ) ; SIConnectionLostException exception = new SIConnectionLostException ( nls . getFormattedMessage ( "INVALID_PROP_SICO8012" , null ... |
public class CollUtil { /** * 将多个集合排序并显示不同的段落 ( 分页 ) < br >
* 采用 { @ link BoundedPriorityQueue } 实现分页取局部
* @ param < T > 集合元素类型
* @ param pageNo 页码 , 从1开始计数 , 0和1效果相同
* @ param pageSize 每页的条目数
* @ param comparator 比较器
* @ param colls 集合数组
* @ return 分页后的段落内容 */
@ SafeVarargs public static < T > List < T >... | final List < T > list = new ArrayList < > ( pageNo * pageSize ) ; for ( Collection < T > coll : colls ) { list . addAll ( coll ) ; } if ( null != comparator ) { Collections . sort ( list , comparator ) ; } return page ( pageNo , pageSize , list ) ; |
public class DebugUtil { /** * Builds a javadoc - like presentation of the top wrapped class fields and methods of a { @ code java . lang . Object } .
* @ param pObject the { @ code java . lang . Object } to be analysed .
* @ param pObjectName the name of the object instance , for identification purposes .
* @ re... | if ( pObject == null ) { return OBJECT_IS_NULL_ERROR_MESSAGE ; } final String endOfLine = System . getProperty ( "line.separator" ) ; final String dividerLine = "---------------------------------------------------------" ; Class c = pObject . getClass ( ) ; StringTokenizer tokenizedString ; String str ; String classNam... |
public class StoredPaymentChannelServerStates { /** * If the broadcaster has not been set for MAX _ SECONDS _ TO _ WAIT _ FOR _ BROADCASTER _ TO _ BE _ SET seconds , then
* the programmer probably forgot to set it and we should throw exception . */
private TransactionBroadcaster getBroadcaster ( ) { } } | try { return broadcasterFuture . get ( MAX_SECONDS_TO_WAIT_FOR_BROADCASTER_TO_BE_SET , TimeUnit . SECONDS ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( e ) ; } catch ( ExecutionException e ) { throw new RuntimeException ( e ) ; } catch ( TimeoutException e ) { String err = "Transaction broadcast... |
public class XalanGroupMembershipHelperBean { /** * / * ( non - Javadoc )
* @ see org . apereo . portal . security . xslt . IXalanGroupMembershipHelper # isUserDeepMemberOfGroupName ( java . lang . String , java . lang . String )
* groupName is case sensitive . */
@ Override public boolean isUserDeepMemberOfGroupNa... | final EntityIdentifier [ ] results = GroupService . searchForGroups ( groupName , GroupService . SearchMethod . DISCRETE , IPerson . class ) ; if ( results == null || results . length == 0 ) { return false ; } if ( results . length > 1 ) { this . logger . warn ( results . length + " groups were found for '" + groupName... |
public class RemoteTaskRunner { /** * A task will be run only if there is no current knowledge in the RemoteTaskRunner of the task .
* @ param task task to run */
@ Override public ListenableFuture < TaskStatus > run ( final Task task ) { } } | final RemoteTaskRunnerWorkItem completeTask , runningTask , pendingTask ; if ( ( pendingTask = pendingTasks . get ( task . getId ( ) ) ) != null ) { log . info ( "Assigned a task[%s] that is already pending!" , task . getId ( ) ) ; runPendingTasks ( ) ; return pendingTask . getResult ( ) ; } else if ( ( runningTask = r... |
public class XTreeDirectoryEntry { /** * Calls the super method and reads the MBR object of this entry from the
* specified input stream .
* @ param in the stream to read data from in order to restore the object
* @ throws java . io . IOException if I / O errors occur
* @ throws ClassNotFoundException If the cl... | super . readExternal ( in ) ; this . splitHistory = SplitHistory . readExternal ( in ) ; |
public class JsonUtils { /** * Add quotes around the object iff it ' s not a JSON object .
* @ param source
* @ return */
static Object quoteIfNeeded ( Object source ) { } } | if ( source instanceof String ) { return quoteIfNeeded ( ( String ) source ) ; } else { return source ; } |
public class DefaultYAMLParser { /** * the generated parser , with debugging messages .
* Maintains a dynamic state and value stack .
* @ param yyLex scanner .
* @ param yydebug debug message writer implementing < tt > yyDebug < / tt > , or < tt > null < / tt > .
* @ return result of the last reduction , if any... | // t this . yydebug = ( jay . yydebug . yyDebug ) yydebug ;
return yyparse ( yyLex ) ; |
public class CacheableExtractableDataSetFetcher { /** * Downloads and extracts the local dataset .
* @ throws IOException */
public void downloadAndExtract ( DataSetType set ) throws IOException { } } | String localFilename = new File ( remoteDataUrl ( set ) ) . getName ( ) ; File tmpFile = new File ( System . getProperty ( "java.io.tmpdir" ) , localFilename ) ; File localCacheDir = getLocalCacheDir ( ) ; // check empty cache
if ( localCacheDir . exists ( ) ) { File [ ] list = localCacheDir . listFiles ( ) ; if ( list... |
public class BoxStoragePolicyAssignment { /** * Create a BoxStoragePolicyAssignment for a BoxStoragePolicy .
* @ param api the API connection to be used by the resource .
* @ param policyID the policy ID of the BoxStoragePolicy .
* @ param userID the user ID of the to assign the BoxStoragePolicy to .
* @ return... | URL url = STORAGE_POLICY_ASSIGNMENT_URL_TEMPLATE . build ( api . getBaseURL ( ) ) ; BoxJSONRequest request = new BoxJSONRequest ( api , url , HttpMethod . POST ) ; JsonObject requestJSON = new JsonObject ( ) . add ( "storage_policy" , new JsonObject ( ) . add ( "type" , "storage_policy" ) . add ( "id" , policyID ) ) . ... |
public class Permutations { /** * Get a random sample of k out of n elements .
* See Algorithm S , D . E . Knuth , The Art of Computer Programming , Vol . 2 , p . 142. */
public static int [ ] randomSubset ( int k , int n ) { } } | assert ( 0 < k && k <= n ) ; Random r = new Random ( ) ; int t = 0 , m = 0 ; int [ ] result = new int [ k ] ; while ( m < k ) { double u = r . nextDouble ( ) ; if ( ( n - t ) * u < k - m ) { result [ m ] = t ; m ++ ; } t ++ ; } return result ; |
public class UrlPatternAnalyzer { public UrlPatternChosenBox choose ( Method executeMethod , String mappingMethodName , String specifiedUrlPattern , List < Class < ? > > pathParamTypeList ) { } } | checkSpecifiedUrlPattern ( executeMethod , specifiedUrlPattern , pathParamTypeList ) ; final UrlPatternChosenBox chosenBox ; if ( specifiedUrlPattern != null && ! specifiedUrlPattern . isEmpty ( ) ) { // e . g . urlPattern = " { } "
chosenBox = adjustUrlPatternMethodPrefix ( executeMethod , specifiedUrlPattern , mappin... |
public class ContentStoreImpl { /** * { @ inheritDoc } */
@ Override public void validateSpaceId ( String spaceId ) throws InvalidIdException { } } | try { IdUtil . validateSpaceId ( spaceId ) ; } catch ( org . duracloud . storage . error . InvalidIdException e ) { throw new InvalidIdException ( e . getMessage ( ) ) ; } |
public class PrivateKeyUsageExtension { /** * Delete the attribute value .
* @ exception CertificateException on attribute handling errors . */
public void delete ( String name ) throws CertificateException , IOException { } } | if ( name . equalsIgnoreCase ( NOT_BEFORE ) ) { notBefore = null ; } else if ( name . equalsIgnoreCase ( NOT_AFTER ) ) { notAfter = null ; } else { throw new CertificateException ( "Attribute name not recognized by" + " CertAttrSet:PrivateKeyUsage." ) ; } encodeThis ( ) ; |
public class Initializer { /** * Filters element or list fields , and if their associated objects implement
* { @ link com . redhat . darcy . ui . api . HasElementContext } , calls
* { @ link com . redhat . darcy . ui . api . HasElementContext # setContext ( com . redhat . darcy . ui . api . ElementContext ) }
* ... | fields . stream ( ) . filter ( f -> HasElementContext . class . isAssignableFrom ( f . getType ( ) ) || Element . class . isAssignableFrom ( f . getType ( ) ) || List . class . isAssignableFrom ( f . getType ( ) ) ) // TODO : . filter ( f - > f . getAnnotation ( IndependentContext . class ) = = null )
. map ( f -> { tr... |
public class BufferedWriteFilter { /** * Flushes the buffered data .
* @ param session the session where buffer will be written */
public void flush ( IoSession session ) { } } | try { internalFlush ( session . getFilterChain ( ) . getNextFilter ( this ) , session , buffersMap . get ( session ) ) ; } catch ( Throwable e ) { session . getFilterChain ( ) . fireExceptionCaught ( e ) ; } |
public class TransformationUtils { /** * Get the affine transform that brings from the world envelope to the rectangle .
* @ param worldEnvelope the envelope .
* @ param pixelRectangle the destination rectangle .
* @ return the transform . */
public static AffineTransform getWorldToPixel ( Envelope worldEnvelope ... | double width = pixelRectangle . getWidth ( ) ; double worldWidth = worldEnvelope . getWidth ( ) ; double height = pixelRectangle . getHeight ( ) ; double worldHeight = worldEnvelope . getHeight ( ) ; AffineTransform translate = AffineTransform . getTranslateInstance ( - worldEnvelope . getMinX ( ) , - worldEnvelope . g... |
public class TreeUtils { /** * Sorts children of a node using a comparator
* @ param node Node instance whose children to be sorted
* @ param comparator Comparator to use in sorting */
public static void sortNode ( TreeNode node , Comparator comparator ) { } } | TreeNodeList children = ( TreeNodeList ) node . getChildren ( ) ; if ( children != null && ! children . isEmpty ( ) ) { Object [ ] childrenArray = children . toArray ( ) ; Arrays . sort ( childrenArray , comparator ) ; for ( int i = 0 ; i < childrenArray . length ; i ++ ) { children . setSibling ( i , ( TreeNode ) chil... |
public class VoiceApi { /** * Resume recording a call
* Resume recording the specified call .
* @ param id The connection ID of the call . ( required )
* @ param resumeRecordingBody Request parameters . ( optional )
* @ return ApiResponse & lt ; ApiSuccessResponse & gt ;
* @ throws ApiException If fail to cal... | com . squareup . okhttp . Call call = resumeRecordingValidateBeforeCall ( id , resumeRecordingBody , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class CPDefinitionGroupedEntryPersistenceImpl { /** * Removes all the cp definition grouped entries where uuid = & # 63 ; and companyId = & # 63 ; from the database .
* @ param uuid the uuid
* @ param companyId the company ID */
@ Override public void removeByUuid_C ( String uuid , long companyId ) { } } | for ( CPDefinitionGroupedEntry cpDefinitionGroupedEntry : findByUuid_C ( uuid , companyId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cpDefinitionGroupedEntry ) ; } |
public class LongTuples { /** * Computes the minimum value that occurs in the given tuple ,
* or < code > Long . MAX _ VALUE < / code > if the given tuple has a
* size of 0.
* @ param t The input tuple
* @ return The minimum value */
public static long min ( LongTuple t ) { } } | return LongTupleFunctions . reduce ( t , Long . MAX_VALUE , Math :: min ) ; |
public class TarExporterImpl { /** * { @ inheritDoc }
* @ see org . jboss . shrinkwrap . api . exporter . StreamExporter # exportAsInputStream ( ) */
@ Override public InputStream exportAsInputStream ( ) { } } | // Create export delegate
final AbstractExporterDelegate < InputStream > exportDelegate = new TarExporterDelegate ( this . getArchive ( ) ) ; // Execute export
return exportDelegate . export ( ) ; |
public class BaseListener { /** * Get then next enabled listener in the chain .
* @ return The next enabled listener ( of null if none ) . */
public BaseListener getNextEnabledListener ( ) { } } | if ( m_nextListener == null ) return null ; if ( m_nextListener . isEnabled ( ) ) return m_nextListener ; else return m_nextListener . getNextEnabledListener ( ) ; |
public class JMThread { /** * Sleep .
* @ param millis the millis */
public static void sleep ( long millis ) { } } | try { Thread . sleep ( millis ) ; } catch ( InterruptedException e ) { JMExceptionManager . handleException ( log , e , "sleep" , millis ) ; } |
public class FtpPickerFragment { /** * Name is validated to be non - null , non - empty and not containing any
* slashes .
* @ param name The name of the folder the user wishes to create . */
@ Override public void onNewFolder ( @ NonNull String name ) { } } | AsyncTask < String , Void , FtpFile > task = new AsyncTask < String , Void , FtpFile > ( ) { @ Override protected FtpFile doInBackground ( String ... names ) { FtpFile result = null ; if ( names . length > 0 ) { result = onNewFolderAsync ( names [ 0 ] ) ; } return result ; } @ Override protected void onPostExecute ( Ft... |
public class TagService { /** * Returns the tags that were root in the definition files . These serve as entry point shortcuts when browsing the graph . We could reduce this to
* just fewer as the root tags may be connected through parents = " . . . " . */
public List < Tag > getRootTags ( ) { } } | return this . definedTags . values ( ) . stream ( ) . filter ( Tag :: isRoot ) . collect ( Collectors . toList ( ) ) ; |
public class IDEStructureImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . IDE_STRUCTURE__FLAGS : return FLAGS_EDEFAULT == null ? flags != null : ! FLAGS_EDEFAULT . equals ( flags ) ; case AfplibPackage . IDE_STRUCTURE__FORMAT : return FORMAT_EDEFAULT == null ? format != null : ! FORMAT_EDEFAULT . equals ( format ) ; case AfplibPackage . IDE_STRUCTU... |
public class DevicesStatusApi { /** * Update Device Status
* Update Device Status
* @ param deviceId Device ID . ( required )
* @ param body Body ( optional )
* @ return DeviceStatus
* @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */
public Device... | ApiResponse < DeviceStatus > resp = putDeviceStatusWithHttpInfo ( deviceId , body ) ; return resp . getData ( ) ; |
public class MethodProducerFactory { /** * Producers returned from this method are not validated . This is an optimization for { @ link ProducerMethod } whose injection points are validated anyway . Internal use only . */
public < T > Producer < T > createProducer ( final Bean < X > declaringBean , final Bean < T > bea... | EnhancedAnnotatedMethod < T , X > enhancedMethod = getManager ( ) . getServices ( ) . get ( MemberTransformer . class ) . loadEnhancedMember ( method , getManager ( ) . getId ( ) ) ; return new ProducerMethodProducer < X , T > ( enhancedMethod , disposalMethod ) { @ Override public AnnotatedMethod < X > getAnnotated ( ... |
public class FilterErrorEvent { /** * Get the original cause of the error .
* Use of ServletExceptions by the engine to rethrow errors
* can cause the original error to be buried within one or more
* exceptions . This method will sift through the wrapped ServletExceptions
* to return the original error . */
pub... | Throwable root = getError ( ) ; while ( true ) { if ( root instanceof ServletException ) { ServletException se = ( ServletException ) _error ; Throwable seRoot = se . getRootCause ( ) ; if ( seRoot == null ) { return root ; } else if ( seRoot . equals ( root ) ) { // prevent possible recursion
return root ; } else { ro... |
public class Reflect { /** * Invokes a method with a given name and arguments with the most specific method possible
* @ param methodName The name of the method
* @ param args The arguments to the method
* @ return A Reflect object representing the results
* @ throws ReflectionException Something went wrong inv... | Class [ ] types = ReflectionUtils . getTypes ( args ) ; try { return on ( clazz . getMethod ( methodName , types ) , object , accessAll , args ) ; } catch ( NoSuchMethodException e ) { Method method = ReflectionUtils . bestMatchingMethod ( getMethods ( ) , methodName , types ) ; if ( method != null ) { return on ( meth... |
public class NioChildDatagramChannel { /** * Joins the specified multicast group at the specified interface using the specified source . */
public ChannelFuture joinGroup ( InetAddress multicastAddress , NetworkInterface networkInterface , InetAddress source ) { } } | if ( DetectionUtil . javaVersion ( ) < 7 ) { throw new UnsupportedOperationException ( ) ; } if ( multicastAddress == null ) { throw new NullPointerException ( "multicastAddress" ) ; } if ( networkInterface == null ) { throw new NullPointerException ( "networkInterface" ) ; } try { MembershipKey key ; if ( source == nu... |
public class WebXmlScannerPlugin { /** * Set the value for an async supported on the given descriptor .
* @ param asyncSupportedDescriptor
* The async supported descriptor .
* @ param asyncSupported
* The value . */
private void setAsyncSupported ( AsyncSupportedDescriptor asyncSupportedDescriptor , TrueFalseTy... | if ( asyncSupported != null ) { asyncSupportedDescriptor . setAsyncSupported ( asyncSupported . isValue ( ) ) ; } |
public class HCCol { /** * Create a new column with a certain percentage .
* @ param nPerc
* The percentage to be used . Should ideally be between 0 and 100.
* @ return Never < code > null < / code > . */
@ Nonnull public static HCCol perc ( @ Nonnegative final int nPerc ) { } } | return new HCCol ( ) . setWidth ( ECSSUnit . perc ( nPerc ) ) ; |
public class EntityDeepJobConfig { /** * Given an instance of the generic object mapped to this configurtion object ,
* sets the instance property whose name is the name specified by dbName .
* Since the provided dbName is the name of the field in the database , we first try
* to resolve the property name using t... | Map < String , Cell > cfs = columnDefinitions ( ) ; Cell metadataCell = cfs . get ( dbName ) ; String f = mapDBNameToEntityName . get ( dbName ) ; if ( StringUtils . isEmpty ( f ) ) { // DB column is not mapped in the testentity
return ; } try { Method setter = Utils . findSetter ( f , entityClass , value . getClass ( ... |
public class JQMCommon { /** * Expensive , based on jQuery , but gives realistic visibility ( CSS rules , parent chain considered ,
* width and height are explicitly set to 0 , . . . )
* < br > If you need logical visibility of this particular widget ,
* use { @ link UIObject # isVisible ( Element elem ) } */
pub... | if ( widget == null || ! widget . isAttached ( ) ) return false ; Element elt = widget . getElement ( ) ; return UIObject . isVisible ( elt ) && Mobile . isVisible ( elt ) ; |
public class LoginResponseParser { /** * { @ inheritDoc } */
@ Override protected final void checkIntegrity ( ) throws InternetSCSIException { } } | String exceptionMessage ; do { if ( status != LoginStatus . SUCCESS && statusSequenceNumber != 0 ) { exceptionMessage = "While no successful login is preformed, the StatusSequenceNumber must be 0." ; break ; } // message is checked correctly
return ; } while ( false ) ; throw new InternetSCSIException ( exceptionMessag... |
public class DescribeClustersRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeClustersRequest describeClustersRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeClustersRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeClustersRequest . getClusters ( ) , CLUSTERS_BINDING ) ; protocolMarshaller . marshall ( describeClustersRequest . getInclude ( ) , INCLUDE_BINDING ) ; }... |
public class ConvertBase { /** * Convert the tabs to spaces . */
public String tabsToSpaces ( String string ) { } } | int iOffset = 0 ; for ( int i = 0 ; i < string . length ( ) ; i ++ ) { if ( string . charAt ( i ) == '\n' ) iOffset = i + 1 ; if ( string . charAt ( i ) == '\t' ) { int iSpaces = ( i - iOffset ) % 4 ; if ( iSpaces == 0 ) iSpaces = 4 ; string = string . substring ( 0 , i ) + FOUR_SPACES . substring ( 0 , iSpaces ) + str... |
public class RaidCodec { /** * Count the number of live replicas of each parity block in the raided file
* If any stripe has not enough parity block replicas , add the stripe to
* raidEncodingTasks to schedule encoding .
* If forceAdd is true , we always add the stripe to raidEncodingTasks
* without checking
... | boolean result = true ; BlockInfo [ ] blocks = sourceINode . getBlocks ( ) ; for ( int i = 0 ; i < blocks . length ; i += numStripeBlocks ) { boolean hasParity = true ; if ( ! forceAdd ) { for ( int j = 0 ; j < numParityBlocks ; j ++ ) { if ( fs . countLiveNodes ( blocks [ i + j ] ) < this . parityReplication ) { hasPa... |
public class FileOutputFormat { /** * Helper function to generate a { @ link Path } for a file that is unique for
* the task within the job output directory .
* < p > The path can be used to create custom files from within the map and
* reduce tasks . The path name will be unique for each task . The path parent
... | return new Path ( getWorkOutputPath ( conf ) , getUniqueName ( conf , name ) ) ; |
public class CPUMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CPU cPU , ProtocolMarshaller protocolMarshaller ) { } } | if ( cPU == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( cPU . getFrequency ( ) , FREQUENCY_BINDING ) ; protocolMarshaller . marshall ( cPU . getArchitecture ( ) , ARCHITECTURE_BINDING ) ; protocolMarshaller . marshall ( cPU . getClock ( ... |
public class JsonReader { /** * Consumes { @ code expected } . */
private void expect ( JsonToken expected ) throws IOException { } } | peek ( ) ; if ( token != expected ) { throw new IllegalStateException ( "Expected " + expected + " but was " + peek ( ) ) ; } advance ( ) ; |
public class FileListFromTaskNextOptions { /** * Set the time the request was issued . Client libraries typically set this to the current system clock time ; set it explicitly if you are calling the REST API directly .
* @ param ocpDate the ocpDate value to set
* @ return the FileListFromTaskNextOptions object itse... | if ( ocpDate == null ) { this . ocpDate = null ; } else { this . ocpDate = new DateTimeRfc1123 ( ocpDate ) ; } return this ; |
public class LocatorSelectionStrategy { /** * ( non - Javadoc )
* @ see
* org . apache . cxf . clustering . FailoverStrategy # getAlternateAddresses ( org .
* apache . cxf . message . Exchange ) */
@ Override public List < String > getAlternateAddresses ( Exchange exchange ) { } } | return locatorCache . getFailoverEndpoints ( getServiceName ( exchange ) ) ; |
public class Job { /** * Forks computation of this job .
* < p > The call does not block . < / p >
* @ return always returns this job . */
public Job fork ( ) { } } | init ( ) ; H2OCountedCompleter task = new H2OCountedCompleter ( ) { @ Override public void compute2 ( ) { try { try { // Exec always waits till the end of computation
Job . this . exec ( ) ; Job . this . remove ( ) ; } catch ( Throwable t ) { if ( ! ( t instanceof ExpectedExceptionForDebug ) ) Log . err ( t ) ; Job . t... |
public class AbstractMappingHTTPResponseHandler { /** * This function initializes the component . */
@ Override protected void initializeImpl ( ) { } } | super . initializeImpl ( ) ; // init maps
this . faxActionType2ReponseDataPathMap = new HashMap < FaxActionType , String > ( ) ; this . statusString2FaxStatusMap = new HashMap < String , FaxJobStatus > ( ) ; // populate maps
this . populateFaxActionType2ReponseDataPathMappings ( ) ; this . populateStatusString2FaxStatu... |
public class UnicodeSet { /** * TODO : create class Appendables ?
* @ throws IOException */
private static void append ( Appendable app , CharSequence s ) { } } | try { app . append ( s ) ; } catch ( IOException e ) { throw new ICUUncheckedIOException ( e ) ; } |
public class BinaryContentUploadServlet { /** * Determines content - type of the uploaded file .
* @ param items
* @ return the content type */
private String getContentType ( List < FileItem > items ) { } } | for ( FileItem i : items ) { if ( ! i . isFormField ( ) && i . getFieldName ( ) . equals ( CONTENT_PARAMETER ) ) { return i . getContentType ( ) ; } } return null ; |
public class BundleAdjustmentProjectiveSchurJacobian { /** * Internal matrix type agnostic process function .
* @ param input Input parameters describing the current state of the optimization
* @ param leftPoint Storage for left Jacobian
* @ param rightView Storage for right Jacobian */
public void processInterna... | int numRows = getNumOfOutputsM ( ) ; int numPointParam = structure . points . length * lengthPoint ; int numViewParam = numParameters - numPointParam ; // view + camera
( ( ReshapeMatrix ) leftPoint ) . reshape ( numRows , numPointParam ) ; ( ( ReshapeMatrix ) rightView ) . reshape ( numRows , numViewParam ) ; leftPoin... |
public class UriSpec { /** * Build into a UriSpec string
* @ param serviceInstance instance to use for pre - defined replacement fields
* @ return UriSpec string */
public String build ( ServiceInstance < ? > serviceInstance ) { } } | return build ( serviceInstance , Maps . < String , Object > newHashMap ( ) ) ; |
public class Days { /** * Creates a < code > Days < / code > representing the number of whole days
* between the two specified partial datetimes .
* The two partials must contain the same fields , for example you can specify
* two < code > LocalDate < / code > objects .
* @ param start the start partial date , ... | if ( start instanceof LocalDate && end instanceof LocalDate ) { Chronology chrono = DateTimeUtils . getChronology ( start . getChronology ( ) ) ; int days = chrono . days ( ) . getDifference ( ( ( LocalDate ) end ) . getLocalMillis ( ) , ( ( LocalDate ) start ) . getLocalMillis ( ) ) ; return Days . days ( days ) ; } i... |
public class TokenParser { /** * Convert the given string into tokens .
* @ param text the text
* @ param tokenize whether to tokenize
* @ return the token [ ] */
public static Token [ ] makeTokens ( String text , boolean tokenize ) { } } | if ( text == null ) { return null ; } Token [ ] tokens ; if ( tokenize ) { tokens = parse ( text ) ; } else { tokens = new Token [ 1 ] ; tokens [ 0 ] = new Token ( text ) ; } return tokens ; |
public class GetImportRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetImportRequest getImportRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getImportRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getImportRequest . getImportId ( ) , IMPORTID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessa... |
public class WestCacheConnector { /** * Connect the cache with the new cached value .
* @ param runnable Runnable to call cached method .
* @ param cachedValue new cached value
* @ param < T > cached value type
* @ return cached value . */
@ SuppressWarnings ( "unchecked" ) public static < T > T connectCache ( ... | THREAD_LOCAL . set ( Optional . fromNullable ( cachedValue ) ) ; @ Cleanup QuietCloseable i = ( ) -> THREAD_LOCAL . remove ( ) ; runnable . run ( ) ; return ( T ) THREAD_LOCAL . get ( ) . orNull ( ) ; |
public class MediaWikiApiErrorHandler { /** * Creates and throws a suitable { @ link MediaWikiApiErrorException } for the
* given error code and message .
* @ param errorCode
* the error code reported by MediaWiki
* @ param errorMessage
* the error message reported by MediaWiki , or any other
* meaningful m... | switch ( errorCode ) { case ERROR_NO_TOKEN : case ERROR_INVALID_TOKEN : throw new TokenErrorException ( errorCode , errorMessage ) ; case ERROR_EDIT_CONFLICT : throw new EditConflictErrorException ( errorMessage ) ; case ERROR_NO_SUCH_ENTITY : throw new NoSuchEntityErrorException ( errorMessage ) ; case ERROR_MAXLAG : ... |
public class SiftsXMLParser { /** * < residue dbResNum = " 1 " dbResName = " THR " >
* < crossRefDb dbSource = " PDB " dbVersion = " 20101103"
* dbCoordSys = " PDBresnum " dbAccessionId = " 1a4w " dbResNum = " 1H "
* dbResName = " THR " dbChainId = " L " > < / crossRefDb >
* < crossRefDb dbSource = " UniProt " ... | SiftsResidue res = new SiftsResidue ( ) ; String dbResNumS = residue . getAttribute ( "dbResNum" ) ; res . setNaturalPos ( Integer . parseInt ( dbResNumS ) ) ; String seqResName = residue . getAttribute ( "dbResName" ) ; res . setSeqResName ( seqResName ) ; boolean observed = true ; List < String > details = getTextVal... |
public class MPDPlayer { /** * Sends the appropriate { @ link PlayerChangeEvent } to all registered
* { @ link PlayerChangeListener } s .
* @ param event the { @ link PlayerChangeEvent . Event } to send */
protected synchronized void firePlayerChangeEvent ( PlayerChangeEvent . Event event ) { } } | PlayerChangeEvent pce = new PlayerChangeEvent ( this , event ) ; for ( PlayerChangeListener pcl : listeners ) { pcl . playerChanged ( pce ) ; } |
public class LTieIntConsumerBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */
@ Nonnull public static < T > LTieIntConsumerBuilder < T > tieIntConsumer ( Consumer < LTieIntConsumer < T >... | return new LTieIntConsumerBuilder ( consumer ) ; |
public class ASTHelpers { /** * Gives the return type of an ExpressionTree that represents a method select .
* < p > TODO ( eaftan ) : Are there other places this could be used ? */
public static Type getReturnType ( ExpressionTree expressionTree ) { } } | if ( expressionTree instanceof JCFieldAccess ) { JCFieldAccess methodCall = ( JCFieldAccess ) expressionTree ; return methodCall . type . getReturnType ( ) ; } else if ( expressionTree instanceof JCIdent ) { JCIdent methodCall = ( JCIdent ) expressionTree ; return methodCall . type . getReturnType ( ) ; } else if ( exp... |
public class ApiOvhDbaastimeseries { /** * Create a OpenTSDB token
* REST : POST / dbaas / timeseries / { serviceName } / token / opentsdb
* @ param serviceName [ required ] Service Name
* @ param description [ required ] Token description
* @ param permission [ required ] Permission
* @ param tags [ required... | String qPath = "/dbaas/timeseries/{serviceName}/token/opentsdb" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "description" , description ) ; addBody ( o , "permission" , permission ) ; addBody ( o , "tags" , tags ) ; String resp ... |
public class ActionValidator { public ValidationSuccess simplyValidate ( Object form ) { } } | // for e . g . response bean validator
assertArgumentNotNull ( "form" , form ) ; return doValidate ( form , unused -> { } , ( ) -> { throw new IllegalStateException ( "unused here, no way" ) ; } ) ; |
public class Checksum { /** * Calculates the MD5 checksum of the specified text .
* @ param text the text to generate the MD5 checksum
* @ return the hex representation of the MD5 */
public static String getMD5Checksum ( String text ) { } } | final byte [ ] data = stringToBytes ( text ) ; return getChecksum ( MD5 , data ) ; |
public class XLSFormatter { /** * Copies all pictures from template sheet to result sheet , shift picture depending on area dependencies
* @ param templateSheet - template sheet
* @ param resultSheet - result sheet */
protected void copyPicturesFromTemplateToResult ( HSSFSheet templateSheet , HSSFSheet resultSheet ... | List < HSSFClientAnchor > list = getAllAnchors ( getEscherAggregate ( templateSheet ) ) ; int i = 0 ; if ( CollectionUtils . isNotEmpty ( orderedPicturesId ) ) { // just a shitty workaround for anchors without pictures
for ( HSSFClientAnchor anchor : list ) { Cell topLeft = getCellFromTemplate ( new Cell ( anchor . get... |
public class JScreen { /** * Free the resources held by this object .
* Besides freeing all the sub - screens , this method disconnects all of my
* fields from their controls . */
public void free ( ) { } } | FieldList record = this . getFieldList ( ) ; if ( record != null ) if ( record . isModified ( ) ) { String message = this . getBaseApplet ( ) . getString ( "Save changes?" ) ; if ( JOptionPane . showConfirmDialog ( this , message , null , JOptionPane . OK_CANCEL_OPTION ) == JOptionPane . OK_OPTION ) BaseApplet . handle... |
public class GuiceyBootstrap { /** * Register other guicey bundles for installation .
* Duplicate bundles will be filtered automatically : bundles of the same type considered duplicate
* ( if two or more bundles of the same type detected then only first instance will be processed ) .
* @ param bundles guicey bund... | context . registerBundles ( bundles ) ; iterationBundles . addAll ( Arrays . asList ( bundles ) ) ; return this ; |
public class GeocodeResultBuilder { /** * Copy an address component . Since they are NOT immutable , I don ' t
* want to mess with the variability of the damn things .
* @ param in the component to copy
* @ return the copy */
private AddressComponent copy ( final AddressComponent in ) { } } | final AddressComponent out = new AddressComponent ( ) ; out . longName = in . longName ; out . shortName = in . shortName ; out . types = Arrays . copyOf ( in . types , in . types . length ) ; return out ; |
public class ActionButton { /** * Initializes the animation , which is used while hiding or dismissing
* < b > Action Button < / b >
* @ param attrs attributes of the XML tag that is inflating the view */
private void initHideAnimation ( TypedArray attrs ) { } } | int index = R . styleable . ActionButton_hide_animation ; if ( attrs . hasValue ( index ) ) { int animResId = attrs . getResourceId ( index , Animations . NONE . animResId ) ; hideAnimation = Animations . load ( getContext ( ) , animResId ) ; LOGGER . trace ( "Initialized Action Button hide animation" ) ; } |
public class NodeVector { /** * Inserts the specified node in this vector at the specified index .
* Each component in this vector with an index greater or equal to
* the specified index is shifted upward to have an index one greater
* than the value it had previously .
* @ param value Node to insert
* @ para... | if ( null == m_map ) { m_map = new int [ m_blocksize ] ; m_mapSize = m_blocksize ; } else if ( ( m_firstFree + 1 ) >= m_mapSize ) { m_mapSize += m_blocksize ; int newMap [ ] = new int [ m_mapSize ] ; System . arraycopy ( m_map , 0 , newMap , 0 , m_firstFree + 1 ) ; m_map = newMap ; } if ( at <= ( m_firstFree - 1 ) ) { ... |
public class PluginOption { /** * Convert this { @ link PluginOption } to the Option required by Apache .
* Commons Cli .
* @ return The option object required by commons cli */
Option toOption ( ) { } } | DefaultOptionBuilder oBuilder = new DefaultOptionBuilder ( ) ; oBuilder . withShortName ( option ) . withDescription ( description ) . withRequired ( required ) ; if ( longOptionName != null ) { oBuilder . withLongName ( longOptionName ) ; } if ( hasArgs ) { ArgumentBuilder aBuilder = new ArgumentBuilder ( ) ; if ( arg... |
public class vlan_stats { /** * Use this API to fetch the statistics of all vlan _ stats resources that are configured on netscaler . */
public static vlan_stats [ ] get ( nitro_service service ) throws Exception { } } | vlan_stats obj = new vlan_stats ( ) ; vlan_stats [ ] response = ( vlan_stats [ ] ) obj . stat_resources ( service ) ; return response ; |
public class GetUserDefinedFunctionsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetUserDefinedFunctionsRequest getUserDefinedFunctionsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getUserDefinedFunctionsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getUserDefinedFunctionsRequest . getCatalogId ( ) , CATALOGID_BINDING ) ; protocolMarshaller . marshall ( getUserDefinedFunctionsRequest . getDatabaseName... |
public class ChunkedFileSet { /** * This function looks for files with the " wrong " replica type in their name , and
* if it finds any , renames them .
* Those files may have ended up on this server either because :
* - 1 . We restored them from another server , where they were named according to
* another rep... | for ( int replica = 0 ; replica < routingStrategy . getNumReplicas ( ) ; replica ++ ) { if ( replica != correctReplicaType ) { int chunkId = 0 ; while ( true ) { String fileName = Integer . toString ( masterPartitionId ) + "_" + Integer . toString ( replica ) + "_" + Integer . toString ( chunkId ) ; File index = getInd... |
public class URL { /** * Makes a copy of a given URL with some additional components .
* @ param deviceAddress bluetooth device MAC address
* @ param attr device attributes
* @ return a copy of a given URL with some additional components */
public URL copyWithDevice ( String deviceAddress , Map < String , String ... | return new URL ( this . protocol , this . adapterAddress , deviceAddress , attr , this . serviceUUID , this . characteristicUUID , this . fieldName ) ; |
public class JcrStorageDao { /** * clear all parents from cache */
private void clearParentsCache ( Entity entity ) { } } | try { String xpath = null ; if ( entity instanceof DataSource ) { // find all reports and charts with this DataSource
xpath = "//nextServer//*[@dataSource='" + entity . getId ( ) + "']" ; } else if ( entity instanceof Report ) { // find all schedulers with this report
xpath = "//nextServer/scheduler/*[@report='" + enti... |
public class CmsParameterConfiguration { /** * Merges this parameter configuration with the provided other parameter configuration . < p >
* The difference form a simple < code > Map & lt ; String , String & gt ; < / code > is that for the parameter
* configuration , the values of the keys in both maps are merged a... | for ( String key : other . keySet ( ) ) { boolean tokenize = false ; if ( other instanceof CmsParameterConfiguration ) { Object o = ( ( CmsParameterConfiguration ) other ) . getObject ( key ) ; if ( o instanceof List ) { tokenize = true ; } } add ( key , other . get ( key ) , tokenize ) ; } |
public class CronMapper { /** * Creates a Function that returns an Always instance .
* @ param name - Cron field name
* @ return new CronField - > CronField instance , never null */
@ VisibleForTesting static Function < CronField , CronField > returnAlwaysExpression ( final CronFieldName name ) { } } | return field -> new CronField ( name , always ( ) , FieldConstraintsBuilder . instance ( ) . forField ( name ) . createConstraintsInstance ( ) ) ; |
public class ParameterSerializer { /** * Parse collection of values and get the value mapped to smartfox value
* @ param method structure of getter method
* @ param collection collection of value
* @ return the value after parsed */
@ SuppressWarnings ( { } } | "rawtypes" , "unchecked" } ) protected Object parseCollection ( GetterMethodCover method , Collection collection ) { if ( method . isArrayObjectCollection ( ) ) { return parseArrayObjectCollection ( method , collection ) ; } else if ( method . isObjectCollection ( ) ) { return parseObjectCollection ( method , collectio... |
public class ComponentBorder { /** * Install this Border on the specified component by replacing the
* existing Border with a CompoundBorder containing the original Border
* and our ComponentBorder
* This method should only be invoked once all the properties of this
* class have been set . Installing the Border... | this . parent = parent ; determineInsetsAndAlignment ( ) ; // Add this Border to the parent
Border current = parent . getBorder ( ) ; if ( current == null ) { parent . setBorder ( this ) ; } else { CompoundBorder compound = new CompoundBorder ( current , this ) ; parent . setBorder ( compound ) ; } // Add component to ... |
public class JsMessageImpl { /** * Return a new JsMessage , generalizing the message to just be a JsMessageImpl .
* The new message contains the given JsMsgObject .
* @ param newJmo The JsMsgObject the new JsMessage will contain .
* @ return JsMessage A new JsMessage instance at the JsMessageImpl specialization .... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createNewGeneralized" ) ; JsMessageImpl newMsg = null ; /* Now create the new JsMessage */
newMsg = new JsMessageImpl ( newJmo ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . ex... |
public class DB { /** * unexpected deadlock ) . */
public ManagedProcess dumpXML ( File outputFile , String dbName , String user , String password ) throws IOException , ManagedProcessException { } } | return dump ( outputFile , Arrays . asList ( dbName ) , true , true , true , user , password ) ; |
public class CEMIFactory { /** * Returns an EMI1 / EMI2 - formatted message using the specified L - Data message parameters . This
* method performs the same formatting as { @ link # toEmi ( CEMILData ) } , with the flexibility of
* individual message parameters from an already dissected cEMI L - Data message .
*... | // TP1 , standard frames only
if ( nsdu . length > 16 ) throw new KNXIllegalArgumentException ( "maximum TPDU length is 16 in standard frame" ) ; final byte [ ] buf = new byte [ nsdu . length + 7 ] ; buf [ 0 ] = ( byte ) mc ; buf [ 1 ] = ( byte ) ( p . value << 2 ) ; // repeat flag is only relevant for . con
final bool... |
public class SkeletonStream { /** * Processes and tracks the next packet for
* the stream */
public void processPacket ( OggPacket packet ) { } } | SkeletonPacket skel = SkeletonPacketFactory . create ( packet ) ; // First packet must be the head
if ( packet . isBeginningOfStream ( ) ) { fishead = ( SkeletonFishead ) skel ; } else if ( skel instanceof SkeletonFisbone ) { SkeletonFisbone bone = ( SkeletonFisbone ) skel ; fisbones . add ( bone ) ; bonesByStream . pu... |
public class PackagingProcessors { /** * Finds the first packaging processor on the classpath that supports give { @ code packageType }
* @ param packagingType Package type
* @ return */
@ SuppressWarnings ( { } } | "rawtypes" , "unchecked" } ) public static PackagingProcessor < ? extends Archive < ? > > find ( final PackagingType packagingType ) { ServiceRegistry registry = ServiceRegistry . getInstance ( ) ; Collection < PackagingProcessor > processors = registry . all ( PackagingProcessor . class ) ; StringBuilder unsupportedFo... |
public class EIIImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . EII__IMO_NAME : setImoName ( IMO_NAME_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ; |
public class SBGNLayoutManager { /** * Applies CoSE layout to the given SBGN PD model .
* @ param sbgn model where layout is performed and stored
* @ param doLayout whether to actually run the CoSE or just complete the SBGN model */
public void createLayout ( final Sbgn sbgn , boolean doLayout ) { } } | viewToLayout = new HashMap ( ) ; glyphToVNode = new HashMap ( ) ; idToGLyph = new HashMap ( ) ; idToCompartmentGlyphs = new HashMap ( ) ; portIDToOwnerGlyph = new HashMap ( ) ; layoutToView = new HashMap ( ) ; idToArcs = new HashMap < String , Arc > ( ) ; this . layout = new SbgnPDLayout ( ) ; final LGraphManager graph... |
public class OMMapManagerOld { /** * Flushes away all the buffers of closed files . This frees the memory . */
public void flush ( ) { } } | lock . writeLock ( ) . lock ( ) ; try { OMMapBufferEntry entry ; for ( Iterator < OMMapBufferEntry > it = bufferPoolLRU . iterator ( ) ; it . hasNext ( ) ; ) { entry = it . next ( ) ; if ( entry . file != null && entry . file . isClosed ( ) ) { if ( removeEntry ( entry ) ) it . remove ( ) ; } } } finally { lock . write... |
public class XmGroovyExecutionStrategy { /** * lep : / / xm / com / icthh / lep / < script _ name > $ < entityType > $ < state > $ < script _ type > . groovy */
public Map < XmLepResourceSubType , UrlLepResourceKey > getAvailableAtomicResourceKeys ( UrlLepResourceKey compositeResourceKey , LepManagerService managerServ... | // add ' / ' at start if not exists
String compositePath = compositeResourceKey . getUrlResourcePath ( ) ; if ( ! compositePath . startsWith ( URL_DELIMITER ) ) { compositePath = URL_DELIMITER + compositePath ; } // get all path without script file extension
int extIndex = compositePath . lastIndexOf ( XmLepConstants .... |
public class FSOutputSummer { /** * Writes < code > len < / code > bytes from the specified byte array
* starting at offset < code > off < / code > and generate a checksum for
* each data chunk .
* < p > This method stores bytes from the given array into this
* stream ' s buffer before it gets checksumed . The ... | if ( off < 0 || len < 0 || off > b . length - len ) { throw new ArrayIndexOutOfBoundsException ( ) ; } for ( int n = 0 ; n < len ; n += write1 ( b , off + n , len - n ) ) { } incMetrics ( len ) ; |
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 new IteratorStream < > ( new ObjIteratorEx < R > ( ) { @ Override public boolean hasNext ( ) { return a . hasNext ( ) || b . hasNext ( ) ; } @ Override public R next ( ) { if ( hasNext ( ) == false ) { throw new NoSuchElementException ( ) ; } return zipFunction . apply ( a . hasNext ( ) ? a . nextFloat ( ) : val... |
public class StringUtilities { /** * Skip all linear white spaces
* @ param buf the buf which is being scanned for lws
* @ param start the offset to start at
* @ return the next position in buf which isn ' t a lws character */
private static int skipLws ( byte [ ] buf , int start ) { } } | int i ; for ( i = start ; i < buf . length ; i ++ ) { if ( ! isLws ( buf [ i ] ) ) { return i ; } } return i ; |
public class BeaconManager { /** * Check if Bluetooth LE is supported by this Android device , and if so , make sure it is enabled .
* @ return false if it is supported and not enabled
* @ throws BleNotAvailableException if Bluetooth LE is not supported . ( Note : The Android emulator will do this ) */
@ TargetApi ... | if ( ! isBleAvailableOrSimulated ( ) ) { throw new BleNotAvailableException ( "Bluetooth LE not supported by this device" ) ; } return ( ( BluetoothManager ) mContext . getSystemService ( Context . BLUETOOTH_SERVICE ) ) . getAdapter ( ) . isEnabled ( ) ; |
public class RetryHandler { /** * Handle exception from a write failure . */
public void handleExceptionWrite ( Exception e , List < Object > w ) { } } | final String mName = "handleExceptionWrite" ; if ( logger . isLoggable ( Level . FINER ) ) logger . logp ( Level . FINE , className , mName , e . getClass ( ) . getName ( ) + "; " + this . toString ( ) ) ; if ( ! isRetryLimitReached ( ) && isRetryable ( e ) ) { // Retry it . Log it . Call the RetryListener .
retryType ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.