signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class HttpResponse { /** * 将CompletableFuture的结果对象以JSON格式输出
* @ param convert 指定的JsonConvert
* @ param future 输出对象的句柄 */
@ SuppressWarnings ( "unchecked" ) public void finishJson ( final JsonConvert convert , final CompletableFuture future ) { } } | finish ( convert , ( Type ) null , future ) ; |
public class BankeraAdapters { /** * Adapts Bankera BankeraTickerResponse to a Ticker
* @ param ticker Specific ticker
* @ param currencyPair BankeraCurrency pair ( e . g . ETH / BTC )
* @ return Ticker */
public static Ticker adaptTicker ( BankeraTickerResponse ticker , CurrencyPair currencyPair ) { } } | BigDecimal high = new BigDecimal ( ticker . getTicker ( ) . getHigh ( ) ) ; BigDecimal low = new BigDecimal ( ticker . getTicker ( ) . getLow ( ) ) ; BigDecimal bid = new BigDecimal ( ticker . getTicker ( ) . getBid ( ) ) ; BigDecimal ask = new BigDecimal ( ticker . getTicker ( ) . getAsk ( ) ) ; BigDecimal last = new BigDecimal ( ticker . getTicker ( ) . getLast ( ) ) ; BigDecimal volume = new BigDecimal ( ticker . getTicker ( ) . getVolume ( ) ) ; Date timestamp = new Date ( ticker . getTicker ( ) . getTimestamp ( ) ) ; return new Ticker . Builder ( ) . currencyPair ( currencyPair ) . high ( high ) . low ( low ) . bid ( bid ) . ask ( ask ) . last ( last ) . volume ( volume ) . timestamp ( timestamp ) . build ( ) ; |
public class ZkServiceRegistry { /** * 启动服务注册 , 只有启动了服务注册 , 才可以调用 { @ link # registerService ( String , NodeStatus ) } */
public static void start ( ) { } } | synchronized ( lock ) { if ( registry != null ) return ; try { LOG . info ( "开始启动zk服务注册入口" ) ; registry = new ZkServiceRegistry ( ) ; FastJsonServiceInstanceSerializer < NodeStatus > serializer = new FastJsonServiceInstanceSerializer < > ( ) ; registry . serviceDiscovery = ServiceDiscoveryBuilder . builder ( NodeStatus . class ) . client ( ZkConnection . client ) . basePath ( ZkPathManager . getNodeBasePath ( ) ) . serializer ( serializer ) . build ( ) ; registry . serviceDiscovery . start ( ) ; LOG . info ( "zk服务注册入口启动完毕" ) ; registerService ( EnvUtil . getApplication ( ) , LocalNodeManager . singleton . getFullStatus ( ) ) ; } catch ( Exception e ) { throw new RuntimeException ( "启动zkServiceRegistry失败" , e ) ; } } |
public class RemoveTargetsResult { /** * The failed target entries .
* @ param failedEntries
* The failed target entries . */
public void setFailedEntries ( java . util . Collection < RemoveTargetsResultEntry > failedEntries ) { } } | if ( failedEntries == null ) { this . failedEntries = null ; return ; } this . failedEntries = new java . util . ArrayList < RemoveTargetsResultEntry > ( failedEntries ) ; |
public class Seb { /** * Triggers { @ link OnReportEvent } with given context and label .
* @ param context
* The report context
* @ param label
* The report label */
public void report ( SebContext context , String label ) { } } | triggerEvent ( constructEvent ( OnReportEvent . class , context ) . with ( label ) ) ; |
public class MongoFactory { /** * 获取MongoDB数据源 < br >
* @ param setting 设定文件
* @ param groups 分组列表
* @ return MongoDB连接 */
public static MongoDS getDS ( Setting setting , String ... groups ) { } } | final String key = setting . getSettingPath ( ) + GROUP_SEPRATER + ArrayUtil . join ( groups , GROUP_SEPRATER ) ; MongoDS ds = dsMap . get ( key ) ; if ( null == ds ) { // 没有在池中加入之
ds = new MongoDS ( setting , groups ) ; dsMap . put ( key , ds ) ; } return ds ; |
public class Vertigo { /** * Deploys a bare network to an anonymous local - only cluster . < p >
* The network will be deployed with no components and no connections . You
* can add components and connections to the network with an { @ link ActiveNetwork }
* instance .
* @ param name The name of the network to deploy .
* @ return The Vertigo instance . */
public Vertigo deployNetwork ( String name ) { } } | return deployNetwork ( name , ( Handler < AsyncResult < ActiveNetwork > > ) null ) ; |
public class JenkinsServer { /** * Create a job on the server using the provided xml
* @ param jobName name of the job to be created .
* @ param jobXml the < code > config . xml < / code > which should be used to create
* the job .
* @ throws IOException in case of an error . */
public JenkinsServer createJob ( String jobName , String jobXml ) throws IOException { } } | return createJob ( null , jobName , jobXml , false ) ; |
public class WordNet { /** * 获取某一行的第一个节点
* @ param line
* @ return */
public Vertex getFirst ( int line ) { } } | Iterator < Vertex > iterator = vertexes [ line ] . iterator ( ) ; if ( iterator . hasNext ( ) ) return iterator . next ( ) ; return null ; |
public class SyncGroupsInner { /** * Gets a sync group .
* @ 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 databaseName The name of the database on which the sync group is hosted .
* @ param syncGroupName The name of the sync group .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < SyncGroupInner > getAsync ( String resourceGroupName , String serverName , String databaseName , String syncGroupName , final ServiceCallback < SyncGroupInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , syncGroupName ) , serviceCallback ) ; |
public class LibertyServiceImpl { /** * Gets an array of features possibly enabled on client ' s
* port - component - ref in the deployment descriptor */
private WebServiceFeature [ ] getWebServiceFeaturesOnPortComponentRef ( Class serviceEndpointInterface ) { } } | WebServiceFeature [ ] returnArray = { } ; if ( serviceEndpointInterface != null && wsrInfo != null ) { String seiName = serviceEndpointInterface . getName ( ) ; PortComponentRefInfo pcr = wsrInfo . getPortComponentRefInfo ( seiName ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "SEI name = " + seiName ) ; Tr . debug ( tc , "PortComponentRefInfo found = " + pcr ) ; } if ( pcr != null ) { List < WebServiceFeatureInfo > featureInfoList = pcr . getWebServiceFeatureInfos ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "List of WebServiceFeatureInfo from PortComponentRefInfo = " + featureInfoList ) ; } if ( ! featureInfoList . isEmpty ( ) ) { returnArray = new WebServiceFeature [ featureInfoList . size ( ) ] ; for ( int i = 0 ; i < featureInfoList . size ( ) ; i ++ ) { WebServiceFeatureInfo featureInfo = featureInfoList . get ( i ) ; WebServiceFeature wsf = featureInfo . getWebServiceFeature ( ) ; returnArray [ i ] = wsf ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Added WebServiceFeature " + wsf ) ; } } } } } return returnArray ; |
public class Mapper { /** * < p > Converts a java object to a mongo - compatible object ( possibly a DBObject for complex mappings ) . Very similar to { @ link
* Mapper # toDBObject } < / p > < p > Used ( mainly ) by query / update operations < / p > */
Object toMongoObject ( final Object javaObj , final boolean includeClassName ) { } } | if ( javaObj == null ) { return null ; } Class origClass = javaObj . getClass ( ) ; if ( origClass . isAnonymousClass ( ) && origClass . getSuperclass ( ) . isEnum ( ) ) { origClass = origClass . getSuperclass ( ) ; } final Object newObj = getConverters ( ) . encode ( origClass , javaObj ) ; if ( newObj == null ) { LOG . warn ( "converted " + javaObj + " to null" ) ; return null ; } final Class type = newObj . getClass ( ) ; final boolean bSameType = origClass . equals ( type ) ; // TODO : think about this logic a bit more .
// Even if the converter changed it , should it still be processed ?
if ( ! bSameType && ! ( Map . class . isAssignableFrom ( type ) || Iterable . class . isAssignableFrom ( type ) ) ) { return newObj ; } else { // The converter ran , and produced another type , or it is a list / map
boolean isSingleValue = true ; boolean isMap = false ; Class subType = null ; if ( type . isArray ( ) || Map . class . isAssignableFrom ( type ) || Iterable . class . isAssignableFrom ( type ) ) { isSingleValue = false ; isMap = implementsInterface ( type , Map . class ) ; // subtype of Long [ ] , List < Long > is Long
subType = ( type . isArray ( ) ) ? type . getComponentType ( ) : getParameterizedClass ( type , ( isMap ) ? 1 : 0 ) ; } if ( isSingleValue && ! isPropertyType ( type ) ) { final DBObject dbObj = toDBObject ( newObj ) ; if ( ! includeClassName ) { dbObj . removeField ( opts . getDiscriminatorField ( ) ) ; } return dbObj ; } else if ( newObj instanceof DBObject ) { return newObj ; } else if ( isMap ) { if ( isPropertyType ( subType ) ) { return toDBObject ( newObj ) ; } else { final LinkedHashMap m = new LinkedHashMap ( ) ; for ( final Map . Entry e : ( Iterable < Map . Entry > ) ( ( Map ) newObj ) . entrySet ( ) ) { m . put ( e . getKey ( ) , toMongoObject ( e . getValue ( ) , includeClassName ) ) ; } return m ; } // Set / List but needs elements converted
} else if ( ! isSingleValue && ! isPropertyType ( subType ) ) { final List < Object > values = new BasicDBList ( ) ; if ( type . isArray ( ) ) { for ( final Object obj : ( Object [ ] ) newObj ) { values . add ( toMongoObject ( obj , includeClassName ) ) ; } } else { for ( final Object obj : ( Iterable ) newObj ) { values . add ( toMongoObject ( obj , includeClassName ) ) ; } } return values ; } else { return newObj ; } } |
public class SurfaceForm { /** * getter for semtype - gets
* @ generated
* @ return value of the feature */
public String getSemtype ( ) { } } | if ( SurfaceForm_Type . featOkTst && ( ( SurfaceForm_Type ) jcasType ) . casFeat_semtype == null ) jcasType . jcas . throwFeatMissing ( "semtype" , "ch.epfl.bbp.uima.types.SurfaceForm" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( SurfaceForm_Type ) jcasType ) . casFeatCode_semtype ) ; |
public class TableExtractor { /** * TODO : NOT finished yet Converts HTML code back to the real characters ;
* @ param wordsByPage
* the extracted texts in the word level in a document */
private void convertHTMLCode ( ArrayList < ArrayList < TextPiece > > wordsByPage ) { } } | DocInfo docInfo = new DocInfo ( ) ; String [ ] html2Char = docInfo . getHtml2CharMapping ( ) ; // Only define this
// mapping string
// when we detect
// the files in HTML
// codes
int pageNum = 0 ; for ( ArrayList < TextPiece > wordsOfAPage : wordsByPage ) { pageNum ++ ; for ( int i = 0 ; i < wordsOfAPage . size ( ) ; i ++ ) { TextPiece currentWord = wordsOfAPage . get ( i ) ; String realText = "" ; String textinHTMLCode = currentWord . getText ( ) ; } } |
public class AbstractItemLink { /** * remove the item if it matches and is available
* @ param filter
* @ param transaction
* @ return item if locked
* @ throws ProtocolException Thrown if an add is attempted when the
* transaction cannot allow any further work to be added i . e . after
* completion of the transaction .
* @ throws TransactionException Thrown if an unexpected error occurs .
* @ throws SevereMessageStoreException */
public final AbstractItem removeIfMatches ( final Filter filter , PersistentTransaction transaction ) throws ProtocolException , TransactionException , SevereMessageStoreException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeIfMatches" , new Object [ ] { filter , transaction } ) ; AbstractItem foundItem = cmdRemoveIfMatches ( filter , transaction ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeIfMatches" , foundItem ) ; return foundItem ; |
public class XmlChangeSetReader { /** * Read a < code > RuleSet < / code > from an < code > InputStream < / code > .
* @ param inputStream
* The input - stream containing the rule - set .
* @ return The rule - set . */
public ChangeSet read ( final InputStream inputStream ) throws SAXException , IOException { } } | return ( ChangeSet ) this . parser . read ( inputStream ) ; |
public class Strman { /** * Ensures that the value begins with prefix . If it doesn ' t exist , it ' s prepended . It is case sensitive .
* @ param value input
* @ param prefix prefix
* @ return string with prefix if it was not present . */
public static String ensureLeft ( final String value , final String prefix ) { } } | return ensureLeft ( value , prefix , true ) ; |
public class ProductionErrorHandler { /** * { @ inheritDoc } */
@ Override public void error ( ErrorMessage errorMessage , Token token , Map < String , Object > parameters ) throws ParseException { } } | if ( errorMessage . isSevere ( ) ) { Message message = new ResourceBundleMessage ( errorMessage . key ) . withModel ( parameters ) . onToken ( token ) ; logger . severe ( message . format ( locale ) ) ; } |
public class DRL5Expressions { /** * src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 100:1 : operator returns [ boolean negated , String opr ] : ( x = TILDE ) ? ( op = EQUALS | op = NOT _ EQUALS | rop = relationalOp ) ; */
public final DRL5Expressions . operator_return operator ( ) throws RecognitionException { } } | DRL5Expressions . operator_return retval = new DRL5Expressions . operator_return ( ) ; retval . start = input . LT ( 1 ) ; Token x = null ; Token op = null ; ParserRuleReturnScope rop = null ; if ( isNotEOF ( ) ) helper . emit ( Location . LOCATION_LHS_INSIDE_CONDITION_OPERATOR ) ; helper . setHasOperator ( true ) ; try { // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 103:3 : ( ( x = TILDE ) ? ( op = EQUALS | op = NOT _ EQUALS | rop = relationalOp ) )
// src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 103:5 : ( x = TILDE ) ? ( op = EQUALS | op = NOT _ EQUALS | rop = relationalOp )
{ // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 103:6 : ( x = TILDE ) ?
int alt2 = 2 ; int LA2_0 = input . LA ( 1 ) ; if ( ( LA2_0 == TILDE ) ) { int LA2_1 = input . LA ( 2 ) ; if ( ( LA2_1 == EQUALS || ( LA2_1 >= GREATER && LA2_1 <= GREATER_EQUALS ) || LA2_1 == ID || ( LA2_1 >= LESS && LA2_1 <= LESS_EQUALS ) || LA2_1 == NOT_EQUALS || LA2_1 == TILDE ) ) { alt2 = 1 ; } } switch ( alt2 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 103:6 : x = TILDE
{ x = ( Token ) match ( input , TILDE , FOLLOW_TILDE_in_operator256 ) ; if ( state . failed ) return retval ; } break ; } // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 104:5 : ( op = EQUALS | op = NOT _ EQUALS | rop = relationalOp )
int alt3 = 3 ; int LA3_0 = input . LA ( 1 ) ; if ( ( LA3_0 == EQUALS ) ) { alt3 = 1 ; } else if ( ( LA3_0 == NOT_EQUALS ) ) { alt3 = 2 ; } else if ( ( ( LA3_0 >= GREATER && LA3_0 <= GREATER_EQUALS ) || ( LA3_0 >= LESS && LA3_0 <= LESS_EQUALS ) || LA3_0 == TILDE ) ) { alt3 = 3 ; } else if ( ( LA3_0 == ID ) && ( ( ( ( helper . validateIdentifierKey ( DroolsSoftKeywords . NOT ) ) ) || ( ( helper . isPluggableEvaluator ( false ) ) ) ) ) ) { alt3 = 3 ; } switch ( alt3 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 104:7 : op = EQUALS
{ op = ( Token ) match ( input , EQUALS , FOLLOW_EQUALS_in_operator267 ) ; if ( state . failed ) return retval ; if ( state . backtracking == 0 ) { retval . negated = false ; retval . opr = ( x != null ? ( x != null ? x . getText ( ) : null ) : "" ) + ( op != null ? op . getText ( ) : null ) ; helper . emit ( op , DroolsEditorType . SYMBOL ) ; } } break ; case 2 : // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 105:7 : op = NOT _ EQUALS
{ op = ( Token ) match ( input , NOT_EQUALS , FOLLOW_NOT_EQUALS_in_operator286 ) ; if ( state . failed ) return retval ; if ( state . backtracking == 0 ) { retval . negated = false ; retval . opr = ( x != null ? ( x != null ? x . getText ( ) : null ) : "" ) + ( op != null ? op . getText ( ) : null ) ; helper . emit ( op , DroolsEditorType . SYMBOL ) ; } } break ; case 3 : // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 106:7 : rop = relationalOp
{ pushFollow ( FOLLOW_relationalOp_in_operator301 ) ; rop = relationalOp ( ) ; state . _fsp -- ; if ( state . failed ) return retval ; if ( state . backtracking == 0 ) { retval . negated = ( rop != null ? ( ( DRL5Expressions . relationalOp_return ) rop ) . negated : false ) ; retval . opr = ( x != null ? ( x != null ? x . getText ( ) : null ) : "" ) + ( rop != null ? ( ( DRL5Expressions . relationalOp_return ) rop ) . opr : null ) ; } } break ; } } retval . stop = input . LT ( - 1 ) ; if ( state . backtracking == 0 ) { if ( state . backtracking == 0 && input . LA ( 1 ) != DRL5Lexer . EOF ) { helper . emit ( Location . LOCATION_LHS_INSIDE_CONDITION_ARGUMENT ) ; } } } catch ( RecognitionException re ) { throw re ; } finally { // do for sure before leaving
} return retval ; |
public class MolecularFormulaManipulator { /** * Method that actually does the work of convert the IMolecularFormula
* to IAtomContainer given a IAtomContainer .
* < p > The hydrogens must be implicit .
* @ param formula IMolecularFormula object
* @ param atomContainer IAtomContainer to put the new Elements
* @ return the filled AtomContainer
* @ see # getAtomContainer ( IMolecularFormula ) */
public static IAtomContainer getAtomContainer ( IMolecularFormula formula , IAtomContainer atomContainer ) { } } | for ( IIsotope isotope : formula . isotopes ( ) ) { int occur = formula . getIsotopeCount ( isotope ) ; for ( int i = 0 ; i < occur ; i ++ ) { IAtom atom = formula . getBuilder ( ) . newInstance ( IAtom . class , isotope ) ; atom . setImplicitHydrogenCount ( 0 ) ; atomContainer . addAtom ( atom ) ; } } return atomContainer ; |
public class TreeScanner { /** * Visitor methods */
public R visitCompilationUnit ( CompilationUnitTree node , P p ) { } } | R r = scan ( node . getPackageAnnotations ( ) , p ) ; r = scanAndReduce ( node . getPackageName ( ) , p , r ) ; r = scanAndReduce ( node . getImports ( ) , p , r ) ; r = scanAndReduce ( node . getTypeDecls ( ) , p , r ) ; return r ; |
public class LargestChainDescriptor { /** * Calculate the count of atoms of the largest chain in the supplied { @ link IAtomContainer } .
* @ param atomContainer The { @ link IAtomContainer } for which this descriptor is to be calculated
* @ return the number of atoms in the largest chain of this AtomContainer
* @ see # setParameters */
@ Override public DescriptorValue calculate ( IAtomContainer atomContainer ) { } } | if ( checkRingSystem ) Cycles . markRingAtomsAndBonds ( atomContainer ) ; // make a subset molecule only including acyclic non - hydrogen atoms
final Set < IAtom > included = new HashSet < > ( ) ; for ( IAtom atom : atomContainer . atoms ( ) ) { if ( ! atom . isInRing ( ) && atom . getAtomicNumber ( ) != 1 ) included . add ( atom ) ; } IAtomContainer subset = subsetMol ( atomContainer , included ) ; AllPairsShortestPaths apsp = new AllPairsShortestPaths ( subset ) ; int max = 0 ; int numAtoms = subset . getAtomCount ( ) ; for ( int i = 0 ; i < numAtoms ; i ++ ) { for ( int j = i + 1 ; j < numAtoms ; j ++ ) { int len = apsp . from ( i ) . pathTo ( j ) . length ; if ( len > max ) max = len ; } } return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , new IntegerResult ( max ) , getDescriptorNames ( ) ) ; |
public class Slf4jLogger { /** * This method is similar to { @ link # error ( String , Object ) } method except that the
* marker data is also taken into consideration .
* @ param marker the marker data specific to this log statement
* @ param format the format string
* @ param arg the argument */
public void error ( Marker marker , String format , Object arg ) { } } | if ( m_delegate . isErrorEnabled ( ) ) { FormattingTuple tuple = MessageFormatter . format ( format , arg ) ; setMDCMarker ( marker ) ; m_delegate . error ( tuple . getMessage ( ) , tuple . getThrowable ( ) ) ; resetMDCMarker ( ) ; } |
public class UploadServlet { /** * Get the temporary directory name . */
public String getDestDirectory ( ) { } } | String strTargetDirectory = this . getInitParameter ( DESTINATION ) ; // Passed with WAR file
if ( ( strTargetDirectory == null ) || ( strTargetDirectory . length ( ) == 0 ) ) strTargetDirectory = System . getProperty ( "java.io.tmpdir" ) ; // Temporary directory
if ( ( strTargetDirectory == null ) || ( strTargetDirectory . length ( ) == 0 ) ) strTargetDirectory = "." ; // Last choice - this directory
return strTargetDirectory ; |
public class PluginService { /** * Returns the plugin for the given plugin id .
* @ param pluginId The id for the plugin to return
* @ param detailed < CODE > true < / CODE > if the details of the plugin should be included
* @ return The plugin */
public Optional < Plugin > show ( long pluginId , boolean detailed ) { } } | QueryParameterList queryParams = new QueryParameterList ( ) ; queryParams . add ( "detailed" , Boolean . toString ( detailed ) ) ; return HTTP . GET ( String . format ( "/v2/plugins/%d.json" , pluginId ) , null , queryParams , PLUGIN ) ; |
public class RoaringArray { /** * Deserialize ( retrieve ) this bitmap . See format specification at
* https : / / github . com / RoaringBitmap / RoaringFormatSpec
* The current bitmap is overwritten .
* It is not necessary that limit ( ) on the input ByteBuffer indicates the end of the serialized
* data .
* After loading this RoaringBitmap , you can advance to the rest of the data ( if there
* is more ) by setting bbf . position ( bbf . position ( ) + bitmap . serializedSizeInBytes ( ) ) ;
* Note that the input ByteBuffer is effectively copied ( with the slice operation ) so you should
* expect the provided ByteBuffer position / mark / limit / order to remain unchanged .
* @ param bbf the byte buffer ( can be mapped , direct , array backed etc . */
public void deserialize ( ByteBuffer bbf ) { } } | this . clear ( ) ; // slice not to mutate the input ByteBuffer
ByteBuffer buffer = bbf . slice ( ) ; buffer . order ( LITTLE_ENDIAN ) ; final int cookie = buffer . getInt ( ) ; if ( ( cookie & 0xFFFF ) != SERIAL_COOKIE && cookie != SERIAL_COOKIE_NO_RUNCONTAINER ) { throw new RuntimeException ( "I failed to find one of the right cookies. " + cookie ) ; } boolean hasRunContainers = ( cookie & 0xFFFF ) == SERIAL_COOKIE ; this . size = hasRunContainers ? ( cookie >>> 16 ) + 1 : buffer . getInt ( ) ; // TODO For now , we consider the limit is already set by the caller
// int theLimit = size > 0 ? computeSerializedSizeInBytes ( ) : headerSize ( hasRunContainers ) ;
// buffer . limit ( theLimit ) ;
// logically we cannot have more than ( 1 < < 16 ) containers .
if ( this . size > ( 1 << 16 ) ) { throw new InvalidRoaringFormat ( "Size too large" ) ; } if ( ( this . keys == null ) || ( this . keys . length < this . size ) ) { this . keys = new short [ this . size ] ; this . values = new Container [ this . size ] ; } byte [ ] bitmapOfRunContainers = null ; boolean hasrun = ( cookie & 0xFFFF ) == SERIAL_COOKIE ; if ( hasrun ) { bitmapOfRunContainers = new byte [ ( size + 7 ) / 8 ] ; buffer . get ( bitmapOfRunContainers ) ; } final short keys [ ] = new short [ this . size ] ; final int cardinalities [ ] = new int [ this . size ] ; final boolean isBitmap [ ] = new boolean [ this . size ] ; for ( int k = 0 ; k < this . size ; ++ k ) { keys [ k ] = buffer . getShort ( ) ; cardinalities [ k ] = 1 + ( 0xFFFF & buffer . getShort ( ) ) ; isBitmap [ k ] = cardinalities [ k ] > ArrayContainer . DEFAULT_MAX_SIZE ; if ( bitmapOfRunContainers != null && ( bitmapOfRunContainers [ k / 8 ] & ( 1 << ( k % 8 ) ) ) != 0 ) { isBitmap [ k ] = false ; } } if ( ( ! hasrun ) || ( this . size >= NO_OFFSET_THRESHOLD ) ) { // skipping the offsets
buffer . position ( buffer . position ( ) + this . size * 4 ) ; } // Reading the containers
for ( int k = 0 ; k < this . size ; ++ k ) { Container val ; if ( isBitmap [ k ] ) { final long [ ] bitmapArray = new long [ BitmapContainer . MAX_CAPACITY / 64 ] ; buffer . asLongBuffer ( ) . get ( bitmapArray ) ; buffer . position ( buffer . position ( ) + bitmapArray . length * 8 ) ; val = new BitmapContainer ( bitmapArray , cardinalities [ k ] ) ; } else if ( bitmapOfRunContainers != null && ( ( bitmapOfRunContainers [ k / 8 ] & ( 1 << ( k % 8 ) ) ) != 0 ) ) { // cf RunContainer . writeArray ( )
int nbrruns = Util . toIntUnsigned ( buffer . getShort ( ) ) ; final short lengthsAndValues [ ] = new short [ 2 * nbrruns ] ; buffer . asShortBuffer ( ) . get ( lengthsAndValues ) ; buffer . position ( buffer . position ( ) + lengthsAndValues . length * 2 ) ; val = new RunContainer ( lengthsAndValues , nbrruns ) ; } else { final short [ ] shortArray = new short [ cardinalities [ k ] ] ; buffer . asShortBuffer ( ) . get ( shortArray ) ; buffer . position ( buffer . position ( ) + shortArray . length * 2 ) ; val = new ArrayContainer ( shortArray ) ; } this . keys [ k ] = keys [ k ] ; this . values [ k ] = val ; } |
public class FormLayout { /** * Returns the maximum dimensions for this layout given the components in the specified target
* container .
* @ param target the container which needs to be laid out
* @ see Container
* @ see # minimumLayoutSize ( Container )
* @ see # preferredLayoutSize ( Container )
* @ return the maximum dimensions for this layout */
@ Override public Dimension maximumLayoutSize ( Container target ) { } } | return new Dimension ( Integer . MAX_VALUE , Integer . MAX_VALUE ) ; |
public class HealthcareService { /** * syntactic sugar */
public StringType addProgramNameElement ( ) { } } | StringType t = new StringType ( ) ; if ( this . programName == null ) this . programName = new ArrayList < StringType > ( ) ; this . programName . add ( t ) ; return t ; |
public class VerifyingClassAdapter { /** * Returns the byte array that contains the byte code for this class .
* @ return a byte array . */
public byte [ ] toByteArray ( ) { } } | if ( state != State . PASS ) { logger . log ( Level . WARNING , "Failed to instrument class " + className + " because " + message ) ; return original ; } return cw . toByteArray ( ) ; |
public class Math { /** * Returns the column minimum for a matrix . */
public static double [ ] colMin ( double [ ] [ ] data ) { } } | double [ ] x = new double [ data [ 0 ] . length ] ; for ( int i = 0 ; i < x . length ; i ++ ) { x [ i ] = Double . POSITIVE_INFINITY ; } for ( int i = 0 ; i < data . length ; i ++ ) { for ( int j = 0 ; j < x . length ; j ++ ) { if ( x [ j ] > data [ i ] [ j ] ) { x [ j ] = data [ i ] [ j ] ; } } } return x ; |
public class CompressionUtils { /** * Use ZipOutputStream to zip text to byte array , then convert
* byte array to base64 string , so it can be transferred via http request .
* @ param srcTxt the src txt
* @ return the string in UTF - 8 format and base64 ' ed , or null . */
@ SneakyThrows public static String compress ( final String srcTxt ) { } } | try ( val rstBao = new ByteArrayOutputStream ( ) ; val zos = new GZIPOutputStream ( rstBao ) ) { zos . write ( srcTxt . getBytes ( StandardCharsets . UTF_8 ) ) ; zos . flush ( ) ; zos . finish ( ) ; val bytes = rstBao . toByteArray ( ) ; val base64 = StringUtils . remove ( EncodingUtils . encodeBase64 ( bytes ) , '\0' ) ; return new String ( StandardCharsets . UTF_8 . encode ( base64 ) . array ( ) , StandardCharsets . UTF_8 ) ; } |
public class BaseDatabase { /** * Get the starting ID for this table .
* Override this for different behavior .
* @ return The starting id */
public int getStartingID ( ) { } } | int iStartingID = 1 ; // ( default )
if ( this . getProperty ( STARTING_ID ) != null ) { try { iStartingID = Integer . parseInt ( this . getProperty ( STARTING_ID ) ) ; } catch ( NumberFormatException e ) { iStartingID = 1 ; } } return iStartingID ; |
public class ConfigBeanImpl { /** * null if we can ' t easily say ; this is heuristic / best - effort */
private static ConfigValueType getValueTypeOrNull ( Class < ? > parameterClass ) { } } | if ( parameterClass == Boolean . class || parameterClass == boolean . class ) { return ConfigValueType . BOOLEAN ; } else if ( parameterClass == Integer . class || parameterClass == int . class ) { return ConfigValueType . NUMBER ; } else if ( parameterClass == Double . class || parameterClass == double . class ) { return ConfigValueType . NUMBER ; } else if ( parameterClass == Long . class || parameterClass == long . class ) { return ConfigValueType . NUMBER ; } else if ( parameterClass == String . class ) { return ConfigValueType . STRING ; } else if ( parameterClass == Duration . class ) { return null ; } else if ( parameterClass == ConfigMemorySize . class ) { return null ; } else if ( parameterClass == List . class ) { return ConfigValueType . LIST ; } else if ( parameterClass == Map . class ) { return ConfigValueType . OBJECT ; } else if ( parameterClass == Config . class ) { return ConfigValueType . OBJECT ; } else if ( parameterClass == ConfigObject . class ) { return ConfigValueType . OBJECT ; } else if ( parameterClass == ConfigList . class ) { return ConfigValueType . LIST ; } else { return null ; } |
public class Exchanger { /** * Waits for another thread to arrive at this exchange point ( unless
* the current thread is { @ linkplain Thread # interrupt interrupted } ) ,
* and then transfers the given object to it , receiving its object
* in return .
* < p > If another thread is already waiting at the exchange point then
* it is resumed for thread scheduling purposes and receives the object
* passed in by the current thread . The current thread returns immediately ,
* receiving the object passed to the exchange by that other thread .
* < p > If no other thread is already waiting at the exchange then the
* current thread is disabled for thread scheduling purposes and lies
* dormant until one of two things happens :
* < ul >
* < li > Some other thread enters the exchange ; or
* < li > Some other thread { @ linkplain Thread # interrupt interrupts }
* the current thread .
* < / ul >
* < p > If the current thread :
* < ul >
* < li > has its interrupted status set on entry to this method ; or
* < li > is { @ linkplain Thread # interrupt interrupted } while waiting
* for the exchange ,
* < / ul >
* then { @ link InterruptedException } is thrown and the current thread ' s
* interrupted status is cleared .
* @ param x the object to exchange
* @ return the object provided by the other thread
* @ throws InterruptedException if the current thread was
* interrupted while waiting */
@ SuppressWarnings ( "unchecked" ) public V exchange ( V x ) throws InterruptedException { } } | Object v ; Object item = ( x == null ) ? NULL_ITEM : x ; // translate null args
if ( ( arena != null || ( v = slotExchange ( item , false , 0L ) ) == null ) && ( ( Thread . interrupted ( ) || // disambiguates null return
( v = arenaExchange ( item , false , 0L ) ) == null ) ) ) throw new InterruptedException ( ) ; return ( v == NULL_ITEM ) ? null : ( V ) v ; |
public class ShapePath { /** * Create an { @ link ArcShadowOperation } to fill in a shadow between the currently drawn shadow
* and the next shadow angle , if there would be a gap . */
private void addConnectingShadowIfNecessary ( float nextShadowAngle ) { } } | if ( currentShadowAngle == nextShadowAngle ) { // Previously drawn shadow lines up with the next shadow , so don ' t draw anything .
return ; } float shadowSweep = ( nextShadowAngle - currentShadowAngle + 360 ) % 360 ; if ( shadowSweep > 180 ) { // Shadows are actually overlapping , so don ' t draw anything .
return ; } PathArcOperation pathArcOperation = new PathArcOperation ( endX , endY , endX , endY ) ; pathArcOperation . startAngle = currentShadowAngle ; pathArcOperation . sweepAngle = shadowSweep ; shadowCompatOperations . add ( new ArcShadowOperation ( pathArcOperation ) ) ; currentShadowAngle = nextShadowAngle ; |
public class ListT { /** * / * ( non - Javadoc )
* @ see cyclops2 . monads . transformers . values . ListT # dropUntil ( java . util . function . Predicate ) */
@ Override public ListT < W , T > dropUntil ( final Predicate < ? super T > p ) { } } | return ( ListT < W , T > ) FoldableTransformerSeq . super . dropUntil ( p ) ; |
public class XTraceConverter { /** * ( non - Javadoc )
* @ see
* com . thoughtworks . xstream . converters . Converter # marshal ( java . lang . Object ,
* com . thoughtworks . xstream . io . HierarchicalStreamWriter ,
* com . thoughtworks . xstream . converters . MarshallingContext ) */
public void marshal ( Object obj , HierarchicalStreamWriter writer , MarshallingContext context ) { } } | XTrace trace = ( XTrace ) obj ; writer . startNode ( "XAttributeMap" ) ; context . convertAnother ( trace . getAttributes ( ) , XesXStreamPersistency . attributeMapConverter ) ; writer . endNode ( ) ; for ( XEvent event : trace ) { writer . startNode ( "XEvent" ) ; context . convertAnother ( event , XesXStreamPersistency . eventConverter ) ; writer . endNode ( ) ; } |
public class Cache { /** * EXPIREAT 的作用和 EXPIRE 类似 , 都用于为 key 设置生存时间 。 不同在于 EXPIREAT 命令接受的时间参数是 UNIX 时间戳 ( unix timestamp ) 。 */
public Long expireAt ( Object key , long unixTime ) { } } | Jedis jedis = getJedis ( ) ; try { return jedis . expireAt ( keyToBytes ( key ) , unixTime ) ; } finally { close ( jedis ) ; } |
public class TimeZone { /** * { @ inheritDoc } */
public int getOffset ( long date ) { } } | final Observance observance = vTimeZone . getApplicableObservance ( new DateTime ( date ) ) ; if ( observance != null ) { final TzOffsetTo offset = observance . getProperty ( Property . TZOFFSETTO ) ; if ( ( offset . getOffset ( ) . getTotalSeconds ( ) * 1000L ) < getRawOffset ( ) ) { return getRawOffset ( ) ; } else { return ( int ) ( offset . getOffset ( ) . getTotalSeconds ( ) * 1000L ) ; } } return 0 ; |
public class AWSDynamoUtils { /** * Returns a client instance for AWS DynamoDB .
* @ return a client that talks to DynamoDB */
public static AmazonDynamoDB getClient ( ) { } } | if ( ddbClient != null ) { return ddbClient ; } if ( Config . IN_PRODUCTION ) { ddbClient = AmazonDynamoDBClientBuilder . standard ( ) . build ( ) ; } else { ddbClient = AmazonDynamoDBClientBuilder . standard ( ) . withCredentials ( new AWSStaticCredentialsProvider ( new BasicAWSCredentials ( "local" , "null" ) ) ) . withEndpointConfiguration ( new EndpointConfiguration ( LOCAL_ENDPOINT , "" ) ) . build ( ) ; } if ( ! existsTable ( Config . getRootAppIdentifier ( ) ) ) { createTable ( Config . getRootAppIdentifier ( ) ) ; } ddb = new DynamoDB ( ddbClient ) ; Para . addDestroyListener ( new DestroyListener ( ) { public void onDestroy ( ) { shutdownClient ( ) ; } } ) ; return ddbClient ; |
public class Persistables { /** * Converts a { @ link ByteBuffer } into a { @ link Persistable } .
* @ param buffer The buffer
* @ return A Persistable wrapper for the buffer . */
public static Persistable persistable ( final ByteBuffer buffer ) { } } | return new Persistable ( ) { @ Override public int size ( ) { return buffer . limit ( ) ; } @ Override public void write ( ByteBuffer buffer1 ) { buffer1 . put ( buffer ) ; buffer1 . flip ( ) ; } @ Override public void read ( ByteBuffer buffer1 ) { buffer . rewind ( ) ; buffer . put ( buffer1 ) ; buffer . rewind ( ) ; } } ; |
public class Preconditions { /** * Checks that the given string is not blank and throws a customized
* { @ link NullPointerException } if it is { @ code null } , and a customized
* { @ link IllegalArgumentException } if it is empty or whitespace . Intended for doing parameter
* validation in methods and constructors , e . g . :
* < blockquote > < pre >
* public void foo ( String text ) {
* checkNotBlank ( text , " The text must not be null , empty or whitespace . " ) ;
* < / pre > < / blockquote >
* @ param str the string to check for being blank
* @ param message the detail message to be used in the event that an exception is thrown
* @ return { @ code str } if not { @ code null }
* @ throws NullPointerException if { @ code str } is { @ code null }
* @ throws IllegalArgumentException if { @ code str } is empty or whitespace */
public static String checkNotBlank ( String str , String message ) { } } | checkNotNull ( str , message ) ; checkArgument ( Strings . isNotBlank ( str ) , message ) ; return str ; |
public class InviteUsersRequest { /** * The user email addresses to which to send the invite .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setUserEmailList ( java . util . Collection ) } or { @ link # withUserEmailList ( java . util . Collection ) } if you want
* to override the existing values .
* @ param userEmailList
* The user email addresses to which to send the invite .
* @ return Returns a reference to this object so that method calls can be chained together . */
public InviteUsersRequest withUserEmailList ( String ... userEmailList ) { } } | if ( this . userEmailList == null ) { setUserEmailList ( new java . util . ArrayList < String > ( userEmailList . length ) ) ; } for ( String ele : userEmailList ) { this . userEmailList . add ( ele ) ; } return this ; |
public class CreateSnapshotScheduleResult { /** * @ return */
public java . util . List < java . util . Date > getNextInvocations ( ) { } } | if ( nextInvocations == null ) { nextInvocations = new com . amazonaws . internal . SdkInternalList < java . util . Date > ( ) ; } return nextInvocations ; |
public class TransactionCache { /** * Caches a concept so it does not have to be rebuilt later .
* @ param concept The concept to be cached . */
public void cacheConcept ( Concept concept ) { } } | conceptCache . put ( concept . id ( ) , concept ) ; if ( concept . isSchemaConcept ( ) ) { SchemaConcept schemaConcept = concept . asSchemaConcept ( ) ; schemaConceptCache . put ( schemaConcept . label ( ) , schemaConcept ) ; labelCache . put ( schemaConcept . label ( ) , schemaConcept . labelId ( ) ) ; } |
public class RobustLoaderWriterResilienceStrategy { /** * Get the value from the loader - writer .
* @ param key the key being retrieved
* @ param e the triggered failure
* @ return value as loaded from the loader - writer */
@ Override public V getFailure ( K key , StoreAccessException e ) { } } | try { return loaderWriter . load ( key ) ; } catch ( Exception e1 ) { throw ExceptionFactory . newCacheLoadingException ( e1 , e ) ; } finally { cleanup ( key , e ) ; } |
public class FeaturableConfig { /** * Export the featurable node from class data .
* @ param clazz The class name ( must not be < code > null < / code > ) .
* @ return The class node .
* @ throws LionEngineException If unable to export node . */
public static Xml exportClass ( String clazz ) { } } | Check . notNull ( clazz ) ; final Xml node = new Xml ( ATT_CLASS ) ; node . setText ( clazz ) ; return node ; |
public class GitController { /** * Launches the build synchronisation for a branch . */
@ RequestMapping ( value = "sync/{branchId}" , method = RequestMethod . POST ) public Ack launchBuildSync ( @ PathVariable ID branchId ) { } } | return Ack . validate ( gitService . launchBuildSync ( branchId , false ) != null ) ; |
public class AtomContainerSet { /** * Sort the AtomContainers and multipliers using a provided Comparator .
* @ param comparator defines the sorting method */
@ Override public void sortAtomContainers ( final Comparator < IAtomContainer > comparator ) { } } | // need to use boxed primitives as we can ' t customise sorting of int primitives
Integer [ ] indexes = new Integer [ atomContainerCount ] ; for ( int i = 0 ; i < indexes . length ; i ++ ) indexes [ i ] = i ; // proxy the index comparison to the atom container comparator
Arrays . sort ( indexes , new Comparator < Integer > ( ) { @ Override public int compare ( Integer o1 , Integer o2 ) { return comparator . compare ( atomContainers [ o1 ] , atomContainers [ o2 ] ) ; } } ) ; // copy the original arrays ( we could modify in place with swaps but this is cleaner )
IAtomContainer [ ] containersTmp = Arrays . copyOf ( atomContainers , indexes . length ) ; Double [ ] multipliersTmp = Arrays . copyOf ( multipliers , indexes . length ) ; // order the arrays based on the order of the indices
for ( int i = 0 ; i < indexes . length ; i ++ ) { atomContainers [ i ] = containersTmp [ indexes [ i ] ] ; multipliers [ i ] = multipliersTmp [ indexes [ i ] ] ; } |
public class CPTaxCategoryLocalServiceBaseImpl { /** * Deletes the cp tax category with the primary key from the database . Also notifies the appropriate model listeners .
* @ param CPTaxCategoryId the primary key of the cp tax category
* @ return the cp tax category that was removed
* @ throws PortalException if a cp tax category with the primary key could not be found */
@ Indexable ( type = IndexableType . DELETE ) @ Override public CPTaxCategory deleteCPTaxCategory ( long CPTaxCategoryId ) throws PortalException { } } | return cpTaxCategoryPersistence . remove ( CPTaxCategoryId ) ; |
public class VTimeZone { /** * Write the closing section of the VTIMEZONE definition block */
private static void writeFooter ( Writer writer ) throws IOException { } } | writer . write ( ICAL_END ) ; writer . write ( COLON ) ; writer . write ( ICAL_VTIMEZONE ) ; writer . write ( NEWLINE ) ; |
public class PoissonDistribution { /** * This function generates a random variate with the poisson distribution .
* Uses down / up search from the mode by chop - down technique for & lambda ; & lt ; 20,
* and patchwork rejection method for & lambda ; & ge ; 20.
* For & lambda ; & lt ; 1 . E - 6 numerical inaccuracy is avoided by direct calculation . */
@ Override public double rand ( ) { } } | if ( lambda > 2E9 ) { throw new IllegalArgumentException ( "Too large lambda for random number generator." ) ; } if ( lambda == 0 ) { return 0 ; } // For extremely small L we calculate the probabilities of x = 1
// and x = 2 ( ignoring higher x ) . The reason for using this
// method is to prevent numerical inaccuracies in other methods .
if ( lambda < 1.E-6 ) { return tinyLambdaRand ( lambda ) ; } if ( rng == null ) { if ( lambda < 20 ) { // down / up search from mode
// The computation time for this method grows with sqrt ( L ) .
// Gives overflow for L > 60
rng = new ModeSearch ( ) ; } else { // patchword rejection method
// The computation time for this method does not depend on L .
// Use where other methods would be slower .
rng = new Patchwork ( ) ; } } return rng . rand ( ) ; |
public class StringUtilities { /** * Get scanner from input stream .
* < b > Note : the scanner needs to be closed after use . < / b >
* @ param stream the stream to read .
* @ param delimiter the delimiter to use .
* @ return the scanner . */
@ SuppressWarnings ( "resource" ) public static Scanner streamToScanner ( InputStream stream , String delimiter ) { } } | java . util . Scanner s = new java . util . Scanner ( stream ) . useDelimiter ( delimiter ) ; return s ; |
public class AbstractResponseProcessor { /** * < p > Accepts an { @ link InvocationContext } and an { @ link HttpResponse } , validates all preconditions
* and uses the metadata contained within the configuration to process and subsequently parse the
* request . Any implementations that wish to check additional preconditions or those that wish to
* alter this basic approach should override this method . < / p >
* < p > < b > Note < / b > that this method is expected to return the < i > deserialized response entity < / i > of
* the type specified by the request definition . This is passed along to all successive processors
* in the chain via the processor arguments . < / p >
* < p > Delegates to { @ link # process ( InvocationContext , HttpResponse , Object ) } . < / p >
* < p > See { @ link Processor # run ( Object . . . ) } . < / p >
* @ param args
* a array of < b > length 2 or more < / b > with an { @ link HttpResponse } , an { @ link InvocationContext }
* and possibly the result of the deserialized response entity
* < br > < br >
* @ return the deserialized response entity , which may be { @ code null } for endpoint request definitions
* which do not declare a return type or for those which the return type is { @ link Void }
* < br > < br >
* @ throws IllegalArgumentException
* if the supplied arguments array is { @ code null } or if the number of arguments is less than 2,
* or if the arguments are not of the expected type
* < br > < br >
* @ throws RequestProcessorException
* if response processing failed for the given { @ link InvocationContext } and { @ link HttpResponse }
* < br > < br >
* @ since 1.3.0 */
@ Override public Object run ( Object ... args ) { } } | assertLength ( args , 2 , 3 ) ; return process ( assertAssignable ( assertNotNull ( args [ 0 ] ) , InvocationContext . class ) , assertAssignable ( assertNotNull ( args [ 1 ] ) , HttpResponse . class ) , ( args . length > 2 ) ? args [ 2 ] : null ) ; |
public class DefaultGroovyMethods { /** * Iterates over the elements of an aggregate of items , starting from
* a specified startIndex , and returns the index values of the items that match
* the condition specified in the closure .
* @ param self the iteration object over which to iterate
* @ param startIndex start matching from this index
* @ param condition the matching condition
* @ return a list of numbers corresponding to the index values of all matched objects
* @ since 1.5.2 */
public static List < Number > findIndexValues ( Object self , Number startIndex , Closure condition ) { } } | return findIndexValues ( InvokerHelper . asIterator ( self ) , startIndex , condition ) ; |
public class AbstractCopier { /** * Performs the serialization and deserialization , returning the copied object .
* @ param object the object to serialize
* @ param classLoader the classloader to create the instance with
* @ param < T > the type of object being copied
* @ return the deserialized object */
protected < T > T roundtrip ( T object , ClassLoader classLoader ) { } } | A data = serialize ( object ) ; @ SuppressWarnings ( "unchecked" ) T copy = ( T ) deserialize ( data , classLoader ) ; return copy ; |
public class SpecRewriter { /** * will then be used by DeepBlockRewriter */
private void handleWhereBlock ( Method method ) { } } | Block block = method . getLastBlock ( ) ; if ( ! ( block instanceof WhereBlock ) ) return ; new DeepBlockRewriter ( this ) . visit ( block ) ; WhereBlockRewriter . rewrite ( ( WhereBlock ) block , this ) ; |
public class Bus { /** * Removes the given object from the set of registered observers .
* @ param observer
* the observer to be removed .
* @ return
* < code > true < / code > if the object was in the set of registered observers ,
* < code > false < / code > otherwise . */
public boolean removeObserver ( BusObserver < M > observer ) { } } | logger . trace ( "removing observer {}" , observer . getClass ( ) . getSimpleName ( ) ) ; return observers . remove ( observer ) ; |
public class DefaultController { /** * Get the root controller in the hierarchy group .
* @ return the root controller in the hierarchy or the self controller if not
* exists a parent controller . */
@ Override public final Controller getRoot ( ) { } } | Controller superController = this ; while ( superController . getParent ( ) != null ) { superController = superController . getParent ( ) ; } return superController ; |
public class CharacterRangeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case XtextPackage . CHARACTER_RANGE__LEFT : setLeft ( ( Keyword ) newValue ) ; return ; case XtextPackage . CHARACTER_RANGE__RIGHT : setRight ( ( Keyword ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class X509ExtensionSet { /** * Adds a X509Extension object to this set .
* @ param extension the extension to add
* @ return an extension that was removed with the same oid as the
* new extension . Null , if none existed before . */
public X509Extension add ( X509Extension extension ) { } } | if ( extension == null ) { throw new IllegalArgumentException ( i18n . getMessage ( "extensionNull" ) ) ; } return ( X509Extension ) this . extensions . put ( extension . getOid ( ) , extension ) ; |
public class JwtBuilder { /** * 重token中获取token过期时间
* @ param token 当前token
* @ return token创建时间 */
public Date getExpirationDateFromToken ( String token ) { } } | Date expiration ; try { final Claims claims = getClaimsFromToken ( token ) ; return claims . getExpiration ( ) ; } catch ( Exception e ) { log . error ( "get expiration Time from jwt token error : {}" , e . getMessage ( ) ) ; return null ; } |
public class ResourceHandle { /** * Retrieves the ' content ' resource of this resource . Normally the content resource is the resource ot the
* ' jcr : content ' subnode if this resource ist not the content resource itself .
* @ return the content resource if present or self */
public ResourceHandle getContentResource ( ) { } } | if ( contentResource == null ) { if ( ResourceUtil . CONTENT_NODE . equals ( getName ( ) ) || ! this . isValid ( ) ) { contentResource = this ; } else { contentResource = ResourceHandle . use ( this . getChild ( ResourceUtil . CONTENT_NODE ) ) ; if ( ! contentResource . isValid ( ) ) { contentResource = this ; // fallback to the resource itself if no content exists
} } } return contentResource ; |
public class BackHandlingFilePickerFragment { /** * For consistency , the top level the back button checks against should be the start path .
* But it will fall back on / . */
public File getBackTop ( ) { } } | if ( getArguments ( ) . containsKey ( KEY_START_PATH ) ) { String keyStartPath = getArguments ( ) . getString ( KEY_START_PATH ) ; if ( keyStartPath == null ) return new File ( "/" ) ; return getPath ( keyStartPath ) ; } else { return new File ( "/" ) ; } |
public class AmazonWorkDocsClient { /** * Describes the groups specified by the query . Groups are defined by the underlying Active Directory .
* @ param describeGroupsRequest
* @ return Result of the DescribeGroups operation returned by the service .
* @ throws UnauthorizedOperationException
* The operation is not permitted .
* @ throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource .
* @ throws FailedDependencyException
* The AWS Directory Service cannot reach an on - premises instance . Or a dependency under the control of the
* organization is failing , such as a connected Active Directory .
* @ throws ServiceUnavailableException
* One or more of the dependencies is unavailable .
* @ sample AmazonWorkDocs . DescribeGroups
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / workdocs - 2016-05-01 / DescribeGroups " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public DescribeGroupsResult describeGroups ( DescribeGroupsRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDescribeGroups ( request ) ; |
public class QrPose3DUtils { /** * Specifies 3D location of landmark in marker coordinate system
* @ param row row in the QR code ' s grid coordinate system
* @ param col column in the QR code ' s grid coordinate system
* @ param N width of grid
* @ param location ( Output ) location of feature in marker reference frame */
private void set3D ( int row , int col , int N , Point3D_F64 location ) { } } | double _N = N ; double gridX = 2.0 * ( col / _N - 0.5 ) ; double gridY = 2.0 * ( 0.5 - row / _N ) ; location . set ( gridX , gridY , 0 ) ; |
public class CalendarImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case BpsimPackage . CALENDAR__VALUE : return VALUE_EDEFAULT == null ? value != null : ! VALUE_EDEFAULT . equals ( value ) ; case BpsimPackage . CALENDAR__ID : return ID_EDEFAULT == null ? id != null : ! ID_EDEFAULT . equals ( id ) ; case BpsimPackage . CALENDAR__NAME : return NAME_EDEFAULT == null ? name != null : ! NAME_EDEFAULT . equals ( name ) ; } return super . eIsSet ( featureID ) ; |
public class MedicationStatement { /** * syntactic sugar */
public MedicationStatementDosageComponent addDosage ( ) { } } | MedicationStatementDosageComponent t = new MedicationStatementDosageComponent ( ) ; if ( this . dosage == null ) this . dosage = new ArrayList < MedicationStatementDosageComponent > ( ) ; this . dosage . add ( t ) ; return t ; |
public class Metadata { /** * Adds a new reference to the specific element class . If no element class is found , then a new element class . will
* be created .
* @ param className
* the class name
* @ param classReference
* the new reference to be added . */
public void addClassReference ( final String className , final MetadataElement classReference ) { } } | classReference . setRef ( getNamespaceValue ( classReference . getRef ( ) ) ) ; for ( MetadataItem item : classList ) { if ( item . getName ( ) . equals ( className ) && item . getNamespace ( ) . equals ( getCurrentNamespace ( ) ) && item . getPackageApi ( ) . equals ( getCurrentPackageApi ( ) ) ) { item . getReferences ( ) . add ( classReference ) ; return ; } } final MetadataItem newItem = new MetadataItem ( className ) ; newItem . getReferences ( ) . add ( classReference ) ; newItem . setNamespace ( getCurrentNamespace ( ) ) ; newItem . setSchemaName ( getCurrentSchmema ( ) ) ; newItem . setPackageApi ( getCurrentPackageApi ( ) ) ; newItem . setPackageImpl ( getCurrentPackageImpl ( ) ) ; classList . add ( newItem ) ; |
public class PublicationManagerImpl { /** * Stops all publications for a provider
* @ param providerParticipantId provider for which all publication should be stopped */
private void stopPublicationByProviderId ( String providerParticipantId ) { } } | for ( PublicationInformation publicationInformation : subscriptionId2PublicationInformation . values ( ) ) { if ( publicationInformation . getProviderParticipantId ( ) . equals ( providerParticipantId ) ) { removePublication ( publicationInformation . getSubscriptionId ( ) ) ; } } if ( providerParticipantId != null && queuedSubscriptionRequests . containsKey ( providerParticipantId ) ) { queuedSubscriptionRequests . removeAll ( providerParticipantId ) ; } |
public class CPOptionCategoryUtil { /** * Returns the first cp option category 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 first matching cp option category
* @ throws NoSuchCPOptionCategoryException if a matching cp option category could not be found */
public static CPOptionCategory findByGroupId_First ( long groupId , OrderByComparator < CPOptionCategory > orderByComparator ) throws com . liferay . commerce . product . exception . NoSuchCPOptionCategoryException { } } | return getPersistence ( ) . findByGroupId_First ( groupId , orderByComparator ) ; |
public class TileBoundingBoxUtils { /** * Get the bounding box of the tile grid in the tile width and height bounds
* using the total bounding box with constant units
* @ param totalBox
* total bounding box
* @ param tileMatrixWidth
* matrix width
* @ param tileMatrixHeight
* matrix height
* @ param tileGrid
* tile grid
* @ return bounding box
* @ since 1.2.0 */
public static BoundingBox getBoundingBox ( BoundingBox totalBox , long tileMatrixWidth , long tileMatrixHeight , TileGrid tileGrid ) { } } | // Get the tile width
double matrixMinX = totalBox . getMinLongitude ( ) ; double matrixMaxX = totalBox . getMaxLongitude ( ) ; double matrixWidth = matrixMaxX - matrixMinX ; double tileWidth = matrixWidth / tileMatrixWidth ; // Find the longitude range
double minLon = matrixMinX + ( tileWidth * tileGrid . getMinX ( ) ) ; double maxLon = matrixMinX + ( tileWidth * ( tileGrid . getMaxX ( ) + 1 ) ) ; // Get the tile height
double matrixMinY = totalBox . getMinLatitude ( ) ; double matrixMaxY = totalBox . getMaxLatitude ( ) ; double matrixHeight = matrixMaxY - matrixMinY ; double tileHeight = matrixHeight / tileMatrixHeight ; // Find the latitude range
double maxLat = matrixMaxY - ( tileHeight * tileGrid . getMinY ( ) ) ; double minLat = matrixMaxY - ( tileHeight * ( tileGrid . getMaxY ( ) + 1 ) ) ; BoundingBox boundingBox = new BoundingBox ( minLon , minLat , maxLon , maxLat ) ; return boundingBox ; |
public class StartQueryExecutionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( StartQueryExecutionRequest startQueryExecutionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( startQueryExecutionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( startQueryExecutionRequest . getQueryString ( ) , QUERYSTRING_BINDING ) ; protocolMarshaller . marshall ( startQueryExecutionRequest . getClientRequestToken ( ) , CLIENTREQUESTTOKEN_BINDING ) ; protocolMarshaller . marshall ( startQueryExecutionRequest . getQueryExecutionContext ( ) , QUERYEXECUTIONCONTEXT_BINDING ) ; protocolMarshaller . marshall ( startQueryExecutionRequest . getResultConfiguration ( ) , RESULTCONFIGURATION_BINDING ) ; protocolMarshaller . marshall ( startQueryExecutionRequest . getWorkGroup ( ) , WORKGROUP_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class SimulatorJobTracker { /** * Returns the simulatorClock in that is a static object in SimulatorJobTracker .
* @ return SimulatorClock object . */
static Clock getClock ( ) { } } | assert ( engine . getCurrentTime ( ) == clock . getTime ( ) ) : " Engine time = " + engine . getCurrentTime ( ) + " JobTracker time = " + clock . getTime ( ) ; return clock ; |
public class nsconfig { /** * Use this API to fetch all the nsconfig resources that are configured on netscaler . */
public static nsconfig get ( nitro_service service ) throws Exception { } } | nsconfig obj = new nsconfig ( ) ; nsconfig [ ] response = ( nsconfig [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; |
public class JSMessageImpl { /** * concurrency issues . */
int reallocate ( int offset ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) JmfTr . entry ( this , tc , "reallocate" , new Object [ ] { Integer . valueOf ( offset ) } ) ; byte [ ] oldContents = contents ; int oldMessageOffset = messageOffset ; contents = new byte [ length ] ; System . arraycopy ( oldContents , messageOffset , contents , 0 , length ) ; tableOffset -= messageOffset ; dataOffset -= messageOffset ; messageOffset = 0 ; reallocated = true ; reallocated ( contents , - 1 ) ; int result = offset - oldMessageOffset ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) JmfTr . exit ( this , tc , "reallocate" , Integer . valueOf ( result ) ) ; return result ; |
public class IOUtil { /** * 写数组 , 用制表符分割
* @ param bw
* @ param params
* @ throws IOException */
public static void writeLine ( BufferedWriter bw , String ... params ) throws IOException { } } | for ( int i = 0 ; i < params . length - 1 ; i ++ ) { bw . write ( params [ i ] ) ; bw . write ( '\t' ) ; } bw . write ( params [ params . length - 1 ] ) ; |
public class FctBnAccEntitiesProcessors { /** * < p > Get PrcPaymentToCopy ( create and put into map ) . < / p >
* @ param pAddParam additional param
* @ return requested PrcPaymentToCopy
* @ throws Exception - an exception */
protected final PrcPaymentToCopy < RS > createPutPrcPaymentToCopy ( final Map < String , Object > pAddParam ) throws Exception { } } | PrcPaymentToCopy < RS > proc = new PrcPaymentToCopy < RS > ( ) ; @ SuppressWarnings ( "unchecked" ) IEntityProcessor < PaymentTo , Long > procDlg = ( IEntityProcessor < PaymentTo , Long > ) lazyGetPrcAccEntityPbWithSubaccCopy ( pAddParam ) ; proc . setPrcAccEntityPbWithSubaccCopy ( procDlg ) ; // assigning fully initialized object :
this . processorsMap . put ( PrcPaymentToCopy . class . getSimpleName ( ) , proc ) ; return proc ; |
public class PoolOperations { /** * Enables automatic scaling on the specified pool .
* @ param poolId
* The ID of the pool .
* @ param autoScaleFormula
* The formula for the desired number of compute nodes in the pool .
* @ param autoScaleEvaluationInterval
* The time interval at which to automatically adjust the pool size .
* @ param additionalBehaviors
* A collection of { @ link BatchClientBehavior } instances that are
* applied to the Batch service request .
* @ throws BatchErrorException
* Exception thrown when an error response is received from the
* Batch service .
* @ throws IOException
* Exception thrown when there is an error in
* serialization / deserialization of data sent to / received from the
* Batch service . */
public void enableAutoScale ( String poolId , String autoScaleFormula , Period autoScaleEvaluationInterval , Iterable < BatchClientBehavior > additionalBehaviors ) throws BatchErrorException , IOException { } } | PoolEnableAutoScaleOptions options = new PoolEnableAutoScaleOptions ( ) ; BehaviorManager bhMgr = new BehaviorManager ( this . customBehaviors ( ) , additionalBehaviors ) ; bhMgr . applyRequestBehaviors ( options ) ; PoolEnableAutoScaleParameter param = new PoolEnableAutoScaleParameter ( ) . withAutoScaleFormula ( autoScaleFormula ) . withAutoScaleEvaluationInterval ( autoScaleEvaluationInterval ) ; this . parentBatchClient . protocolLayer ( ) . pools ( ) . enableAutoScale ( poolId , param , options ) ; |
public class CIFReader { /** * Read a ChemFile from input .
* @ return the content in a ChemFile object */
@ Override public < T extends IChemObject > T read ( T object ) throws CDKException { } } | if ( object instanceof IChemFile ) { IChemFile cf = ( IChemFile ) object ; try { cf = readChemFile ( cf ) ; } catch ( IOException e ) { logger . error ( "Input/Output error while reading from input." ) ; } return ( T ) cf ; } else { throw new CDKException ( "Only supported is reading of ChemFile." ) ; } |
public class Interceptors { /** * Creates an interceptor chain .
* @ param < T > the function parameter type
* @ param < R > the function result type
* @ param innermost the function to be intercepted
* @ param interceptor the interceptor
* @ return the resulting function */
public static < T , R > Function < T , R > intercept ( Function < T , R > innermost , Interceptor < T > interceptor ) { } } | dbc . precondition ( interceptor != null , "cannot create an interceptor chain with a null interceptor" ) ; return new InterceptorChain < > ( innermost , new SingletonIterator < Interceptor < T > > ( interceptor ) ) ; |
public class RiakIndex { /** * Remove a asSet of values from this index
* @ param values a collection of values to remove
* @ return a reference to this object */
public final RiakIndex < T > remove ( Collection < T > values ) { } } | for ( T value : values ) { remove ( value ) ; } return this ; |
public class OvhSmsSender { /** * Convert the list of SMS recipients to international phone numbers usable
* by OVH .
* @ param recipients
* the list of recipients
* @ return the list of international phone numbers
* @ throws PhoneNumberException */
private static List < String > convert ( List < Recipient > recipients ) throws PhoneNumberException { } } | List < String > tos = new ArrayList < > ( recipients . size ( ) ) ; // convert phone numbers to international format
for ( Recipient recipient : recipients ) { tos . add ( toInternational ( recipient . getPhoneNumber ( ) ) ) ; } return tos ; |
public class DefaultLoaderService { /** * Removes a resource managed .
* @ param resourceId the resource id . */
public void unload ( String resourceId ) { } } | LoadableResource res = this . resources . get ( resourceId ) ; if ( Objects . nonNull ( res ) ) { res . unload ( ) ; } |
public class MapSubject { /** * Fails if the map does not contain exactly the given set of entries in the given map . */
@ CanIgnoreReturnValue public Ordered containsExactlyEntriesIn ( Map < ? , ? > expectedMap ) { } } | if ( expectedMap . isEmpty ( ) ) { if ( actual ( ) . isEmpty ( ) ) { return IN_ORDER ; } else { isEmpty ( ) ; // fails
return ALREADY_FAILED ; } } boolean containsAnyOrder = containsEntriesInAnyOrder ( expectedMap , "contains exactly" , /* allowUnexpected = */
false ) ; if ( containsAnyOrder ) { return new MapInOrder ( expectedMap , "contains exactly these entries in order" ) ; } else { return ALREADY_FAILED ; } |
public class DialogRootView { /** * Searches for the list view , which is contained by the dialog , in order to register a scroll
* listener .
* @ param view
* The view , which should be searched , as an instance of the class { @ link ViewGroup } .
* The view may not be null */
private boolean findListView ( @ NonNull final View view ) { } } | if ( view instanceof AbsListView ) { this . listView = ( AbsListView ) view ; this . listView . setOnScrollListener ( createListViewScrollListener ( ) ) ; return true ; } else if ( view instanceof ViewGroup ) { ViewGroup viewGroup = ( ViewGroup ) view ; for ( int i = 0 ; i < viewGroup . getChildCount ( ) ; i ++ ) { if ( findListView ( viewGroup . getChildAt ( i ) ) ) { return true ; } } } return false ; |
public class Expression { /** * Returns a code chunk representing the logical or ( { @ code | | } ) of this chunk with the given
* chunk .
* @ param codeGenerator Required in case temporary variables need to be allocated for
* short - circuiting behavior ( { @ code rhs } should be evaluated only if the current chunk
* evaluates as false ) . */
public final Expression or ( Expression rhs , Generator codeGenerator ) { } } | return BinaryOperation . or ( this , rhs , codeGenerator ) ; |
public class SessionManager { /** * This method is invoked by the HttpSessionManagerImpl to get at the session
* or related session information . If the getSession is a result of a
* request . getSession
* call from the application , then the isSessionAccess boolean is set to true .
* Also if the version number is available , then it is provided . If not , then
* a value
* of - 1 is passed in . This can happen either in the case of an incoming
* request
* that provides the session id via URL rewriting but does not provide the
* version / clone
* info or in the case of a isRequestedSessionIDValid call .
* @ param id
* @ param version
* @ param isSessionAccess
* tells us if the request came from a session access ( user request )
* @ return Object */
public Object getSession ( String id , int version , boolean isSessionAccess , Object xdCorrelator ) { } } | return getSession ( id , version , isSessionAccess , false , xdCorrelator ) ; |
public class GetTemplateResult { /** * The stage of the template that you can retrieve . For stacks , the < code > Original < / code > and < code > Processed < / code >
* templates are always available . For change sets , the < code > Original < / code > template is always available . After
* AWS CloudFormation finishes creating the change set , the < code > Processed < / code > template becomes available .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setStagesAvailable ( java . util . Collection ) } or { @ link # withStagesAvailable ( java . util . Collection ) } if you
* want to override the existing values .
* @ param stagesAvailable
* The stage of the template that you can retrieve . For stacks , the < code > Original < / code > and
* < code > Processed < / code > templates are always available . For change sets , the < code > Original < / code > template
* is always available . After AWS CloudFormation finishes creating the change set , the < code > Processed < / code >
* template becomes available .
* @ return Returns a reference to this object so that method calls can be chained together .
* @ see TemplateStage */
public GetTemplateResult withStagesAvailable ( String ... stagesAvailable ) { } } | if ( this . stagesAvailable == null ) { setStagesAvailable ( new com . amazonaws . internal . SdkInternalList < String > ( stagesAvailable . length ) ) ; } for ( String ele : stagesAvailable ) { this . stagesAvailable . add ( ele ) ; } return this ; |
public class BundleUtils { /** * Since Bundle # getCharSequenceArrayList returns concrete ArrayList type , so this method follows that implementation . */
@ TargetApi ( Build . VERSION_CODES . FROYO ) @ Nullable public static ArrayList < CharSequence > optCharSequenceArrayList ( @ Nullable Bundle bundle , @ Nullable String key ) { } } | return optCharSequenceArrayList ( bundle , key , new ArrayList < CharSequence > ( ) ) ; |
public class MockEC2QueryHandler { /** * Handles " createInternetGateway " request to create InternetGateway and returns response with a InternetGateway .
* @ return a CreateInternetGatewayResponseType with our new InternetGateway */
private CreateInternetGatewayResponseType createInternetGateway ( ) { } } | CreateInternetGatewayResponseType ret = new CreateInternetGatewayResponseType ( ) ; ret . setRequestId ( UUID . randomUUID ( ) . toString ( ) ) ; MockInternetGateway mockInternetGateway = mockInternetGatewayController . createInternetGateway ( ) ; InternetGatewayType internetGateway = new InternetGatewayType ( ) ; internetGateway . setInternetGatewayId ( mockInternetGateway . getInternetGatewayId ( ) ) ; ret . setInternetGateway ( internetGateway ) ; return ret ; |
public class Tesseract { /** * Creates renderers for given formats .
* @ param outputbase
* @ param formats
* @ return */
private TessResultRenderer createRenderers ( String outputbase , List < RenderedFormat > formats ) { } } | TessResultRenderer renderer = null ; for ( RenderedFormat format : formats ) { switch ( format ) { case TEXT : if ( renderer == null ) { renderer = api . TessTextRendererCreate ( outputbase ) ; } else { api . TessResultRendererInsert ( renderer , api . TessTextRendererCreate ( outputbase ) ) ; } break ; case HOCR : if ( renderer == null ) { renderer = api . TessHOcrRendererCreate ( outputbase ) ; } else { api . TessResultRendererInsert ( renderer , api . TessHOcrRendererCreate ( outputbase ) ) ; } break ; case PDF : String dataPath = api . TessBaseAPIGetDatapath ( handle ) ; boolean textonly = String . valueOf ( TRUE ) . equals ( prop . getProperty ( "textonly_pdf" ) ) ; if ( renderer == null ) { renderer = api . TessPDFRendererCreate ( outputbase , dataPath , textonly ? TRUE : FALSE ) ; } else { api . TessResultRendererInsert ( renderer , api . TessPDFRendererCreate ( outputbase , dataPath , textonly ? TRUE : FALSE ) ) ; } break ; case BOX : if ( renderer == null ) { renderer = api . TessBoxTextRendererCreate ( outputbase ) ; } else { api . TessResultRendererInsert ( renderer , api . TessBoxTextRendererCreate ( outputbase ) ) ; } break ; case UNLV : if ( renderer == null ) { renderer = api . TessUnlvRendererCreate ( outputbase ) ; } else { api . TessResultRendererInsert ( renderer , api . TessUnlvRendererCreate ( outputbase ) ) ; } break ; case ALTO : if ( renderer == null ) { renderer = api . TessAltoRendererCreate ( outputbase ) ; } else { api . TessResultRendererInsert ( renderer , api . TessAltoRendererCreate ( outputbase ) ) ; } break ; case TSV : if ( renderer == null ) { renderer = api . TessTsvRendererCreate ( outputbase ) ; } else { api . TessResultRendererInsert ( renderer , api . TessTsvRendererCreate ( outputbase ) ) ; } break ; case LSTMBOX : if ( renderer == null ) { renderer = api . TessLSTMBoxRendererCreate ( outputbase ) ; } else { api . TessResultRendererInsert ( renderer , api . TessLSTMBoxRendererCreate ( outputbase ) ) ; } break ; case WORDSTRBOX : if ( renderer == null ) { renderer = api . TessWordStrBoxRendererCreate ( outputbase ) ; } else { api . TessResultRendererInsert ( renderer , api . TessWordStrBoxRendererCreate ( outputbase ) ) ; } break ; } } return renderer ; |
public class EnableEnhancedMonitoringResult { /** * Represents the list of all the metrics that would be in the enhanced state after the operation .
* @ param desiredShardLevelMetrics
* Represents the list of all the metrics that would be in the enhanced state after the operation .
* @ return Returns a reference to this object so that method calls can be chained together .
* @ see MetricsName */
public EnableEnhancedMonitoringResult withDesiredShardLevelMetrics ( MetricsName ... desiredShardLevelMetrics ) { } } | com . amazonaws . internal . SdkInternalList < String > desiredShardLevelMetricsCopy = new com . amazonaws . internal . SdkInternalList < String > ( desiredShardLevelMetrics . length ) ; for ( MetricsName value : desiredShardLevelMetrics ) { desiredShardLevelMetricsCopy . add ( value . toString ( ) ) ; } if ( getDesiredShardLevelMetrics ( ) == null ) { setDesiredShardLevelMetrics ( desiredShardLevelMetricsCopy ) ; } else { getDesiredShardLevelMetrics ( ) . addAll ( desiredShardLevelMetricsCopy ) ; } return this ; |
public class Message { /** * Set the serializer for this message when deserialized by Java . */
private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { } } | in . defaultReadObject ( ) ; if ( null != params ) { this . serializer = params . getDefaultSerializer ( ) ; } |
public class SymmetryTools { /** * Update the scores ( TM - score and RMSD ) of a symmetry multiple alignment .
* This method does not redo the superposition of the alignment .
* @ param symm
* Symmetry Multiple Alignment of Repeats
* @ throws StructureException */
public static void updateSymmetryScores ( MultipleAlignment symm ) throws StructureException { } } | // Multiply by the order of symmetry to normalize score
double tmScore = MultipleAlignmentScorer . getAvgTMScore ( symm ) * symm . size ( ) ; double rmsd = MultipleAlignmentScorer . getRMSD ( symm ) ; symm . putScore ( MultipleAlignmentScorer . AVGTM_SCORE , tmScore ) ; symm . putScore ( MultipleAlignmentScorer . RMSD , rmsd ) ; |
public class ConfigController { /** * Loads the configuration file . The path of the file will be chosen by
* displaying a FileChooser Dialog . */
public void loadConfiguration ( ) { } } | XMLFileChooser fc = new XMLFileChooser ( ) ; if ( fc . showOpenDialog ( new JPanel ( ) ) == XMLFileChooser . APPROVE_OPTION ) { this . loadConfig ( fc . getSelectedFile ( ) . getPath ( ) ) ; } |
public class I18nSpecificsOfItem { /** * < p > Setter for lang . < / p >
* @ param pLang reference */
@ Override public final void setLang ( final Languages pLang ) { } } | this . lang = pLang ; if ( this . itsId == null ) { this . itsId = new IdI18nSpecificsOfItem ( ) ; } this . itsId . setLang ( this . lang ) ; |
public class FormDataNameInterceptor { /** * Qualify the name of a NetUI JSP tag into the " actionForm " data binding context .
* This feature is used to convert non - expression tag names , as those used in Struts ,
* into actionForm expressions that NetUI consumes .
* @ param name the name to qualify into the actionForm binding context . If this is " foo " , the returned value
* is { actionForm . foo }
* @ return the qualified name or < code > null < / code > if an error occurred */
public String rewriteName ( String name , Tag currentTag ) throws ExpressionEvaluationException { } } | ExpressionEvaluator eval = ExpressionEvaluatorFactory . getInstance ( ) ; try { if ( ! eval . isExpression ( name ) ) return eval . qualify ( "actionForm" , name ) ; return name ; } catch ( Exception e ) { if ( logger . isErrorEnabled ( ) ) logger . error ( "Could not qualify name \"" + name + "\" into the actionForm binding context." , e ) ; // return the Struts name . This should cause regular Struts databinding to execute so this property will
// be updated anyway .
return name ; } |
public class TagsBuilder { /** * Add additional tag values . */
public T withTags ( String ... tags ) { } } | for ( int i = 0 ; i < tags . length ; i += 2 ) { extraTags . add ( new BasicTag ( tags [ i ] , tags [ i + 1 ] ) ) ; } return ( T ) this ; |
public class ServerConnectionPoliciesInner { /** * Creates or updates the server ' s connection policy .
* @ 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 connectionType The server connection type . Possible values include : ' Default ' , ' Proxy ' , ' Redirect '
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the ServerConnectionPolicyInner object if successful . */
public ServerConnectionPolicyInner createOrUpdate ( String resourceGroupName , String serverName , ServerConnectionType connectionType ) { } } | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , connectionType ) . toBlocking ( ) . single ( ) . body ( ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.