signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CmsContainerpageService { /** * Fetches the container page data . < p > * @ param request the current request * @ return the container page data * @ throws CmsRpcException if something goes wrong */ public static CmsCntPageData prefetch ( HttpServletRequest request ) throws CmsRpcException { } }
CmsContainerpageService srv = new CmsContainerpageService ( ) ; srv . setCms ( CmsFlexController . getCmsObject ( request ) ) ; srv . setRequest ( request ) ; CmsCntPageData result = null ; try { result = srv . prefetch ( ) ; } finally { srv . clearThreadStorage ( ) ; } return result ;
public class RqMtBase { /** * Convert a list of requests to a map . * @ param reqs Requests * @ return Map of them * @ throws IOException If fails */ @ SuppressWarnings ( "PMD.AvoidInstantiatingObjectsInLoops" ) private static Map < String , List < Request > > asMap ( final Collection < Request > reqs ) throws IO...
final Map < String , List < Request > > map = new HashMap < > ( reqs . size ( ) ) ; for ( final Request req : reqs ) { final String header = new RqHeaders . Smart ( req ) . single ( "Content-Disposition" ) ; final Matcher matcher = RqMtBase . NAME . matcher ( header ) ; if ( ! matcher . matches ( ) ) { throw new HttpEx...
public class AmazonPinpointClient { /** * Use to update the APNs channel for an app . * @ param updateApnsChannelRequest * @ return Result of the UpdateApnsChannel operation returned by the service . * @ throws BadRequestException * 400 response * @ throws InternalServerErrorException * 500 response * @ t...
request = beforeClientExecution ( request ) ; return executeUpdateApnsChannel ( request ) ;
public class WordForm { /** * getter for lemma - gets lemma of the Form * @ generated * @ return value of the feature */ public String getLemma ( ) { } }
if ( WordForm_Type . featOkTst && ( ( WordForm_Type ) jcasType ) . casFeat_lemma == null ) jcasType . jcas . throwFeatMissing ( "lemma" , "com.digitalpebble.rasp.WordForm" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( WordForm_Type ) jcasType ) . casFeatCode_lemma ) ;
public class WorkspaceDataImporter { /** * ( non - Javadoc ) * @ seeorg . exoplatform . services . jcr . impl . xml . importing . StreamImporter # * createContentImporter ( org . exoplatform . services . jcr . impl . core . NodeImpl , * int , org . exoplatform . services . jcr . impl . xml . XmlSaveType , * org...
return new WorkspaceContentImporter ( parent , parent . getQPath ( ) , uuidBehavior , dataConsumer , ntManager , locationFactory , valueFactory , namespaceRegistry , accessManager , userState , context , repository , currentWorkspaceName ) ;
public class TurfMeasurement { /** * Takes a { @ link BoundingBox } and uses its coordinates to create a { @ link Polygon } * geometry . * @ param boundingBox a { @ link BoundingBox } object to calculate with * @ return a { @ link Polygon } object * @ see < a href = " http : / / turfjs . org / docs / # bboxPoly...
return Polygon . fromLngLats ( Arrays . asList ( Arrays . asList ( Point . fromLngLat ( boundingBox . west ( ) , boundingBox . south ( ) ) , Point . fromLngLat ( boundingBox . east ( ) , boundingBox . south ( ) ) , Point . fromLngLat ( boundingBox . east ( ) , boundingBox . north ( ) ) , Point . fromLngLat ( boundingBo...
public class MethodInfo { /** * Returns the parsed type descriptor for the method , which will not include type parameters . If you need * generic type parameters , call getTypeSignature ( ) instead . * @ return The parsed type descriptor for the method . */ public MethodTypeSignature getTypeDescriptor ( ) { } }
if ( typeDescriptor == null ) { try { typeDescriptor = MethodTypeSignature . parse ( typeDescriptorStr , declaringClassName ) ; typeDescriptor . setScanResult ( scanResult ) ; } catch ( final ParseException e ) { throw new IllegalArgumentException ( e ) ; } } return typeDescriptor ;
public class HttpSessionContextImpl { /** * Determine if the requested session id is valid . We will get the session * passed in if it exists - - we know that getSession has been called */ public boolean isRequestedSessionIdValid ( HttpServletRequest _request , HttpSession sess ) { } }
SessionAffinityContext sac = getSessionAffinityContext ( _request ) ; String sessionId = sac . getRequestedSessionID ( ) ; if ( ( sessionId != null ) && ( sess != null ) && ( ! sess . isNew ( ) || ! _smc . checkSessionNewOnIsValidRequest ( ) ) && sessionId . equals ( sess . getId ( ) ) ) { return true ; } return false ...
public class SuspiciousClusteredSessionSupport { /** * implements the visitor to collect calls to getAttribute / setAttribute and stores to attributes to see what have been modified without recalling * setAttribute * @ param seen * the currently parsed opcode */ @ Override public void sawOpcode ( int seen ) { } }
String attributeName = null ; boolean sawGetAttribute = false ; try { stack . precomputation ( this ) ; if ( seen == Const . INVOKEINTERFACE ) { String clsName = getClassConstantOperand ( ) ; if ( "javax/servlet/http/HttpSession" . equals ( clsName ) ) { String methodName = getNameConstantOperand ( ) ; if ( "getAttribu...
public class ListImportsResult { /** * A list of stack names that are importing the specified exported output value . * @ return A list of stack names that are importing the specified exported output value . */ public java . util . List < String > getImports ( ) { } }
if ( imports == null ) { imports = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return imports ;
public class BaseSerializer { /** * Serialize a list of Transforms */ public String serializeTransformList ( List < Transform > list ) { } }
ObjectMapper om = getObjectMapper ( ) ; try { return om . writeValueAsString ( new ListWrappers . TransformList ( list ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class AbstractConsoleEditor { /** * Stops the editor . * The methods clears the editor screen and also closes in / out and { @ link Reader } . */ public void stop ( ) { } }
hide ( ) ; running = false ; Closeables . closeQuitely ( reader ) ; Closeables . closeQuitely ( in ) ;
public class BaseRunner { /** * Create the WebAppContext with basic configurations set like context path * etc . */ protected void createWebAppContext ( ) { } }
webapp = new WebAppContext ( ) ; webapp . setThrowUnavailableOnStartupException ( true ) ; webapp . setServerClasses ( getServerClasses ( ) ) ; webapp . setContextPath ( getContextPath ( ) ) ; webapp . setTempDirectory ( createTempDir ( "jetty-app-" ) ) ; setSecureCookies ( ) ;
public class GosuStringUtil { /** * < p > Find the latest index of any of a set of potential substrings . < / p > * < p > A < code > null < / code > String will return < code > - 1 < / code > . * A < code > null < / code > search array will return < code > - 1 < / code > . * A < code > null < / code > or zero len...
if ( ( str == null ) || ( searchStrs == null ) ) { return - 1 ; } int sz = searchStrs . length ; int ret = - 1 ; int tmp = 0 ; for ( int i = 0 ; i < sz ; i ++ ) { String search = searchStrs [ i ] ; if ( search == null ) { continue ; } tmp = str . lastIndexOf ( search ) ; if ( tmp > ret ) { ret = tmp ; } } return ret ;
public class Bounds { /** * Negates single - ended Bound filters . * @ param bound filter * @ return negated filter , or null if this bound is double - ended . */ public static BoundDimFilter not ( final BoundDimFilter bound ) { } }
if ( bound . getUpper ( ) != null && bound . getLower ( ) != null ) { return null ; } else if ( bound . getUpper ( ) != null ) { return new BoundDimFilter ( bound . getDimension ( ) , bound . getUpper ( ) , null , ! bound . isUpperStrict ( ) , false , null , bound . getExtractionFn ( ) , bound . getOrdering ( ) ) ; } e...
public class MessageUtils { /** * Builds an appropriate error message . * @ param resolutionContext The resolution context * @ param message The message * @ return The message */ static String buildMessage ( BeanResolutionContext resolutionContext , String message ) { } }
BeanResolutionContext . Path path = resolutionContext . getPath ( ) ; BeanDefinition declaringType ; boolean hasPath = ! path . isEmpty ( ) ; if ( hasPath ) { BeanResolutionContext . Segment segment = path . peek ( ) ; declaringType = segment . getDeclaringType ( ) ; } else { declaringType = resolutionContext . getRoot...
public class Variable { /** * Tell if this is a psuedo variable reference , declared by Xalan instead * of by the user . */ public boolean isPsuedoVarRef ( ) { } }
java . lang . String ns = m_qname . getNamespaceURI ( ) ; if ( ( null != ns ) && ns . equals ( PSUEDOVARNAMESPACE ) ) { if ( m_qname . getLocalName ( ) . startsWith ( "#" ) ) return true ; } return false ;
public class Utils { /** * Extracts a JSON object from server response with secured string . * @ param response Server response * @ return Extracted secured JSON or null . */ public static JSONObject extractSecureJson ( Response response ) { } }
try { String responseText = response . getResponseText ( ) ; if ( ! responseText . startsWith ( SECURE_PATTERN_START ) || ! responseText . endsWith ( SECURE_PATTERN_END ) ) { return null ; } int startIndex = responseText . indexOf ( SECURE_PATTERN_START ) ; int endIndex = responseText . indexOf ( SECURE_PATTERN_END , r...
public class RestRepositoryService { /** * Gives the name of all the existing workspaces for a given repository . * @ param repositoryName the name of the repository * @ return Response return the Response with list of workspace names * @ response * { code : json } * { " names " : the name of all the existing...
String errorMessage = new String ( ) ; Status status ; try { List < String > workspaces = new ArrayList < String > ( ) ; for ( WorkspaceEntry wEntry : repositoryService . getRepository ( repositoryName ) . getConfiguration ( ) . getWorkspaceEntries ( ) ) { workspaces . add ( wEntry . getName ( ) ) ; } return Response ....
public class NavigationService { /** * find and click a button or input containing the passed text . Will return the first match where an input take presedence * over a button * @ param text which should be contained on the button * @ throws AssertionError if no button with this text is found */ public void click...
String caseInsensitiveButtonText = seleniumElementService . constructCaseInsensitiveContains ( "text()" , text ) ; By buttonPpath = By . xpath ( "//button[" + caseInsensitiveButtonText + "]" ) ; String caseInsensitiveValueText = seleniumElementService . constructCaseInsensitiveContains ( "@value" , text ) ; By submitPa...
public class MultiIndex { /** * Returns an read - only < code > IndexReader < / code > that spans alls indexes of * this < code > MultiIndex < / code > . * @ param initCache * when set < code > true < / code > the hierarchy cache is completely * initialized before this call returns . * @ return an < code > In...
return SecurityHelper . doPrivilegedIOExceptionAction ( new PrivilegedExceptionAction < CachingMultiIndexReader > ( ) { public CachingMultiIndexReader run ( ) throws Exception { synchronized ( updateMonitor ) { if ( multiReader != null ) { multiReader . acquire ( ) ; return multiReader ; } // no reader available // wai...
public class CPMeasurementUnitUtil { /** * Returns the last cp measurement unit in the ordered set where groupId = & # 63 ; . * @ param groupId the group ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching cp measurement unit * @...
return getPersistence ( ) . findByGroupId_Last ( groupId , orderByComparator ) ;
public class PackageDocImpl { /** * Get package name . */ public String qualifiedName ( ) { } }
if ( qualifiedName == null ) { Name fullname = sym . getQualifiedName ( ) ; // Some bogus tests depend on the interned " " being returned . // See 6457276. qualifiedName = fullname . isEmpty ( ) ? "" : fullname . toString ( ) ; } return qualifiedName ;
public class ProjectiveDependencyParser { /** * Runs the outside - algorithm for the parsing algorithm of ( Eisner , 2000 ) . * @ param scores Input : The edge weights . * @ param inChart Input : The inside parse chart . * @ param outChart Output : The outside parse chart . */ private static void outsideAlgorithm...
final int n = scores . length ; final int startIdx = singleRoot ? 1 : 0 ; if ( singleRoot ) { // Initialize . double goalScore = 0.0 ; outChart . updateCell ( 0 , n - 1 , RIGHT , COMPLETE , goalScore , - 1 ) ; // The inside algorithm is effectively doing this . . . // wallScore [ r ] log + = inChart . scores [ 0 ] [ r ...
public class Streams { /** * Attempt to close an array of < tt > InputStream < / tt > s . * @ param streams Array of < tt > InputStream < / tt > s to attempt to close . * @ return < tt > True < / tt > if all streams were closed , or < tt > false < / tt > if an * exception was thrown . */ public static boolean clo...
boolean success = true ; for ( InputStream stream : streams ) { boolean rv = close ( stream ) ; if ( ! rv ) success = false ; } return success ;
public class CmsReplaceDialog { /** * Starts the loading animation . < p > * Used while client is loading files from hard disk into memory . < p > * @ param msg the message that should be displayed below the loading animation ( can also be HTML as String ) * @ param delayMillis the delay to start the animation wi...
m_loadingTimer = new Timer ( ) { @ Override public void run ( ) { m_mainPanel . showLoadingAnimation ( msg ) ; } } ; if ( delayMillis > 0 ) { m_loadingTimer . schedule ( delayMillis ) ; } else { m_loadingTimer . run ( ) ; }
public class ChannelPool { /** * { @ inheritDoc } * Create a { @ link ClientCall } on a Channel from the pool chosen in a round - robin fashion to the * remote operation specified by the given { @ link MethodDescriptor } . The returned * { @ link ClientCall } does not trigger any remote behavior until * { @ lin...
Preconditions . checkState ( ! shutdown , "Cannot perform operations on a closed connection" ) ; return getNextChannel ( ) . newCall ( methodDescriptor , callOptions ) ;
public class MultiPolygon { /** * Create a new instance of this class by defining a single { @ link Polygon } objects and passing * it in as a parameter in this method . The Polygon should comply with the GeoJson * specifications described in the documentation . * @ param polygon a single Polygon which make up th...
List < List < List < Point > > > coordinates = Arrays . asList ( polygon . coordinates ( ) ) ; return new MultiPolygon ( TYPE , bbox , coordinates ) ;
public class CommerceNotificationQueueEntryPersistenceImpl { /** * Returns all the commerce notification queue entries where groupId = & # 63 ; . * @ param groupId the group ID * @ return the matching commerce notification queue entries */ @ Override public List < CommerceNotificationQueueEntry > findByGroupId ( lo...
return findByGroupId ( groupId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class SequentialReader { /** * Returns the sequence of bytes punctuated by a < code > \ 0 < / code > value . * @ param maxLengthBytes The maximum number of bytes to read . If a < code > \ 0 < / code > byte is not reached within this limit , * the returned array will be < code > maxLengthBytes < / code > long...
byte [ ] buffer = new byte [ maxLengthBytes ] ; // Count the number of non - null bytes int length = 0 ; while ( length < buffer . length && ( buffer [ length ] = getByte ( ) ) != 0 ) length ++ ; if ( length == maxLengthBytes ) return buffer ; byte [ ] bytes = new byte [ length ] ; if ( length > 0 ) System . arraycopy ...
public class UserDefinedFunction { /** * The resource URIs for the function . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setResourceUris ( java . util . Collection ) } or { @ link # withResourceUris ( java . util . Collection ) } if you want to * overr...
if ( this . resourceUris == null ) { setResourceUris ( new java . util . ArrayList < ResourceUri > ( resourceUris . length ) ) ; } for ( ResourceUri ele : resourceUris ) { this . resourceUris . add ( ele ) ; } return this ;
public class CollectionUtil { /** * 求两个集合指定区间的交集 * @ param arr1 集合1 * @ param start1 集合1区间起始位置 ( 包含 ) * @ param end1 集合1区间结束位置 ( 不包含 ) * @ param arr2 集合2 * @ param start2 集合2区间起始位置 ( 包含 ) * @ param end2 集合2区间结束位置 ( 不包含 ) * @ param < T > 集合数据类型 * @ return 两个集合指定区间的交集 */ public static < T > List < T > int...
if ( start1 > end1 || start2 > end2 ) { throw new IllegalArgumentException ( "起始位置必须小于等于结束位置" ) ; } if ( start1 == end1 || start2 == end2 ) { return Collections . emptyList ( ) ; } List < T > list = new ArrayList < > ( ) ; for ( int i = start1 ; i < end1 ; i ++ ) { int index = arr2 . indexOf ( arr1 . get ( i ) ) ; if (...
public class TypeChecker { /** * Creates a recursing type checker for a { @ link java . util . Set } . * @ param elementType The class to check the elements against * @ return a typechecker for a Set containing elements of the specified type */ public static < T > TypeChecker < Set < ? extends T > > tSet ( Class < ...
return tSet ( tSimple ( elementType ) ) ;
public class ListAssignmentsForHITRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListAssignmentsForHITRequest listAssignmentsForHITRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listAssignmentsForHITRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listAssignmentsForHITRequest . getHITId ( ) , HITID_BINDING ) ; protocolMarshaller . marshall ( listAssignmentsForHITRequest . getNextToken ( ) , NEXTTOKEN_...
public class LdaGibbsSampler { /** * Configure the gibbs sampler * @ param iterations * number of total iterations * @ param burnIn * number of burn - in iterations * @ param thinInterval * update statistics interval * @ param sampleLag * sample interval ( - 1 for just one sample at the end ) */ public ...
ITERATIONS = iterations ; BURN_IN = burnIn ; THIN_INTERVAL = thinInterval ; SAMPLE_LAG = sampleLag ;
public class ListView { /** * Handles the configuration submission . * Load view - specific properties here . */ @ Override protected void submit ( StaplerRequest req ) throws ServletException , FormException , IOException { } }
JSONObject json = req . getSubmittedForm ( ) ; synchronized ( this ) { recurse = json . optBoolean ( "recurse" , true ) ; jobNames . clear ( ) ; Iterable < ? extends TopLevelItem > items ; if ( recurse ) { items = getOwner ( ) . getItemGroup ( ) . getAllItems ( TopLevelItem . class ) ; } else { items = getOwner ( ) . g...
public class SchemasInner { /** * Gets a list of integration account schemas . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by serve...
ServiceResponse < Page < IntegrationAccountSchemaInner > > response = listByIntegrationAccountsNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < IntegrationAccountSchemaInner > ( response . body ( ) ) { @ Override public Page < IntegrationAccountSchemaInner > nextPage ( String ...
public class AbstractApi { /** * Returns the group ID or path from the provided Integer , String , or Group instance . * @ param obj the object to determine the ID or path from * @ return the group ID or path from the provided Integer , String , or Group instance * @ throws GitLabApiException if any exception occ...
if ( obj == null ) { throw ( new RuntimeException ( "Cannot determine ID or path from null object" ) ) ; } else if ( obj instanceof Integer ) { return ( obj ) ; } else if ( obj instanceof String ) { return ( urlEncode ( ( ( String ) obj ) . trim ( ) ) ) ; } else if ( obj instanceof Group ) { Integer id = ( ( Group ) ob...
public class CmsLocationController { /** * Adds a callback to be executed once the API is ready . Will be executed right away if the API is already loaded . < p > * @ param callback the callback */ private void onApiReady ( Command callback ) { } }
if ( isApiLoaded ( ) ) { callback . execute ( ) ; } else { onApiReady . add ( callback ) ; if ( ! loadingApi ) { loadingApi = true ; loadApi ( ) ; } }
public class WktService { /** * Get the SRID from a string like " SRDI = 4326 " . Used in parsing EWKT . */ private static int parseSrid ( String ewktPart ) { } }
if ( ewktPart != null && ! "" . equals ( ewktPart ) ) { String [ ] parts = ewktPart . split ( "=" ) ; if ( parts . length == 2 ) { try { return Integer . parseInt ( parts [ 1 ] ) ; } catch ( Exception e ) { } } } return 0 ;
public class MesosToSchedulerDriverAdapter { /** * Task that performs Subscription . */ private synchronized void performReliableSubscription ( ) { } }
// If timer is not running , initialize it . if ( subscriberTimer == null ) { LOGGER . info ( "Initializing reliable subscriber" ) ; subscriberTimer = createTimerInternal ( ) ; ExponentialBackOff backOff = new ExponentialBackOff . Builder ( ) . setMaxElapsedTimeMillis ( Integer . MAX_VALUE /* Try forever */ ) . setMaxI...
public class DelegatingWriter { /** * Delegates the close operation to all delegates and merges any occurred exceptions into a single { @ link IOException } . * @ throws IOException in case at least one of the delegate writers threw an exception while closing . * < em > Please note : < / em > Attempts are made to c...
List < Exception > closeExceptions = new ArrayList < > ( delegates . size ( ) ) ; for ( Writer delegate : delegates ) { try { delegate . close ( ) ; } catch ( IOException | RuntimeException closeException ) { closeExceptions . add ( closeException ) ; } } if ( ! closeExceptions . isEmpty ( ) ) { throw mergeExceptions (...
public class SpecializedOps_ZDRM { /** * Computes the householder vector used in QR decomposition . * u = x / max ( x ) * u ( 0 ) = u ( 0 ) + | u | * u = u / u ( 0) * @ param x Input vector . Unmodified . * @ return The found householder reflector vector */ public static ZMatrixRMaj householderVector ( ZMatri...
ZMatrixRMaj u = x . copy ( ) ; double max = CommonOps_ZDRM . elementMaxAbs ( u ) ; CommonOps_ZDRM . elementDivide ( u , max , 0 , u ) ; double nx = NormOps_ZDRM . normF ( u ) ; Complex_F64 c = new Complex_F64 ( ) ; u . get ( 0 , 0 , c ) ; double realTau , imagTau ; if ( c . getMagnitude ( ) == 0 ) { realTau = nx ; imag...
public class PassiveState { /** * Applies a query to the state machine . */ protected CompletableFuture < QueryResponse > applyQuery ( QueryEntry entry , CompletableFuture < QueryResponse > future ) { } }
// In the case of the leader , the state machine is always up to date , so no queries will be queued and all query // indexes will be the last applied index . context . getStateMachine ( ) . < ServerStateMachine . Result > apply ( entry ) . whenComplete ( ( result , error ) -> { completeOperation ( result , QueryRespon...
public class DirectSchedulerFactory { /** * Creates a scheduler using the specified thread pool , job store , and * plugins , and binds it to RMI . * @ param schedulerName * The name for the scheduler . * @ param schedulerInstanceId * The instance ID for the scheduler . * @ param threadPool * The thread p...
createScheduler ( schedulerName , schedulerInstanceId , threadPool , DEFAULT_THREAD_EXECUTOR , jobStore , schedulerPluginMap , idleWaitTime , DEFAULT_BATCH_MAX_SIZE , DEFAULT_BATCH_TIME_WINDOW ) ;
public class ConcurrentUsersStatisticsController { /** * Create a map of the report column discriminators based on the submitted form to collate the * aggregation data into each column of a report . The map entries are a time - ordered sorted set * of aggregation data points . * @ param form Form submitted by the...
return getDefaultGroupedColumnDiscriminatorMap ( form ) ;
public class IOUtil { /** * Returns the offset where the first byte is written . This method assumes that 5 bytes will be writable starting at * the { @ code variableOffset } . */ static int putVarInt32AndGetOffset ( final int value , final byte [ ] buffer , final int variableOffset ) { } }
switch ( ProtobufOutput . computeRawVarint32Size ( value ) ) { case 1 : buffer [ variableOffset + 4 ] = ( byte ) value ; return variableOffset + 4 ; case 2 : buffer [ variableOffset + 3 ] = ( byte ) ( ( value & 0x7F ) | 0x80 ) ; buffer [ variableOffset + 4 ] = ( byte ) ( value >>> 7 ) ; return variableOffset + 3 ; case...
public class Range { /** * Creates a stream that contains a given number of integers starting from a given number . * @ param from a staring value * @ param to an ending value , exclusive * @ param step the value to add to for the next item * @ return a stream that contains a given number of integers starting f...
return new Stream < Integer > ( ) { @ Override public Iterator < Integer > iterator ( ) { return new ReadOnlyIterator < Integer > ( ) { int value = from ; @ Override public boolean hasNext ( ) { return value < to ; } @ Override public Integer next ( ) { final int v = value ; value += step ; return v ; } } ; } } ;
public class Equation { /** * Parses the equation and compiles it into a sequence which can be executed later on * @ param equation String in simple equation format . * @ param assignment if true an assignment is expected and an exception if thrown if there is non * @ param debug if true it will print out debuggi...
functions . setManagerTemp ( managerTemp ) ; Sequence sequence = new Sequence ( ) ; TokenList tokens = extractTokens ( equation , managerTemp ) ; if ( tokens . size ( ) < 3 ) throw new RuntimeException ( "Too few tokens" ) ; TokenList . Token t0 = tokens . getFirst ( ) ; if ( t0 . word != null && t0 . word . compareToI...
public class CmsPublishGroupPanel { /** * Fills a slot for a button in a publish list item widget . < p > * @ param listItemWidget the list item widget * @ param index the slot index * @ param widget the widget which should be displayed in the slot * @ param slotMapping array mapping logical slot ids to button ...
int realIndex = slotMapping [ index ] ; if ( realIndex >= 0 ) { SimplePanel panel = ( SimplePanel ) listItemWidget . getButton ( slotMapping [ index ] ) ; panel . clear ( ) ; panel . add ( widget ) ; }
public class ServerAdvisorsInner { /** * Updates a server advisor . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param advisorName The name of ...
return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , serverName , advisorName , autoExecuteStatus ) , serviceCallback ) ;
public class GetMetricStatisticsRequest { /** * The percentile statistics . Specify values between p0.0 and p100 . When calling < code > GetMetricStatistics < / code > , * you must specify either < code > Statistics < / code > or < code > ExtendedStatistics < / code > , but not both . Percentile * statistics are no...
if ( extendedStatistics == null ) { extendedStatistics = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return extendedStatistics ;
public class Iso9660VolumeDescriptorSet { /** * Read the fields of a primary volume descriptor . * @ param descriptor the descriptor bytes * @ throws IOException */ private void deserializePrimary ( byte [ ] descriptor ) throws IOException { } }
// according to the spec , some ISO 9660 file systems can contain multiple identical primary // volume descriptors if ( this . hasPrimary ) { return ; } validateBlockSize ( descriptor ) ; if ( ! this . hasSupplementary ) { deserializeCommon ( descriptor ) ; } this . standardIdentifier = Util . getDChars ( descriptor , ...
public class MD5OutputStream { /** * Writes a byte . */ @ Override public void write ( int b ) throws IOException { } }
out . write ( b ) ; md5 . Update ( ( byte ) b ) ;
public class TreeScanner { /** * { @ inheritDoc } This implementation scans the children in left to right order . * @ param node { @ inheritDoc } * @ param p { @ inheritDoc } * @ return the result of scanning */ @ Override public R visitIntersectionType ( IntersectionTypeTree node , P p ) { } }
return scan ( node . getBounds ( ) , p ) ;
public class FacesImpl { /** * Identify unknown faces from a person group . * @ param personGroupId PersonGroupId of the target person group , created by PersonGroups . Create * @ param faceIds Array of query faces faceIds , created by the Face - Detect . Each of the faces are identified independently . The valid n...
return ServiceFuture . fromResponse ( identifyWithServiceResponseAsync ( personGroupId , faceIds , identifyOptionalParameter ) , serviceCallback ) ;
public class RectangleArranger { /** * Get the position data of the object * @ param object Query object * @ return Position information : x , y , w , h */ public double [ ] get ( T object ) { } }
double [ ] v = map . get ( object ) ; if ( v == null ) { return null ; } return v . clone ( ) ;
public class Buffer { /** * Sets the data in this buffer . */ public void setData ( int format , ShortBuffer data , int frequency ) { } }
AL10 . alBufferData ( _id , format , data , frequency ) ;
public class XMLSerializer { /** * Write characters . * @ param text character data * @ throws SAXException if processing the event failed * @ throws IllegalStateException if start element is not open */ public void writeCharacters ( final String text ) throws SAXException { } }
if ( elementStack . isEmpty ( ) ) { throw new IllegalStateException ( "Current state does not allow Character writing" ) ; } final char [ ] ch = text . toCharArray ( ) ; writeCharacters ( ch , 0 , ch . length ) ;
public class SM2Engine { /** * 增加字段节点 * @ param digest * @ param v */ private void addFieldElement ( ECFieldElement v ) { } }
final byte [ ] p = BigIntegers . asUnsignedByteArray ( this . curveLength , v . toBigInteger ( ) ) ; this . digest . update ( p , 0 , p . length ) ;
public class AbstractThriftMetadataBuilder { /** * Assigns all fields an id if possible . Fields are grouped by name and for each group , if there * is a single id , all fields in the group are assigned this id . If the group has multiple ids , * an error is reported . */ protected final Set < String > inferThriftF...
Set < String > fieldsWithConflictingIds = new HashSet < > ( ) ; // group fields by explicit name or by name extracted from field , method or property Multimap < String , FieldMetadata > fieldsByExplicitOrExtractedName = Multimaps . index ( fields , getOrExtractThriftFieldName ( ) ) ; inferThriftFieldIds ( fieldsByExpli...
public class JKTableColumn { /** * Checks if is numeric . * @ return true , if is numeric */ public boolean isNumeric ( ) { } }
final Class c = getColumnClass ( ) ; return c . equals ( Integer . class ) || c . equals ( Float . class ) || c . equals ( Long . class ) || c . equals ( BigDecimal . class ) ;
public class Applications { /** * Applies a side effect on each elements of the source array . This * application is evaluated eagerly . * < code > * > each ( [ 1,2 ] , println ) - > void * < / code > * @ param < E > the array element type parameter * @ param array the array where elements are fetched from ...
dbc . precondition ( array != null , "cannot call each with a null array" ) ; dbc . precondition ( consumer != null , "cannot call each with a null consumer" ) ; for ( int i = 0 ; i != array . length ; ++ i ) { consumer . accept ( array [ i ] ) ; }
public class DomainsInner { /** * Get domain name recommendations based on keywords . * Get domain name recommendations based on keywords . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ t...
ServiceResponse < Page < NameIdentifierInner > > response = listRecommendationsNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < NameIdentifierInner > ( response . body ( ) ) { @ Override public Page < NameIdentifierInner > nextPage ( String nextPageLink ) { return listRecommen...
public class ClassInfoList { /** * Find the union of this { @ link ClassInfoList } with one or more others . * @ param others * The other { @ link ClassInfoList } s to union with this one . * @ return The union of this { @ link ClassInfoList } with the others . */ public ClassInfoList union ( final ClassInfoList ...
final Set < ClassInfo > reachableClassesUnion = new LinkedHashSet < > ( this ) ; final Set < ClassInfo > directlyRelatedClassesUnion = new LinkedHashSet < > ( directlyRelatedClasses ) ; for ( final ClassInfoList other : others ) { reachableClassesUnion . addAll ( other ) ; directlyRelatedClassesUnion . addAll ( other ....
public class SecStrucState { /** * Set the turn column corresponding to 3,4 or 5 helix patterns . If starting * > or ending < was set and the opposite is being set , the value will be * converted to X . If a number was set , it will be overwritten by the new * character . * @ param c * character in the column...
if ( turn [ t - 3 ] == 'X' ) return ; else if ( turn [ t - 3 ] == '<' && c == '>' || turn [ t - 3 ] == '>' && c == '<' ) { turn [ t - 3 ] = 'X' ; } else if ( turn [ t - 3 ] == '<' || turn [ t - 3 ] == '>' ) return ; else turn [ t - 3 ] = c ;
public class CodeGenerator { /** * generate import code * @ param code */ private void genImportCode ( StringBuilder code ) { } }
code . append ( "import com.google.protobuf.*" ) . append ( JAVA_LINE_BREAK ) ; code . append ( "import java.io.IOException" ) . append ( JAVA_LINE_BREAK ) ; code . append ( "import com.baidu.bjf.remoting.protobuf.utils.*" ) . append ( JAVA_LINE_BREAK ) ; code . append ( "import com.baidu.bjf.remoting.protobuf.code.*" ...
public class Strings { /** * Returns the number of times the token appears in the target . * @ param token Token value to be counted . * @ param target Target value to count tokens in . * @ return the number of tokens . */ @ SuppressWarnings ( "ConstantConditions" ) @ Beta public static int countToken ( @ Nullabl...
checkArgument ( token != null && ! token . isEmpty ( ) , "Expected non-empty token, got: '%s'" , token ) ; if ( isNullOrEmpty ( target ) ) { return 0 ; } int count = 0 ; int tokenIndex = 0 ; while ( ( tokenIndex = target . indexOf ( token , tokenIndex ) ) != - 1 ) { count ++ ; tokenIndex += token . length ( ) ; } retur...
public class RemovePreferenceHeaderDialogBuilder { /** * Returns a list , which contains the titles of all navigation preferences , which are contained * by a specific collection . * @ param navigationPreferences * A collection , which contains the navigation preferences , whose title should be * returned , as ...
List < CharSequence > titles = new LinkedList < > ( ) ; for ( NavigationPreference navigationPreference : navigationPreferences ) { titles . add ( navigationPreference . getTitle ( ) ) ; } return titles ;
public class DiskBuffer { /** * Attempts to open and deserialize a single { @ link Event } from a { @ link File } . * @ param eventFile File to deserialize into an Event * @ return Event from the File , or null */ private Event fileToEvent ( File eventFile ) { } }
Object eventObj ; try ( FileInputStream fileInputStream = new FileInputStream ( new File ( eventFile . getAbsolutePath ( ) ) ) ; ObjectInputStream ois = new ObjectInputStream ( fileInputStream ) ) { eventObj = ois . readObject ( ) ; } catch ( FileNotFoundException e ) { // event was deleted while we were iterating the ...
public class LittleEndianRandomAccessFile { /** * Reads a two byte signed { @ code short } from the underlying * input stream in little endian order , low byte first . * @ return the { @ code short } read . * @ throws EOFException if the end of the underlying input stream * has been reached * @ throws IOExcep...
int byte1 = file . read ( ) ; int byte2 = file . read ( ) ; // only need to test last byte read // if byte1 is - 1 so is byte2 if ( byte2 < 0 ) { throw new EOFException ( ) ; } return ( short ) ( ( ( byte2 << 24 ) >>> 16 ) + ( byte1 << 24 ) >>> 24 ) ;
public class PreparedStatement { /** * { @ inheritDoc } */ public void setObject ( final int parameterIndex , final Object x , final int targetSqlType , final int scaleOrLength ) throws SQLException { } }
if ( ! Defaults . jdbcTypeMappings . containsKey ( targetSqlType ) ) { throw new SQLFeatureNotSupportedException ( ) ; } // end of if if ( x == null ) { setNull ( parameterIndex , targetSqlType ) ; return ; } // end of if switch ( targetSqlType ) { case Types . DOUBLE : case Types . REAL : case Types . FLOAT : case Typ...
public class DescribeNFSFileSharesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeNFSFileSharesRequest describeNFSFileSharesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeNFSFileSharesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeNFSFileSharesRequest . getFileShareARNList ( ) , FILESHAREARNLIST_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to ma...
public class GosuClassTransformer { /** * # # hack : * Potentially generates a bridge method for an overridden method where the super method is in a proxy * and the proxy is for a Java interface having param types that are transformed to non - bytecode types * in the type system . * E . g . , A guidewire platfo...
IGosuClassInternal superType = ( IGosuClassInternal ) superDfs . getScriptPart ( ) . getContainingType ( ) ; if ( superType . isProxy ( ) ) { IJavaType javaType = superType . getJavaType ( ) ; javaType = ( IJavaType ) TypeLord . getDefaultParameterizedType ( javaType ) ; IType [ ] dfsArgTypes = dfs . getArgTypes ( ) ; ...
public class ClusterState { /** * Returns a list of member states for the given type . * @ param type The member type . * @ return A list of member states for the given type . */ public List < MemberState > getRemoteMemberStates ( Member . Type type ) { } }
List < MemberState > members = memberTypes . get ( type ) ; return members != null ? members : Collections . EMPTY_LIST ;
public class StandardBullhornData { /** * { @ inheritDoc } */ @ Override public < T extends EditHistoryEntity > FieldChangeListWrapper queryEntityForEditHistoryFieldChanges ( Class < T > entityType , String where , Set < String > fieldSet , QueryParams params ) { } }
return this . handleQueryForEntityEditHistoryFieldChange ( entityType , where , fieldSet , params ) ;
public class Configuration { /** * Write property and its attributes as json format to given * { @ link JsonGenerator } . * @ param jsonGen json writer * @ param config configuration * @ param name property name * @ throws IOException */ private static void appendJSONProperty ( JsonGenerator jsonGen , Configu...
// skip writing if given property name is empty or null if ( ! Strings . isNullOrEmpty ( name ) && jsonGen != null ) { jsonGen . writeStartObject ( ) ; jsonGen . writeStringField ( "key" , name ) ; jsonGen . writeStringField ( "value" , redactor . redact ( name , config . get ( name ) ) ) ; jsonGen . writeBooleanField ...
public class View { public Options getOptionsFor ( ClassDoc cd ) { } }
Options localOpt = getGlobalOptions ( ) ; overrideForClass ( localOpt , cd ) ; localOpt . setOptions ( cd ) ; return localOpt ;
public class OrientedBox3f { /** * Change the attributes of the oriented box . * The thirds axis is computed from the cross product with the two other axis . * The cross product may be { @ link Vector3f # crossLeftHand ( org . arakhne . afc . math . geometry . d3 . Vector3D ) } * or { @ link Vector3f # crossRight...
set ( cx , cy , cz , axis1x , axis1y , axis1z , axis2x , axis2y , axis2z , axis1Extent , axis2Extent , axis3Extent , CoordinateSystem3D . getDefaultCoordinateSystem ( ) ) ;
public class CmsWorkplaceManager { /** * Controls if the user / group icon in the administration view should be shown . < p > * @ param value < code > " true " < / code > if the user / group icon in the administration view should be shown , otherwise false */ public void setUserManagementEnabled ( String value ) { } ...
m_showUserGroupIcon = Boolean . valueOf ( value ) . booleanValue ( ) ; if ( CmsLog . INIT . isInfoEnabled ( ) ) { if ( m_showUserGroupIcon ) { CmsLog . INIT . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_USER_MANAGEMENT_ICON_ENABLED_0 ) ) ; } else { CmsLog . INIT . info ( Messages . get ( ) . getBu...
public class JBaseScreen { /** * 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 ( ) { } }
super . free ( ) ; // Free the sub - screens first ! if ( m_vFieldListList != null ) { for ( int i = m_vFieldListList . size ( ) - 1 ; i >= 0 ; i -- ) { // Step 1 - Disconnect the controls from the fields FieldList fieldList = this . getFieldList ( i ) ; if ( fieldList != null ) { this . disconnectControls ( fieldList ...
public class PostgreSqlRepositoryCollection { /** * Updates foreign keys based on referenced entity changes . * @ param entityType entity meta data * @ param attr current attribute * @ param updatedAttr updated attribute */ private void updateRefEntity ( EntityType entityType , Attribute attr , Attribute updatedA...
if ( isSingleReferenceType ( attr ) && isSingleReferenceType ( updatedAttr ) ) { dropForeignKey ( entityType , attr ) ; if ( attr . getRefEntity ( ) . getIdAttribute ( ) . getDataType ( ) != updatedAttr . getRefEntity ( ) . getIdAttribute ( ) . getDataType ( ) ) { updateColumnDataType ( entityType , updatedAttr ) ; } c...
public class GetRestApisResult { /** * The current page of elements from this collection . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setItems ( java . util . Collection ) } or { @ link # withItems ( java . util . Collection ) } if you want to override t...
if ( this . items == null ) { setItems ( new java . util . ArrayList < RestApi > ( items . length ) ) ; } for ( RestApi ele : items ) { this . items . add ( ele ) ; } return this ;
public class DeleteApplicationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteApplicationRequest deleteApplicationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteApplicationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteApplicationRequest . getApplicationName ( ) , APPLICATIONNAME_BINDING ) ; protocolMarshaller . marshall ( deleteApplicationRequest . getCreateTimestamp ( ...
public class RadialPickerLayout { /** * For the currently showing view ( either hours , minutes or seconds ) , re - calculate the position * for the selector , and redraw it at that position . The text representing the currently * selected value will be redrawn if required . * @ param newSelection Timpoint - Time...
switch ( index ) { case HOUR_INDEX : // The selection might have changed , recalculate the degrees and innerCircle values int hour = newSelection . getHour ( ) ; boolean isInnerCircle = isHourInnerCircle ( hour ) ; int degrees = ( hour % 12 ) * 360 / 12 ; if ( ! mIs24HourMode ) hour = hour % 12 ; if ( ! mIs24HourMode &...
public class CPDefinitionUtil { /** * Returns the first cp definition in the ordered set where uuid = & # 63 ; . * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching cp definition , or < code > null < / code > ...
return getPersistence ( ) . fetchByUuid_First ( uuid , orderByComparator ) ;
public class AssociateSubnetCidrBlockRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < AssociateSubnetCidrBlockRequest > getDryRunRequest ( ) { } }
Request < AssociateSubnetCidrBlockRequest > request = new AssociateSubnetCidrBlockRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class CommerceTaxFixedRateLocalServiceBaseImpl { /** * Returns a range of all the commerce tax fixed rates . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the r...
return commerceTaxFixedRatePersistence . findAll ( start , end ) ;
public class Snapshot { /** * The list of node types that this cluster snapshot is able to restore into . * @ param restorableNodeTypes * The list of node types that this cluster snapshot is able to restore into . */ public void setRestorableNodeTypes ( java . util . Collection < String > restorableNodeTypes ) { } ...
if ( restorableNodeTypes == null ) { this . restorableNodeTypes = null ; return ; } this . restorableNodeTypes = new com . amazonaws . internal . SdkInternalList < String > ( restorableNodeTypes ) ;
public class MainClassFinder { /** * Find a single main class from a given folder . * @ param rootFolder the root folder to search * @ return the main class or { @ code null } * @ throws IOException if the folder cannot be read */ public static String findSingleMainClass ( File rootFolder ) throws IOException { }...
MainClassesCallback callback = new MainClassesCallback ( ) ; MainClassFinder . doWithMainClasses ( rootFolder , callback ) ; return callback . getMainClass ( ) ;
public class SendBounceRequest { /** * A list of recipients of the bounced message , including the information required to create the Delivery Status * Notifications ( DSNs ) for the recipients . You must specify at least one < code > BouncedRecipientInfo < / code > in the * list . * @ param bouncedRecipientInfoL...
if ( bouncedRecipientInfoList == null ) { this . bouncedRecipientInfoList = null ; return ; } this . bouncedRecipientInfoList = new com . amazonaws . internal . SdkInternalList < BouncedRecipientInfo > ( bouncedRecipientInfoList ) ;
public class OrderBy { /** * Parse in the form " field1 : asc , field2 : desc , . . . , fieldn : asc | null _ smallest " * < br / > * Examples : * < br / > * " f1 , f2 , f3" * < br / > * " f1 : asc , f2 : desc , f3" * < br / > * " f1 , f2 : asc | null _ smallest , f3 : desc | null _ biggest " */ public ...
OrderBy toReturn = new OrderBy ( ) ; String [ ] orderBys = orderBy . split ( "," ) ; for ( String order : orderBys ) { order = order . trim ( ) ; String [ ] fields = order . split ( ":" ) ; Order ord = Order . ASC ; NullOrder nullOrd = NullOrder . NULL_SMALLEST ; if ( fields . length > 1 ) { String [ ] qualifiers = fie...
public class FPSCounter { /** * Start check of execution time * @ param extra */ public static void startCheck ( String extra ) { } }
startCheckTime = System . currentTimeMillis ( ) ; nextCheckTime = startCheckTime ; Log . d ( Log . SUBSYSTEM . TRACING , "FPSCounter" , "[%d] startCheck %s" , startCheckTime , extra ) ;
public class Dispatching { /** * Partial application of the last ( rightmost ) parameter to a binary * predicate . * @ param < T1 > the predicate first parameter type * @ param < T2 > the predicate second parameter type * @ param predicate the predicate to be curried * @ param second the value to be curried a...
dbc . precondition ( predicate != null , "cannot bind parameter of a null predicate" ) ; return first -> predicate . test ( first , second ) ;
public class InternalErrorSettings { /** * Set the default storage file provider . In case you played around and want to * restore the default behavior . * @ see # setStorageFileProvider ( IFunction ) * @ since 8.0.3 */ public static void setDefaultStorageFileProvider ( ) { } }
setStorageFileProvider ( aMetadata -> { final LocalDateTime aNow = PDTFactory . getCurrentLocalDateTime ( ) ; final String sFilename = StringHelper . getConcatenatedOnDemand ( PDTIOHelper . getLocalDateTimeForFilename ( aNow ) , "-" , aMetadata . getErrorID ( ) ) + ".xml" ; return WebFileIO . getDataIO ( ) . getFile ( ...
public class ClosureTypeComputer { /** * This method is only public for testing purpose . * @ noreference This method is not intended to be referenced by clients . */ public void selectStrategy ( ) { } }
LightweightTypeReference expectedType = expectation . getExpectedType ( ) ; if ( expectedType == null ) { strategy = getClosureWithoutExpectationHelper ( ) ; } else { JvmOperation operation = functionTypes . findImplementingOperation ( expectedType ) ; JvmType type = expectedType . getType ( ) ; int closureParameterSiz...
public class LinkFromSelect { /** * { @ inheritDoc } */ @ SuppressWarnings ( "unchecked" ) @ Override protected boolean executeOneCompleteStmt ( final String _complStmt , final List < OneSelect > _oneSelects ) throws EFapsException { } }
boolean ret = false ; ConnectionResource con = null ; try { LinkFromSelect . LOG . debug ( "Executing SQLL: {}" , _complStmt ) ; List < Object [ ] > rows = null ; boolean cached = false ; if ( isCacheEnabled ( ) ) { final QueryKey querykey = QueryKey . get ( getKey ( ) , _complStmt ) ; final Cache < QueryKey , Object >...
public class ReflectUtils { /** * Call the class constructor with the given arguments * @ param c The class * @ param args The arguments * @ return The constructed object */ public static < T > T callConstructor ( Class < T > c , Class < ? > [ ] argTypes , Object [ ] args ) { } }
try { Constructor < T > cons = c . getConstructor ( argTypes ) ; return cons . newInstance ( args ) ; } catch ( InvocationTargetException e ) { throw getCause ( e ) ; } catch ( IllegalAccessException e ) { throw new IllegalStateException ( e ) ; } catch ( NoSuchMethodException e ) { throw new IllegalArgumentException (...
public class ThreadUtils { /** * Waits for a specified duration on a { @ link Condition } possibly checking every specified interval * on whether the { @ link Condition } has been satisfied . * @ param duration a long value indicating the duration of time to wait for the Condition to be satisfied . * @ param time...
return WaitTask . newWaitTask ( ) . waitFor ( duration , timeUnit ) ;
public class PackageManagerUtils { /** * Checks if the device has a compass sensor . * @ param context the context . * @ return { @ code true } if the device has a compass sensor . */ @ TargetApi ( Build . VERSION_CODES . FROYO ) public static boolean hasCompassSensorFeature ( Context context ) { } }
return hasCompassSensorFeature ( context . getPackageManager ( ) ) ;