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 ...
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...
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 ...
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 (...
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 databa...
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 . ...
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 incl...
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...
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 ( ) ;...
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 ...
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 ....
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 prefi...
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 ( ) throw...
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 ) ; tr...
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 *...
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 atomConta...
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 * ...
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 ....
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 e...
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 ) || ( strTargetDirect...
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 . * ...
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 ...
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 ) * @ retu...
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 com...
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' ...
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 ) { ret...
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 exchan...
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 ( ) ; retu...
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 ; ...
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 ( O...
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 , XesXStreamPersisten...
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 {...
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" ) ) ) . w...
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 construct...
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 yo...
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 < Integ...
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...
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 inaccura...
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 inaccuracie...
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 streamToScan...
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 pre...
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 ...
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 */ prot...
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 ( Bus...
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 getContentReso...
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 ; // fallb...
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...
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 refere...
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 == nul...
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 class...
classReference . setRef ( getNamespaceValue ( classReference . getRef ( ) ) ) ; for ( MetadataItem item : classList ) { if ( item . getName ( ) . equals ( className ) && item . getNamespace ( ) . equals ( getCurrentNamespace ( ) ) && item . getPackageApi ( ) . equals ( getCurrentPackageApi ( ) ) ) { item . getReference...
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 && ...
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 * @ ...
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 til...
// 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 ( ) ...
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 (...
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 , messageOf...
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 ...
PrcPaymentToCopy < RS > proc = new PrcPaymentToCopy < RS > ( ) ; @ SuppressWarnings ( "unchecked" ) IEntityProcessor < PaymentTo , Long > procDlg = ( IEntityProcessor < PaymentTo , Long > ) lazyGetPrcAccEntityPbWithSubaccCopy ( pAddParam ) ; proc . setPrcAccEntityPbWithSubaccCopy ( procDlg ) ; // assigning fully initia...
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 adj...
PoolEnableAutoScaleOptions options = new PoolEnableAutoScaleOptions ( ) ; BehaviorManager bhMgr = new BehaviorManager ( this . customBehaviors ( ) , additionalBehaviors ) ; bhMgr . applyRequestBehaviors ( options ) ; PoolEnableAutoScaleParameter param = new PoolEnableAutoScaleParameter ( ) . withAutoScaleFormula ( auto...
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 <...
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 > ...
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 (...
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 ( @ ...
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 ...
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 ch...
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...
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 fin...
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 St...
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 ( ) ; inte...
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 ...
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 ...
com . amazonaws . internal . SdkInternalList < String > desiredShardLevelMetricsCopy = new com . amazonaws . internal . SdkInternalList < String > ( desiredShardLevelMetrics . length ) ; for ( MetricsName value : desiredShardLevelMetrics ) { desiredShardLevelMetricsCopy . add ( value . toString ( ) ) ; } if ( getDesire...
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 ( Mult...
// 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 ...
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 a...
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 b...
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 ....
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , connectionType ) . toBlocking ( ) . single ( ) . body ( ) ;