signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class BitcointoyouMarketDataServiceRaw { /** * List all public trades made at Bitcointoyou Exchange .
* @ param currencyPair the trade currency pair
* @ param tradeTimestamp the trade timestamp
* @ param minTradeId the minimum trade ID
* @ return an array of { @ link BitcointoyouPublicTrade }
* @ throw... | String currency = currencyPair . base . toString ( ) ; try { return bitcointoyou . getTrades ( currency , tradeTimestamp , minTradeId ) ; } catch ( BitcointoyouException e ) { throw new ExchangeException ( e . getError ( ) ) ; } |
public class GrowingNeuralGas { /** * Clustering neurons into k clusters .
* @ param k the number of clusters . */
public void partition ( int k ) { } } | double [ ] [ ] reps = new double [ nodes . size ( ) ] [ ] ; int i = 0 ; for ( Node neuron : nodes ) reps [ i ++ ] = neuron . w ; double [ ] [ ] proximity = new double [ nodes . size ( ) ] [ ] ; for ( i = 0 ; i < nodes . size ( ) ; i ++ ) { proximity [ i ] = new double [ i + 1 ] ; for ( int j = 0 ; j < i ; j ++ ) proxim... |
public class TimeZone { /** * Sets the < code > TimeZone < / code > that is
* returned by the < code > getDefault < / code > method . If < code > zone < / code >
* is null , reset the default to the value it had originally when the
* VM first started .
* @ param tz the new default time zone
* @ hide unsupport... | defaultZone = tz ; java . util . TimeZone jdkZone = null ; if ( defaultZone instanceof JavaTimeZone ) { jdkZone = ( ( JavaTimeZone ) defaultZone ) . unwrap ( ) ; } else { // Keep java . util . TimeZone default in sync so java . util . Date
// can interoperate with android . icu . util classes .
if ( tz != null ) { if (... |
public class GeoPackageValidate { /** * Check the file extension to see if it is a GeoPackage
* @ param file
* GeoPackage file
* @ return true if GeoPackage extension */
public static boolean hasGeoPackageExtension ( File file ) { } } | String extension = GeoPackageIOUtils . getFileExtension ( file ) ; boolean isGeoPackage = extension != null && ( extension . equalsIgnoreCase ( GeoPackageConstants . GEOPACKAGE_EXTENSION ) || extension . equalsIgnoreCase ( GeoPackageConstants . GEOPACKAGE_EXTENDED_EXTENSION ) ) ; return isGeoPackage ; |
public class VLDockingUtils { /** * Fixes an VLDocking bug consisting on dockables that belong to a docking desktop have no state on it .
* @ param dockable
* the dockable candidate .
* @ return its dockable state . If none then registers the dockable again and ensures dockable state is not null . */
public stati... | Assert . notNull ( dockingDesktop , "dockingDesktop" ) ; Assert . notNull ( dockable , "dockable" ) ; final DockingContext dockingContext = dockingDesktop . getContext ( ) ; final DockKey dockKey = dockable . getDockKey ( ) ; DockableState dockableState = dockingDesktop . getDockableState ( dockable ) ; final Boolean t... |
public class ContainerBase { /** * { @ inheritDoc }
* @ see org . jboss . shrinkwrap . api . Archive # add ( org . jboss . shrinkwrap . api . asset . Asset ,
* org . jboss . shrinkwrap . api . ArchivePath ) */
@ Override public T add ( Asset asset , ArchivePath target ) throws IllegalArgumentException { } } | this . getArchive ( ) . add ( asset , target ) ; return covarientReturn ( ) ; |
public class PrcInvoiceGfe { /** * < p > Process entity request . < / p >
* @ param pReqVars additional param , e . g . return this line ' s
* document in " nextEntity " for farther process
* @ param pRequestData Request Data
* @ param pEntity Entity to process
* @ return Entity processed for farther process ... | pReqVars . put ( "DebtorCreditortaxDestinationdeepLevel" , 2 ) ; Set < String > ndFlDc = new HashSet < String > ( ) ; ndFlDc . add ( "itsId" ) ; ndFlDc . add ( "itsName" ) ; ndFlDc . add ( "isForeigner" ) ; ndFlDc . add ( "taxDestination" ) ; pReqVars . put ( "DebtorCreditorneededFields" , ndFlDc ) ; T invoice = this .... |
public class HighwayHash { /** * NOTE : The 64 - bit HighwayHash algorithm is declared stable and no longer subject to change .
* @ param data array with data bytes
* @ param offset position of first byte of data to read from
* @ param length number of bytes from data to read
* @ param key array of size 4 with ... | HighwayHash h = new HighwayHash ( key ) ; h . processAll ( data , offset , length ) ; return h . finalize64 ( ) ; |
public class BaseFixData { /** * GetRecordFromCode Method . */
public static Record getRecordFromCode ( BaseField field , String strDesc , String strFieldName ) { } } | Record recSecond = ( ( ReferenceField ) field ) . getReferenceRecord ( ) ; return BaseFixData . getRecordFromCode ( field , strDesc , strFieldName , recSecond ) ; |
public class PasswordHash { /** * Compares two byte arrays in length - constant time . This comparison method is used so that password hashes cannot
* be extracted from an on - line system using a timing attack and then attacked off - line .
* @ param a
* the first byte array
* @ param b
* the second byte arr... | int diff = a . length ^ b . length ; for ( int i = 0 ; i < a . length && i < b . length ; i ++ ) { diff |= a [ i ] ^ b [ i ] ; } return diff == 0 ; |
public class TldRegionTracker { /** * Computes the gradient and changes the reference to the current pyramid */
protected void updateCurrent ( ImagePyramid < I > image ) { } } | this . currentImage = image ; for ( int i = 0 ; i < image . getNumLayers ( ) ; i ++ ) { gradient . process ( image . getLayer ( i ) , currentDerivX [ i ] , currentDerivY [ i ] ) ; } |
public class DESedeKeySpec { /** * Checks if the given DES - EDE key , starting at < code > offset < / code >
* inclusive , is parity - adjusted .
* @ param key a byte array which holds the key value
* @ param offset the offset into the byte array
* @ return true if the given DES - EDE key is parity - adjusted ... | if ( key . length - offset < 24 ) { throw new InvalidKeyException ( "Wrong key size" ) ; } if ( DESKeySpec . isParityAdjusted ( key , offset ) == false || DESKeySpec . isParityAdjusted ( key , offset + 8 ) == false || DESKeySpec . isParityAdjusted ( key , offset + 16 ) == false ) { return false ; } return true ; |
public class ICUService { /** * Return a snapshot of the mapping from display names to visible
* IDs for this service . This set will not change as factories
* are added or removed , but the supported ids will , so there is
* no guarantee that all and only the ids in the returned map will
* be visible and suppo... | SortedMap < String , String > dncache = null ; LocaleRef ref = dnref ; if ( ref != null ) { dncache = ref . get ( locale , com ) ; } while ( dncache == null ) { synchronized ( this ) { if ( ref == dnref || dnref == null ) { dncache = new TreeMap < String , String > ( com ) ; // sorted
Map < String , Factory > m = getVi... |
public class MtasSolrCollectionCache { /** * Gets the .
* @ param id the id
* @ return the hash set
* @ throws IOException Signals that an I / O exception has occurred . */
private HashSet < String > get ( String id ) throws IOException { } } | if ( collectionCachePath != null ) { Date date = clear ( ) ; if ( idToVersion . containsKey ( id ) ) { String version = idToVersion . get ( id ) ; expirationVersion . put ( version , date . getTime ( ) + ( 1000 * lifeTime ) ) ; MtasSolrCollectionCacheItem newItem = read ( version , date . getTime ( ) ) ; if ( newItem !... |
public class PortletEventCoordinatationService { /** * Returns a request scoped PortletEventQueue used to track events to process and events to
* dispatch */
@ Override public PortletEventQueue getPortletEventQueue ( HttpServletRequest request ) { } } | request = this . portalRequestUtils . getOriginalPortalRequest ( request ) ; synchronized ( PortalWebUtils . getRequestAttributeMutex ( request ) ) { PortletEventQueue portletEventQueue = ( PortletEventQueue ) request . getAttribute ( PORTLET_EVENT_QUEUE ) ; if ( portletEventQueue == null ) { portletEventQueue = new Po... |
public class RemoteCompilationProvider { /** * turns a template name and a servlet path into a */
String createTemplateServerRequest ( String servletPath , String templateName ) { } } | String pathInfo = servletPath . substring ( servletPath . indexOf ( "/" , TEMPLATE_LOAD_PROTOCOL . length ( ) ) ) ; if ( templateName != null ) { pathInfo = pathInfo + templateName ; } return pathInfo ; |
public class KafkaSource { /** * this . previousOffsetFetchEpochTimes need to be initialized once */
private synchronized void getAllPreviousOffsetState ( SourceState state ) { } } | if ( this . doneGettingAllPreviousOffsets ) { return ; } this . previousOffsets . clear ( ) ; this . previousLowWatermarks . clear ( ) ; this . previousExpectedHighWatermarks . clear ( ) ; this . previousOffsetFetchEpochTimes . clear ( ) ; this . previousStartFetchEpochTimes . clear ( ) ; this . previousStopFetchEpochT... |
public class CmsJspTagContainer { /** * Returns the formatter configuration for the given element . < p >
* @ param cms the cms context
* @ param element the element bean
* @ param adeConfig the ADE configuration
* @ param containerName the container name
* @ param containerType the container type
* @ param... | I_CmsFormatterBean formatterBean = null ; String settingsKey = CmsFormatterConfig . getSettingsKeyForContainer ( containerName ) ; if ( ( element . getFormatterId ( ) != null ) && ! element . getFormatterId ( ) . isNullUUID ( ) ) { if ( ! element . getSettings ( ) . containsKey ( settingsKey ) || element . getSettings ... |
public class MvpBasePresenter { /** * { @ inheritDoc } */
@ Override public void detachView ( ) { } } | detachView ( true ) ; if ( viewRef != null ) { viewRef . clear ( ) ; viewRef = null ; } |
public class NagiosWriter { /** * Initializes the logger . This is called when we need to create a new
* logger for the given file name .
* @ param fileStr
* @ return a new Logger instance for the given fileStr
* @ throws IOException */
protected Logger initLogger ( String fileStr ) throws IOException { } } | String loggerName = "NagiosWriter" + this . hashCode ( ) ; final PatternLayoutEncoder encoder = new PatternLayoutEncoder ( ) ; encoder . setContext ( loggerContext ) ; encoder . setPattern ( LOG_PATTERN ) ; encoder . start ( ) ; final FileAppender appender = new FileAppender ( ) ; appender . setContext ( loggerContext ... |
public class ContentPump { /** * Set class loader for current thread and for Confifguration based on
* Hadoop home .
* @ param hdConfDir Hadoop home directory
* @ param conf Hadoop configuration
* @ throws MalformedURLException */
private static void setClassLoader ( File hdConfDir , Configuration conf ) throws... | ClassLoader parent = conf . getClassLoader ( ) ; URL url = hdConfDir . toURI ( ) . toURL ( ) ; URL [ ] urls = new URL [ 1 ] ; urls [ 0 ] = url ; ClassLoader classLoader = new URLClassLoader ( urls , parent ) ; Thread . currentThread ( ) . setContextClassLoader ( classLoader ) ; conf . setClassLoader ( classLoader ) ; |
public class Tree { /** * Removes the sub - node at the specified path . Returns the node that was
* removed . Samples : < br >
* < br >
* Tree removed = node . remove ( " path . to . node " ) ; < br >
* or < br >
* Tree removed = node . remove ( " array [ 3 ] . subarray [ 2 ] " ) ;
* @ param path
* path ... | Tree child = getChild ( path , false ) ; if ( child != null ) { child . remove ( ) ; } return child ; |
public class JSettingsPanel { /** * GEN - LAST : event _ jComboBoxChartTypeActionPerformed */
private void jCheckBoxDrawMarkersActionPerformed ( java . awt . event . ActionEvent evt ) { } } | // GEN - FIRST : event _ jCheckBoxDrawMarkersActionPerformed
if ( jCheckBoxDrawMarkers . isSelected ( ) ) parent . getGraphPanelChart ( ) . getChartSettings ( ) . setChartMarkers ( ChartSettings . CHART_MARKERS_YES ) ; else parent . getGraphPanelChart ( ) . getChartSettings ( ) . setChartMarkers ( ChartSettings . CHART... |
public class ColorUtilities { /** * Convert hex color to Color .
* @ return the Color object . */
public static Color fromHex ( String hex ) { } } | if ( hex . startsWith ( "#" ) ) { hex = hex . substring ( 1 ) ; } int length = hex . length ( ) ; int total = 6 ; if ( length < total ) { // we have a shortened version
String token = hex ; int tokenLength = token . length ( ) ; for ( int i = 0 ; i < total ; i = i + tokenLength ) { hex += token ; } } int index = 0 ; St... |
public class Parcel { /** * all */
public static ParcelCollection all ( Map < String , Object > params ) throws EasyPostException { } } | return all ( params , null ) ; |
public class ProducerUtility { /** * Filters producers by decorator and returns it .
* @ param decoratorName Decorator name
* @ param producers { @ link List } of { @ link ProducerAO } to filter
* @ param graphData Graph data */
public static ProducerDecoratorBean filterProducersByDecoratorName ( String decorator... | ProducerDecoratorBean result = new ProducerDecoratorBean ( ) ; result . setName ( decoratorName ) ; List < ProducerAO > decoratedProducers = new ArrayList < > ( ) ; for ( ProducerAO producer : producers ) { IDecorator decorator = findOrCreateDecorator ( producer ) ; if ( decorator . getName ( ) . equals ( decoratorName... |
public class SailthruClient { /** * Synchronized singleton instance method using default URL string
* @ param apiKey Sailthru API key string
* @ param apiSecret Sailthru API secret string
* @ return singleton instance of SailthruClient
* @ deprecated */
public static synchronized SailthruClient getInstance ( St... | if ( _instance == null ) { _instance = new SailthruClient ( apiKey , apiSecret , DEFAULT_API_URL ) ; } return _instance ; |
public class SessionUtil { /** * Perform important client side validation :
* validate both token url and sso url contains same prefix
* ( protocol + host + port ) as the given authenticator url .
* Explanation :
* This provides a way for the user to ' authenticate ' the IDP it is
* sending his / her credenti... | try { if ( ! isPrefixEqual ( loginInput . getAuthenticator ( ) , tokenUrl ) || ! isPrefixEqual ( loginInput . getAuthenticator ( ) , ssoUrl ) ) { logger . debug ( "The specified authenticator {} is not supported." , loginInput . getAuthenticator ( ) ) ; throw new SnowflakeSQLException ( SqlState . SQLCLIENT_UNABLE_TO_E... |
public class MOEADD { /** * Calculate the perpendicular distance between the solution and reference line */
public double calculateDistance ( S individual , double [ ] lambda , double [ ] z_ , double [ ] nz_ ) { } } | double scale ; double distance ; double [ ] vecInd = new double [ problem . getNumberOfObjectives ( ) ] ; double [ ] vecProj = new double [ problem . getNumberOfObjectives ( ) ] ; // normalize the weight vector ( line segment )
double nd = norm_vector ( lambda ) ; for ( int i = 0 ; i < problem . getNumberOfObjectives (... |
public class Async { /** * Convert a synchronous action call into an asynchronous function call through an Observable .
* < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toAsync . ans . png " alt = " " >
* @ param < T1 > the first parameter type
... | return toAsync ( Actions . toFunc ( action ) , scheduler ) ; |
public class MicroHessianInput { /** * Reads a long
* < pre >
* L b64 b56 b48 b40 b32 b24 b16 b8
* < / pre > */
public long readLong ( ) throws IOException { } } | int tag = is . read ( ) ; if ( tag != 'L' ) throw protocolException ( "expected long" ) ; long b64 = is . read ( ) ; long b56 = is . read ( ) ; long b48 = is . read ( ) ; long b40 = is . read ( ) ; long b32 = is . read ( ) ; long b24 = is . read ( ) ; long b16 = is . read ( ) ; long b8 = is . read ( ) ; return ( ( b64 ... |
public class CreateFrameRecipe { /** * This function will be called by the REST API handler to initiate making
* of the recipe . It returns a { @ link Job } which will hold the created frame
* once it is finished . */
public Job < Frame > exec ( ) { } } | fillMissingParameters ( ) ; Job < Frame > job = new Job < > ( dest , Frame . class . getName ( ) , "CreateFrame:original" ) ; CreateFrameExecutor cfe = new CreateFrameExecutor ( job ) ; checkParametersValidity ( ) ; buildRecipe ( cfe ) ; checkParametersValidity2 ( cfe ) ; return job . start ( cfe , cfe . workAmount ( )... |
public class CmsCategoryField { /** * Adds children item to the category tree and select the categories . < p >
* @ param parent the parent item
* @ param children the list of children
* @ param selectedCategories the list of categories to select */
private void addChildren ( CmsTreeItem parent , List < CmsCatego... | if ( children != null ) { for ( CmsCategoryTreeEntry child : children ) { // set the category tree item and add to parent tree item
CmsTreeItem treeItem ; boolean isPartofPath = false ; Iterator < String > it = selectedCategories . iterator ( ) ; while ( it . hasNext ( ) ) { String path = it . next ( ) ; if ( path . co... |
public class Distribution { /** * Creates a { @ link Distribution } .
* @ param count the count of the population values .
* @ param sum the sum of the population values .
* @ param sumOfSquaredDeviations the sum of squared deviations of the population values .
* @ param bucketOptions the bucket options used to... | Utils . checkArgument ( count >= 0 , "count should be non-negative." ) ; Utils . checkArgument ( sumOfSquaredDeviations >= 0 , "sum of squared deviations should be non-negative." ) ; if ( count == 0 ) { Utils . checkArgument ( sum == 0 , "sum should be 0 if count is 0." ) ; Utils . checkArgument ( sumOfSquaredDeviation... |
public class AxisShufflingVertexReader { /** * Returns the value of a given axis .
* @ param x Input x value .
* @ param y Input y value .
* @ param z Input z value .
* @ param axis Axis to return .
* @ return The value of a given axis . */
private double getValue ( final double x , final double y , final dou... | switch ( axis ) { case X : return x ; case X_INVERTED : return - x ; case Y : return y ; case Y_INVERTED : return - y ; case Z : return z ; case Z_INVERTED : return - z ; default : throw new IllegalArgumentException ( "Unsupported axis." ) ; } |
public class CommitLogSegmentManager { /** * Differs from the above because it can work on any file instead of just existing
* commit log segments managed by this manager .
* @ param file segment file that is no longer in use . */
void recycleSegment ( final File file ) { } } | if ( isCapExceeded ( ) || CommitLogDescriptor . fromFileName ( file . getName ( ) ) . getMessagingVersion ( ) != MessagingService . current_version ) { // ( don ' t decrease managed size , since this was never a " live " segment )
logger . debug ( "(Unopened) segment {} is no longer needed and will be deleted now" , fi... |
public class BodyAndHeaderParser { /** * TODO : do we care about these being ` read - only ` ? It does ensure any underlying array is hidden . . . */
private ByteBuffer submitBuffer ( ByteBuffer in ) { } } | ByteBuffer out = in . asReadOnlyBuffer ( ) ; in . position ( in . limit ( ) ) ; return out ; |
public class CFMLWriterWSPref { /** * prints the characters from the buffer and resets it
* TODO : make sure that printBuffer ( ) is called at the end of the stream in case we have some
* characters there ! ( flush ( ) ? ) */
synchronized void printBuffer ( ) throws IOException { } } | // TODO : is synchronized really needed here ?
int len = sb . length ( ) ; if ( len > 0 ) { char [ ] chars = new char [ len ] ; sb . getChars ( 0 , len , chars , 0 ) ; sb . setLength ( 0 ) ; super . write ( chars , 0 , chars . length ) ; } |
public class LuceneIndex { /** * Deletes all the { @ link Document } s . */
public void truncate ( ) { } } | Log . info ( "Truncating index" ) ; try { indexWriter . deleteAll ( ) ; } catch ( IOException e ) { Log . error ( e , "Error while truncating index" ) ; throw new RuntimeException ( e ) ; } |
public class OnJqueryFunction { /** * creates a new { @ link OnJqueryFunction } instance
* @ param selector The CSS selector for event delegation
* @ return new { @ link OnJqueryFunction } instance */
public static OnJqueryFunction on ( final Attr events , final Attr selector , final Attr data , JavaScriptInlineFun... | return new OnJqueryFunction ( events , selector , data , handler ) ; |
public class AppServicePlansInner { /** * Restart all apps in an App Service plan .
* Restart all apps in an App Service plan .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service plan .
* @ throws IllegalArgumentException thrown if param... | return restartWebAppsWithServiceResponseAsync ( resourceGroupName , name ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ; |
public class ObjectExtensions { /** * The binary < code > + < / code > operator that concatenates two strings .
* @ param a
* an { @ link Object } .
* @ param b
* a { @ link String } .
* @ return < code > a + b < / code >
* @ since 2.3 */
@ Pure /* not guaranteed pure , since toString ( ) is invoked on the ... | return a + b ; |
public class SourceNode { /** * Like ` String . prototype . join ` except for SourceNodes . Inserts ` aStr ` between each of ` this . children ` .
* @ param aSep
* The separator . */
public void join ( String aSep ) { } } | List < Object > newChildren ; int i ; int len = this . children . size ( ) ; if ( len > 0 ) { newChildren = new ArrayList < > ( ) ; for ( i = 0 ; i < len - 1 ; i ++ ) { newChildren . add ( this . children . get ( i ) ) ; newChildren . add ( aSep ) ; } newChildren . add ( this . children . get ( i ) ) ; this . children ... |
public class PorterStemmer { /** * / * doublec ( j ) is true < = > j , ( j - 1 ) contain a double consonant . */
private final boolean doublec ( int j ) { } } | if ( j < 1 ) return false ; if ( sb . charAt ( j ) != sb . charAt ( j - 1 ) ) return false ; return cons ( j ) ; |
public class WebSocket { /** * 给自身发送消息 , 消息类型是Object [ ]
* @ param mapconvable 是否convertMapTo
* @ param message 不可为空 , 只能是String或byte [ ] 或可JavaBean对象 , 或Object [ ]
* @ param last 是否最后一条
* @ return 0表示成功 , 非0表示错误码 */
private CompletableFuture < Integer > send ( boolean mapconvable , Object message , boolean las... | if ( message instanceof CompletableFuture ) { return ( ( CompletableFuture ) message ) . thenCompose ( ( json ) -> { if ( json == null || json instanceof CharSequence || json instanceof byte [ ] ) { return sendPacket ( new WebSocketPacket ( ( Serializable ) json , last ) ) ; } else if ( message instanceof WebSocketPack... |
public class OWLAnnotationImpl { /** * Determines if this annotation is an annotation used to deprecate an IRI .
* This is the case if the annotation property has an IRI of
* { @ code owl : deprecated } and the value of the annotation is
* { @ code " true " ^ ^ xsd : boolean }
* @ return { @ code true } if this... | return property . isDeprecated ( ) && value instanceof OWLLiteral && ( ( OWLLiteral ) value ) . isBoolean ( ) && ( ( OWLLiteral ) value ) . parseBoolean ( ) ; |
public class Transport { /** * Connect the transport
* @ param timeout
* @ return whether the transport was connected
* @ throws TransportException */
public synchronized boolean connect ( long timeout ) throws TransportException { } } | int st = this . state ; try { switch ( st ) { case 0 : break ; case 1 : // already connecting
this . thread . wait ( timeout ) ; /* wait for doConnect */
st = this . state ; switch ( st ) { case 1 : /* doConnect never returned */
this . state = 6 ; cleanupThread ( timeout ) ; throw new ConnectionTimeoutException ( "Con... |
public class Transform3D { /** * Multiply this matrix by the tuple t and place the result back into the
* tuple ( t = this * t ) .
* @ param t
* the tuple to be multiplied by this matrix and then replaced */
public void transform ( Tuple3D < ? > t ) { } } | double x , y , z ; x = this . m00 * t . getX ( ) + this . m01 * t . getY ( ) + this . m02 * t . getZ ( ) + this . m03 ; y = this . m10 * t . getX ( ) + this . m11 * t . getY ( ) + this . m12 * t . getZ ( ) + this . m13 ; z = this . m20 * t . getX ( ) + this . m21 * t . getY ( ) + this . m22 * t . getZ ( ) + this . m23 ... |
public class Grid { /** * Method declaration
* @ param i */
private void calcAutoWidth ( int i ) { } } | int w = 10 ; w = Math . max ( w , fMetrics . stringWidth ( sColHead [ i ] ) ) ; for ( int j = 0 ; j < iRowCount ; j ++ ) { String [ ] s = ( String [ ] ) ( vData . elementAt ( j ) ) ; w = Math . max ( w , fMetrics . stringWidth ( s [ i ] ) ) ; } iColWidth [ i ] = w + 6 ; |
public class TraceMethod { /** * Stops the elapsed ( cpu ) time since creation of this TraceMethod instance . */
public void stopTime ( ) { } } | this . elapsedTime = System . currentTimeMillis ( ) - this . startTime ; this . elapsedCpuTime = ( ManagementFactory . getThreadMXBean ( ) . getCurrentThreadCpuTime ( ) - this . startCpuTime ) / 1000000 ; |
public class HString { /** * Finds all matches to the given token regular expression in this HString .
* @ param regex the token regex to match
* @ return Stream of matches */
public Stream < HString > findAllPatterns ( @ NonNull TokenRegex regex ) { } } | return Streams . asStream ( new Iterator < HString > ( ) { TokenMatcher m = regex . matcher ( HString . this ) ; HString nextMatch = null ; private boolean advance ( ) { if ( nextMatch == null && m . find ( ) ) { nextMatch = m . group ( ) ; } return nextMatch != null ; } @ Override public boolean hasNext ( ) { return a... |
public class VisLmlSyntax { /** * InputValidator implementations ' attributes . */
protected void registerValidatorAttributes ( ) { } } | // CustomValidator :
addAttributeProcessor ( new CustomValidatorLmlAttribute ( ) , "validator" , "validate" , "method" , "action" , "check" ) ; // FormInputValidator :
addAttributeProcessor ( new ErrorMessageLmlAttribute ( ) , "error" , "errorMsg" , "errorMessage" , "formError" ) ; addAttributeProcessor ( new HideOnEmp... |
public class LevelRangeFilter { /** * Return the decision of this filter . */
public int decide ( LoggingEvent event ) { } } | if ( this . levelMin != null && event . getLevel ( ) . isGreaterOrEqual ( levelMin ) == false ) { // level of event is less than minimum
return Filter . DENY ; } if ( this . levelMax != null && event . getLevel ( ) . toInt ( ) > levelMax . toInt ( ) ) { // level of event is greater than maximum
// Alas , there is no Le... |
public class ServiceBasedAppLauncher { /** * Starts the { @ link ApplicationLauncher } by starting all associated services . This method also adds a shutdown hook
* that invokes { @ link # stop ( ) } and the { @ link # close ( ) } methods . So { @ link # stop ( ) } and { @ link # close ( ) } need not be
* called ex... | if ( this . hasStarted ) { LOG . warn ( "ApplicationLauncher has already started" ) ; return ; } this . hasStarted = true ; this . serviceManager = new ServiceManager ( this . services ) ; // A listener that shutdowns the application if any service fails .
this . serviceManager . addListener ( new ServiceManager . List... |
public class LongStreamEx { /** * Returns a { @ code LongStreamEx } object which wraps given
* { @ link LongStream } .
* The supplied stream must not be consumed or closed when this method is
* called . No operation must be performed on the supplied stream after it ' s
* wrapped .
* @ param stream original st... | return stream instanceof LongStreamEx ? ( LongStreamEx ) stream : new LongStreamEx ( stream , StreamContext . of ( stream ) ) ; |
public class BeanUtils { /** * 设置属性
* @ param bean 对象
* @ param name 属性名
* @ param clazz 设置值的类
* @ param value 属性值
* @ param < T > 和值对应的类型
* @ throws Exception 设值异常 */
public static < T > void setProperty ( Object bean , String name , Class < T > clazz , T value ) throws Exception { } } | Method method = ReflectUtils . getPropertySetterMethod ( bean . getClass ( ) , name , clazz ) ; if ( method . isAccessible ( ) ) { method . invoke ( bean , value ) ; } else { try { method . setAccessible ( true ) ; method . invoke ( bean , value ) ; } finally { method . setAccessible ( false ) ; } } |
public class UnsafeRow { /** * Creates an empty UnsafeRow from a byte array with specified numBytes and numFields .
* The returned row is invalid until we call copyFrom on it . */
public static UnsafeRow createFromByteArray ( int numBytes , int numFields ) { } } | final UnsafeRow row = new UnsafeRow ( numFields ) ; row . pointTo ( new byte [ numBytes ] , numBytes ) ; return row ; |
public class SubmissionUtils { /** * Re - creates the approved document submitted by the client from
* the submission document .
* @ param submissionDoc Submission document from the submission database
* @ return Document submitted by user for update */
static public JSONObject getApprovedDocumentFromSubmission (... | JSONObject submissionInfo = submissionDoc . getJSONObject ( "nunaliit_submission" ) ; // Check if an approved version of the document is available
JSONObject doc = submissionInfo . optJSONObject ( "approved_doc" ) ; if ( null != doc ) { JSONObject reserved = submissionInfo . optJSONObject ( "approved_reserved" ) ; retu... |
public class LoadBasedAutoScalingConfigurationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( LoadBasedAutoScalingConfiguration loadBasedAutoScalingConfiguration , ProtocolMarshaller protocolMarshaller ) { } } | if ( loadBasedAutoScalingConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( loadBasedAutoScalingConfiguration . getLayerId ( ) , LAYERID_BINDING ) ; protocolMarshaller . marshall ( loadBasedAutoScalingConfiguration . getEnable ... |
public class BuildFilterProviderData { /** * Builder */
public static < T > BuildFilterProviderData < T > of ( BuildFilterProvider < T > provider , T data ) { } } | return new BuildFilterProviderData < > ( provider , data ) ; |
public class StringUtils { /** * Computes the longest common substring of s and t .
* The longest common substring of a and b is the longest run of
* characters that appear in order inside both a and b . Both a and b
* may have other extraneous characters along the way . This is like
* edit distance but with no... | int [ ] [ ] d ; // matrix
int n ; // length of s
int m ; // length of t
int i ; // iterates through s
int j ; // iterates through t
// int cost ; / / cost
// Step 1
n = s . length ( ) ; m = t . length ( ) ; if ( n == 0 ) { return 0 ; } if ( m == 0 ) { return 0 ; } d = new int [ n + 1 ] [ m + 1 ] ; // Step 2
for ( i = 0... |
public class XlsWorksheet { /** * Returns the sheets from the given Excel XLS file .
* @ param file The file with the name of the XLS file
* @ return The sheet names from the XLS file
* @ throws IOException if the file cannot be opened
* @ throws jxl . read . biff . BiffException if there is a format error with... | Workbook workbook = Workbook . getWorkbook ( file ) ; String [ ] sheets = workbook . getSheetNames ( ) ; workbook . close ( ) ; return sheets ; |
public class Vectors { /** * Creates a plus function that adds given { @ code value } to it ' s argument .
* @ param arg a value to be added to function ' s argument
* @ return a closure object that does { @ code _ + _ } */
public static VectorFunction asPlusFunction ( final double arg ) { } } | return new VectorFunction ( ) { @ Override public double evaluate ( int i , double value ) { return value + arg ; } } ; |
public class ResourceUtils { /** * Determine whether the given URL points to a resource in the file system ,
* that is , has protocol " file " or " vfs " .
* @ param url the URL to check
* @ return whether the URL has been identified as a file system URL */
public static boolean isFileURL ( URL url ) { } } | String protocol = url . getProtocol ( ) ; return ( URL_PROTOCOL_FILE . equals ( protocol ) || protocol . startsWith ( URL_PROTOCOL_VFS ) ) ; |
public class MkAppTree { /** * Creates a new directory entry representing the specified node .
* @ param node the node to be represented by the new entry
* @ param routingObjectID the id of the routing object of the node
* @ param parentDistance the distance from the routing object of the node to
* the routing ... | return new MkAppDirectoryEntry ( routingObjectID , parentDistance , node . getPageID ( ) , node . coveringRadiusFromEntries ( routingObjectID , this ) , null ) ; |
public class DCacheBase { /** * This is a helper method to add pre - invalidation listener to all entries . */
public synchronized boolean addPreInvalidationListener ( PreInvalidationListener listener ) { } } | if ( bEnableListener && listener != null ) { if ( eventSource . getPreInvalidationListenerCount ( ) > 0 && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "addPreInvalidationListener() cacheName=" + this . cacheName + " one already exists. Overwriting old listener." ) ; } eventSource . addListener ( listener ) ; return t... |
public class Strings { /** * Converts a word sequence into a single camel - case word that starts with a lowercase letter .
* @ param text - a word sequence with the given separator
* @ param separator - a word separator
* @ return a single camel - case word */
public static String toLowerCamelCase ( String text ... | char [ ] chars = text . toCharArray ( ) ; int base = 0 , top = 0 ; do { while ( top < chars . length && chars [ top ] != separator ) { chars [ base ++ ] = Character . toLowerCase ( chars [ top ++ ] ) ; } while ( top < chars . length && chars [ top ] == separator ) { ++ top ; } if ( top < chars . length ) { chars [ base... |
public class DiSHPreferenceVectorIndex { /** * Determines the preference vector with the apriori strategy .
* @ param relation the database storing the objects
* @ param neighborIDs the list of ids of the neighbors in each dimension
* @ param msg a string buffer for debug messages
* @ return the preference vect... | int dimensionality = neighborIDs . length ; // database for apriori
UpdatableDatabase apriori_db = new HashmapDatabase ( ) ; SimpleTypeInformation < ? > bitmeta = VectorFieldTypeInformation . typeRequest ( BitVector . class , dimensionality , dimensionality ) ; for ( DBIDIter it = relation . iterDBIDs ( ) ; it . valid ... |
public class ConfigurationImpl { /** * { @ inheritDoc } */
public boolean validOptions ( String options [ ] [ ] , DocErrorReporter reporter ) { } } | boolean helpfile = false ; boolean nohelp = false ; boolean overview = false ; boolean nooverview = false ; boolean splitindex = false ; boolean noindex = false ; boolean hasSystemName = false ; boolean hasBranchName = false ; // check shared options
if ( ! generalValidOptions ( options , reporter ) ) { return false ; ... |
public class PropertiesUtil { /** * Returns a filtered version of the specified properties that first looks for a property
* starting with the given prefix , then looks for a property without the prefix . For example ,
* passing the prefix " alt " and using the following properties :
* < pre >
* alt . texture =... | final String dprefix = prefix + "." ; return new Properties ( ) { @ Override public String getProperty ( String key ) { return getProperty ( key , null ) ; } @ Override public String getProperty ( String key , String defaultValue ) { return source . getProperty ( dprefix + key , source . getProperty ( key , defaultValu... |
public class CompletionStageFactory { /** * Returns a new CompletionStage that is asynchronously completed
* by a task running in the given executor with the value obtained
* by calling the given Supplier . Subsequent completion stages will
* use defaultAsyncExecutor as their default executor .
* @ param suppli... | Objects . requireNonNull ( supplier , "supplier must not be null" ) ; return completedStage ( null ) . thenApplyAsync ( ( ignored ) -> supplier . get ( ) , executor ) ; |
public class OpusFile { /** * In Reading mode , will close the underlying ogg
* file and free its resources .
* In Writing mode , will write out the Info and
* Tags objects , and then the audio data . */
public void close ( ) throws IOException { } } | if ( r != null ) { r = null ; ogg . close ( ) ; ogg = null ; } if ( w != null ) { w . bufferPacket ( info . write ( ) , true ) ; w . bufferPacket ( tags . write ( ) , false ) ; // The Granule Position on each Ogg Page needs to be
// the total number of PCM samples , including the last
// full Opus Packet in the page .
... |
public class BezierCurve { /** * Create second derivative function for fixed control points .
* @ param controlPoints
* @ return */
private ParameterizedOperator secondDerivative ( double ... controlPoints ) { } } | if ( controlPoints . length != 2 * length ) { throw new IllegalArgumentException ( "control-points length not " + length ) ; } return secondDerivative ( controlPoints , 0 ) ; |
public class NetworkConfig { /** * Returns a new NetworkConfig instance and populates it from the specified JSON object
* @ param jsonConfig The JSON object containing the config details
* @ return A populated NetworkConfig instance
* @ throws InvalidArgumentException */
private static NetworkConfig load ( JsonOb... | // Sanity check
if ( jsonConfig == null ) { throw new InvalidArgumentException ( "config must be specified" ) ; } return new NetworkConfig ( jsonConfig ) ; |
public class XParserRegistry { /** * / * ( non - Javadoc )
* @ see org . deckfour . xes . util . XRegistry # areEqual ( java . lang . Object , java . lang . Object ) */
@ Override protected boolean areEqual ( XParser a , XParser b ) { } } | return a . getClass ( ) . equals ( b . getClass ( ) ) ; |
public class CodedOutputStream { /** * Write a { @ code uint64 } field , including tag , to the stream . */
public void writeUInt64 ( final int fieldNumber , final long value ) throws IOException { } } | writeTag ( fieldNumber , WireFormat . WIRETYPE_VARINT ) ; writeUInt64NoTag ( value ) ; |
public class AbstractHttp2ConnectionHandlerBuilder { /** * Create a new { @ link Http2ConnectionHandler } . */
protected T build ( ) { } } | if ( encoder != null ) { assert decoder != null ; return buildFromCodec ( decoder , encoder ) ; } Http2Connection connection = this . connection ; if ( connection == null ) { connection = new DefaultHttp2Connection ( isServer ( ) , maxReservedStreams ( ) ) ; } return buildFromConnection ( connection ) ; |
public class BaseSessionHolder { /** * If this is a session , convert to a proxy session and return , if object , convert and return .
* @ param out The return output stream .
* @ param strReturn The string to return . */
public void setReturnSessionOrObject ( PrintWriter out , Object objReturn ) { } } | String strID = null ; String strSessionClass = null ; if ( objReturn instanceof RemoteTable ) { strSessionClass = REMOTE_TABLE ; strID = this . add ( new TableHolder ( this , ( RemoteTable ) objReturn ) ) ; } else if ( objReturn instanceof RemoteSession ) { strSessionClass = REMOTE_SESSION ; strID = this . add ( new Se... |
public class RemovePreferenceHeaderDialogBuilder { /** * Creates and returns a listener , which allows to notify the registered listener , when the user
* closes the dialog confirmatively .
* @ return The listener , which has been created , as an instance of the type { @ link
* OnClickListener } */
private OnClic... | return new OnClickListener ( ) { @ Override public void onClick ( final DialogInterface dialog , final int which ) { int position = spinner . getSelectedItemPosition ( ) ; listener . onRemovePreferenceHeader ( position ) ; } } ; |
public class DescribeAssessmentTemplatesResult { /** * Information about the assessment templates .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setAssessmentTemplates ( java . util . Collection ) } or { @ link # withAssessmentTemplates ( java . util . Col... | if ( this . assessmentTemplates == null ) { setAssessmentTemplates ( new java . util . ArrayList < AssessmentTemplate > ( assessmentTemplates . length ) ) ; } for ( AssessmentTemplate ele : assessmentTemplates ) { this . assessmentTemplates . add ( ele ) ; } return this ; |
public class CPAttachmentFileEntryPersistenceImpl { /** * Returns a range of all the cp attachment file entries where classNameId = & # 63 ; and classPK = & # 63 ; and displayDate & lt ; & # 63 ; and status = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances ... | return findByC_C_LtD_S ( classNameId , classPK , displayDate , status , start , end , null ) ; |
public class Broker { /** * create a broker with given broker info
* @ param id broker id
* @ param brokerInfoString broker info format : < b > creatorId : host : port : autocreated < / b >
* @ return broker instance with connection config
* @ see # getZKString ( ) */
public static Broker createBroker ( int id ... | String [ ] brokerInfo = brokerInfoString . split ( ":" ) ; String creator = brokerInfo [ 0 ] . replace ( '#' , ':' ) ; String hostname = brokerInfo [ 1 ] . replace ( '#' , ':' ) ; String port = brokerInfo [ 2 ] ; boolean autocreated = Boolean . valueOf ( brokerInfo . length > 3 ? brokerInfo [ 3 ] : "true" ) ; return ne... |
public class Validator { /** * Validate an injection point
* @ param ij the injection point to validate
* @ param beanManager the bean manager */
public void validateInjectionPoint ( InjectionPoint ij , BeanManagerImpl beanManager ) { } } | validateInjectionPointForDefinitionErrors ( ij , ij . getBean ( ) , beanManager ) ; validateMetadataInjectionPoint ( ij , ij . getBean ( ) , ValidatorLogger . INJECTION_INTO_NON_BEAN ) ; validateEventMetadataInjectionPoint ( ij ) ; validateInjectionPointForDeploymentProblems ( ij , ij . getBean ( ) , beanManager ) ; |
public class A_CmsSerialDateValue { /** * Set the week of the month the events should occur .
* @ param weekOfMonth the week of month to set ( first to fifth , where fifth means last ) . */
public final void setWeekOfMonth ( WeekOfMonth weekOfMonth ) { } } | SortedSet < WeekOfMonth > woms = new TreeSet < > ( ) ; if ( null != weekOfMonth ) { woms . add ( weekOfMonth ) ; } setWeeksOfMonth ( woms ) ; |
public class ExecutorTemplate { /** * 调整一下线程池 */
public void adjustPoolSize ( int newPoolSize ) { } } | if ( newPoolSize != poolSize ) { poolSize = newPoolSize ; if ( executor instanceof ThreadPoolExecutor ) { ThreadPoolExecutor pool = ( ThreadPoolExecutor ) executor ; pool . setCorePoolSize ( newPoolSize ) ; pool . setMaximumPoolSize ( newPoolSize ) ; } } |
public class ThreadedServer { /** * Set the server InetAddress and port .
* @ param address The Address to listen on , or 0.0.0.0 : port for all interfaces . */
public synchronized void setInetAddrPort ( InetAddrPort address ) { } } | if ( _address != null && _address . equals ( address ) ) return ; if ( isStarted ( ) ) log . warn ( this + " is started" ) ; _address = address ; |
public class PropertyKey { /** * / * package */
Object extractValue ( Annotation annot ) { } } | try { return getMethod ( ) . invoke ( annot , new Object [ ] { } ) ; } // TODO - - cleanup exception handling , property defining a PropertyException
catch ( RuntimeException re ) { throw re ; } catch ( Exception e ) { throw new RuntimeException ( "Unable to extract value for " + _propertyName , e ) ; } |
public class BuilderMolecule { /** * method to build a molecule from a Peptide or RNA component
* @ param id name of the molecule
* @ param validMonomers all valid monomers of the component
* @ return generated molecule
* @ throws BuilderMoleculeException if the molecule can ' t be built
* @ throws ChemistryE... | try { String input = null ; AbstractMolecule currentMolecule = null ; input = getInput ( validMonomers . get ( 0 ) ) ; AbstractMolecule prevMolecule = Chemistry . getInstance ( ) . getManipulator ( ) . getMolecule ( input , generateAttachmentList ( validMonomers . get ( 0 ) . getAttachmentList ( ) ) ) ; AbstractMolecul... |
public class FxFlowableTransformers { /** * Performs an action on onComplete with the provided emission count
* @ param onComplete
* @ param < T > */
public static < T > FlowableTransformer < T , T > doOnCompleteCount ( Consumer < Integer > onComplete ) { } } | return obs -> obs . lift ( new FlowableEmissionCounter < > ( new CountObserver ( null , onComplete , null ) ) ) ; |
public class OffsetTime { /** * Obtains an instance of { @ code OffsetTime } from an { @ code Instant } and zone ID .
* This creates an offset time with the same instant as that specified .
* Finding the offset from UTC / Greenwich is simple as there is only one valid
* offset for each instant .
* The date comp... | Objects . requireNonNull ( instant , "instant" ) ; Objects . requireNonNull ( zone , "zone" ) ; ZoneRules rules = zone . getRules ( ) ; ZoneOffset offset = rules . getOffset ( instant ) ; long localSecond = instant . getEpochSecond ( ) + offset . getTotalSeconds ( ) ; // overflow caught later
int secsOfDay = ( int ) Ma... |
public class DeploymentInfoHandler { /** * / * ( non - Javadoc )
* @ see org . jboss . as . cli . OperationCommand # buildRequest ( org . jboss . as . cli . CommandContext ) */
@ Override public ModelNode buildRequestWithoutHeaders ( CommandContext ctx ) throws CommandFormatException { } } | final ParsedCommandLine parsedCmd = ctx . getParsedCommandLine ( ) ; ic . deploymentName = null ; ic . serverGroup = null ; String deploymentName = name . getValue ( parsedCmd ) ; if ( name != null ) { ic . deploymentName = deploymentName ; } ic . serverGroup = serverGroup . getValue ( parsedCmd ) ; return ic . buildRe... |
public class ImgCompressUtils { /** * 根据指定宽高和压缩质量进行压缩 , 当isForceWh为false时 , 如果指定宽或者高大于源图片则按照源图片大小宽高压缩 ,
* 当isForceWh为true时 , 不论怎样均按照指定宽高压缩
* @ param srcImg 指定原图片对象
* @ param width 指定压缩宽
* @ param height 指定压缩高
* @ param quality 指定压缩质量 , 范围 [ 0.0,1.0 ] , 如果指定为null则按照默认值
* @ param isForceWh 指定是否强制使用指定宽高进行压缩 , ... | if ( ! isForceWh && ( srcImg . getHeight ( null ) < height || srcImg . getWidth ( null ) < width ) ) { width = srcImg . getWidth ( null ) ; height = srcImg . getHeight ( null ) ; } // 指定目标图片
BufferedImage desImg = new BufferedImage ( width , height , BufferedImage . TYPE_INT_RGB ) ; // 根据源图片绘制目标图片
desImg . getGraphics ... |
public class HdfsStreamWriter { /** * ファイルに対してテキストを追記し 、 改行する 。
* @ param outputLine 出力行
* @ throws IOException 追記失敗時 */
public void appendLine ( String outputLine ) throws IOException { } } | this . delegateStream . writeChars ( outputLine ) ; this . delegateStream . writeChars ( System . getProperty ( "line.separator" ) ) ; if ( this . isFileSyncEachTime ) { sync ( ) ; } |
public class MatchingStrategy { /** * Exact match is best ,
* then path match with longest URI matched ,
* finally extension match . */
protected CollectionMatch selectBestCollectionMatch ( CollectionMatch previousMatch , CollectionMatch currentMatch ) { } } | CollectionMatch bestMatch = null ; if ( previousMatch == null ) { bestMatch = currentMatch ; } else if ( previousMatch . isDenyMatchByOmission ( ) ) { bestMatch = previousMatch ; } else if ( currentMatch . isDenyMatchByOmission ( ) ) { bestMatch = currentMatch ; } else if ( previousMatch . isDenyMatch ( ) ) { bestMatch... |
public class InstanceClient { /** * Gets the access control policy for a resource . May be empty if no such policy or resource
* exists .
* < p > Sample code :
* < pre > < code >
* try ( InstanceClient instanceClient = InstanceClient . create ( ) ) {
* ProjectZoneInstanceResourceName resource = ProjectZoneIns... | GetIamPolicyInstanceHttpRequest request = GetIamPolicyInstanceHttpRequest . newBuilder ( ) . setResource ( resource ) . build ( ) ; return getIamPolicyInstance ( request ) ; |
public class hqlLexer { /** * $ ANTLR start " ESCAPE " */
public final void mESCAPE ( ) throws RecognitionException { } } | try { int _type = ESCAPE ; int _channel = DEFAULT_TOKEN_CHANNEL ; // hql . g : 25:8 : ( ' escape ' )
// hql . g : 25:10 : ' escape '
{ match ( "escape" ) ; if ( state . failed ) return ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving
} |
public class HystrixSampleSseServlet { /** * Handle incoming GETs */
@ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { } } | if ( isDestroyed ) { response . sendError ( 503 , "Service has been shut down." ) ; } else { handleRequest ( request , response ) ; } |
public class ServerStatisticsServlet { /** * < pre >
* fill the result set with the CPU usage .
* Note : As the ' Top ' bash call doesn ' t yield accurate result for the system load ,
* the implementation has been changed to load from the " proc / loadavg " which keeps
* the moving average of the system load , ... | if ( exists_Bash && exists_Cat && exists_LoadAvg ) { try { final ArrayList < String > output = Utils . runProcess ( "/bin/bash" , "-c" , "/bin/cat /proc/loadavg" ) ; // process the output from bash call .
if ( output . size ( ) > 0 ) { final String [ ] splitedresult = output . get ( 0 ) . split ( "\\s+" ) ; double cpuU... |
public class ValueEnforcer { /** * Check that the passed value is not < code > null < / code > and not equal to the
* provided value .
* @ param < T >
* Type to be checked and returned
* @ param aValue
* The value to check . May not be < code > null < / code > .
* @ param aName
* The name of the value ( e... | notNull ( aValue , aName ) ; notNull ( aUnexpectedValue , "UnexpectedValue" ) ; if ( isEnabled ( ) ) if ( aValue . equals ( aUnexpectedValue ) ) throw new IllegalArgumentException ( "The value of '" + aName . get ( ) + "' may not be equal to " + aUnexpectedValue + "!" ) ; return aValue ; |
public class ExpandableRecyclerAdapter { /** * Notify any registered observers that the parent at { @ code parentPosition } has
* { @ code itemCount } children starting at { @ code childPositionStart } that have changed .
* This is an item change event , not a structural change event . It indicates that any
* The... | P parent = mParentList . get ( parentPosition ) ; int flatParentPosition = getFlatParentPosition ( parentPosition ) ; ExpandableWrapper < P , C > parentWrapper = mFlatItemList . get ( flatParentPosition ) ; parentWrapper . setParent ( parent ) ; if ( parentWrapper . isExpanded ( ) ) { int flatChildPosition = flatParent... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.