signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class PasswordCheckUtil { /** * Method which performs strength checks on password . It returns outcome which can be used by CLI . * @ param isAdminitrative - administrative checks are less restrictive . This means that weak password or one which violates restrictions is not indicated as failure . * Administr...
// TODO : allow custom restrictions ? List < PasswordRestriction > passwordValuesRestrictions = getPasswordRestrictions ( ) ; final PasswordStrengthCheckResult strengthResult = this . passwordStrengthChecker . check ( userName , password , passwordValuesRestrictions ) ; final int failedRestrictions = strengthResult . g...
public class TokenList { /** * Checks whether this token list contains a { @ link de . codecentric . zucchini . bdd . resolver . token . VariableToken } with * the specified name . * @ param name The name to check . * @ return { @ literal true } if this token list contains a * { @ link de . codecentric . zucchi...
for ( Token token : this ) { if ( token instanceof VariableToken && token . getText ( ) . equals ( name ) ) { return true ; } } return false ;
public class MultipartStream { /** * Reads the < code > header - part < / code > of the current * < code > encapsulation < / code > . * Headers are returned verbatim to the input stream , including the trailing * < code > CRLF < / code > marker . Parsing is left to the application . * @ return The < code > head...
// to support multi - byte characters try ( final NonBlockingByteArrayOutputStream aBAOS = new NonBlockingByteArrayOutputStream ( ) ) { int nHeaderSepIndex = 0 ; int nSize = 0 ; while ( nHeaderSepIndex < HEADER_SEPARATOR . length ) { byte b ; try { b = readByte ( ) ; } catch ( final IOException e ) { throw new Multipar...
public class MediaServicesInner { /** * Creates a Media Service . * @ param resourceGroupName Name of the resource group within the Azure subscription . * @ param mediaServiceName Name of the Media Service . * @ param parameters Media Service properties needed for creation . * @ throws IllegalArgumentException ...
return createWithServiceResponseAsync ( resourceGroupName , mediaServiceName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class CookieUtil { /** * | " { " | " } " | SP | HT */ private static BitSet validCookieNameOctets ( BitSet validCookieValueOctets ) { } }
BitSet bits = new BitSet ( 8 ) ; bits . or ( validCookieValueOctets ) ; bits . set ( '(' , false ) ; bits . set ( ')' , false ) ; bits . set ( '<' , false ) ; bits . set ( '>' , false ) ; bits . set ( '@' , false ) ; bits . set ( ':' , false ) ; bits . set ( '/' , false ) ; bits . set ( '[' , false ) ; bits . set ( ']'...
public class Optimizer { /** * Multiple adjacent start anchors can be reduced to a single start anchor . */ static Matcher combineAdjacentStart ( Matcher matcher ) { } }
if ( matcher instanceof SeqMatcher ) { List < Matcher > matchers = matcher . < SeqMatcher > as ( ) . matchers ( ) ; if ( ! matchers . isEmpty ( ) && matchers . get ( 0 ) instanceof StartMatcher ) { List < Matcher > ms = new ArrayList < > ( ) ; ms . add ( StartMatcher . INSTANCE ) ; int pos = 0 ; for ( Matcher m : match...
public class AbstractConnection { /** * Create a link between the local node and the specified process on the * remote node . If the link is still active when the remote process * terminates , an exit signal will be sent to this connection . Use * { @ link # sendUnlink unlink ( ) } to remove the link . * @ para...
if ( ! connected ) { throw new IOException ( "Not connected" ) ; } @ SuppressWarnings ( "resource" ) final OtpOutputStream header = new OtpOutputStream ( headerLen ) ; // preamble : 4 byte length + " passthrough " tag header . write4BE ( 0 ) ; // reserve space for length header . write1 ( passThrough ) ; header . write...
public class WSUtilImpl { /** * Overridden to allow objects to be replaced prior to being written . */ @ Override public void writeRemoteObject ( OutputStream out , @ Sensitive Object obj ) throws org . omg . CORBA . SystemException { } }
WSUtilService service = WSUtilService . getInstance ( ) ; if ( service != null ) { obj = service . replaceObject ( obj ) ; } super . writeRemoteObject ( out , obj ) ;
public class Record { /** * Get this field in the table / record . * @ param strTableName the name of the table this field is in ( for query records ) . * @ param The field name . * @ return The field . */ public BaseField getField ( String strTableName , String strFieldName ) // Lookup this field { } }
if ( this . getRecord ( strTableName ) != this ) return null ; return this . getField ( strFieldName ) ;
public class VideoTrackerObjectQuadApp { public static void main ( String [ ] args ) { } }
// Class type = GrayF32 . class ; Class type = GrayU8 . class ; // app . setBaseDirectory ( UtilIO . pathExample ( " " ) ; // app . loadInputData ( UtilIO . pathExample ( " tracking / file _ list . txt " ) ; List < PathLabel > examples = new ArrayList < > ( ) ; examples . add ( new PathLabel ( "WildCat" , UtilIO . path...
public class RequestHelper { /** * Get the passed string without an eventually contained session ID like in * " test . html ; JSESSIONID = 1234 ? param = value " . * @ param aURL * The value to strip the session ID from the path * @ return The value without a session ID or the original string . */ @ Nonnull pub...
ValueEnforcer . notNull ( aURL , "URL" ) ; // Strip the parameter from the path , but keep parameters and anchor intact ! // Note : using URLData avoid parsing , since the data was already parsed ! return new SimpleURL ( new URLData ( getWithoutSessionID ( aURL . getPath ( ) ) , aURL . params ( ) , aURL . getAnchor ( )...
public class MultimapUtils { /** * This will take a multimap which in fact has a single value map for each key and return a copy * of it as an { @ link com . google . common . collect . ImmutableMap } . If the same key if mapped to * multiple values in the input multimap , an { @ link java . lang . IllegalArgumentE...
final Map < K , Collection < V > > inputAsMap = multimap . asMap ( ) ; final ImmutableMap . Builder < K , V > ret = ImmutableMap . builder ( ) ; for ( final Map . Entry < K , Collection < V > > mapping : inputAsMap . entrySet ( ) ) { ret . put ( mapping . getKey ( ) , Iterables . getOnlyElement ( mapping . getValue ( )...
public class ElasticSearchRestDAOV5 { /** * Roll the tasklog index daily . */ private void updateIndexName ( ) { } }
this . logIndexName = this . logIndexPrefix + "_" + SIMPLE_DATE_FORMAT . format ( new Date ( ) ) ; try { addIndex ( logIndexName ) ; } catch ( IOException e ) { logger . error ( "Failed to update log index name: {}" , logIndexName , e ) ; }
public class SegmentManager { /** * Inserts a segment . * @ param segment The segment to insert . * @ throws IllegalStateException if the segment is unknown */ public synchronized void replaceSegments ( Collection < Segment > segments , Segment segment ) { } }
// Update the segment descriptor and lock the segment . segment . descriptor ( ) . update ( System . currentTimeMillis ( ) ) ; segment . descriptor ( ) . lock ( ) ; // Iterate through old segments and remove them from the segments list . for ( Segment oldSegment : segments ) { if ( ! this . segments . containsKey ( old...
public class JSONSummariser { /** * Returns a function that can be used as a summary function , using the given * start time for timing analysis . * @ param emptyCounts * A { @ link JDefaultDict } used to store counts of non - empty fields , * based on { @ link String # trim ( ) } and { @ link String # isEmpty ...
return ( node , header , line ) -> { int nextLineNumber = rowCount . incrementAndGet ( ) ; if ( nextLineNumber % 10000 == 0 ) { double secondsSinceStart = ( System . currentTimeMillis ( ) - startTime ) / 1000.0d ; System . out . printf ( "%d\tSeconds since start: %f\tRecords per second: %f%n" , nextLineNumber , seconds...
public class RestClientUtil { /** * 创建索引文档 , 根据elasticsearch . xml中指定的日期时间格式 , 生成对应时间段的索引表名称 * @ param indexName * @ param indexType * @ param bean * @ return * @ throws ElasticSearchException */ public String addDocumentWithParentId ( String indexName , String indexType , Object bean , Object parentId ) thro...
return addDocument ( indexName , indexType , bean , ( Object ) null , parentId , ( String ) null ) ;
public class StringGroovyMethods { /** * Determine if a CharSequence can be parsed as a Double . * @ param self a CharSequence * @ return true if the CharSequence can be parsed * @ see # isDouble ( String ) * @ since 1.8.2 */ public static boolean isDouble ( CharSequence self ) { } }
try { Double . valueOf ( self . toString ( ) . trim ( ) ) ; return true ; } catch ( NumberFormatException nfe ) { return false ; }
public class DbRemoteConfigLoader { /** * 销毁 */ @ Override public void destroy ( ) { } }
executor . shutdownNow ( ) ; try { dataSource . close ( ) ; } catch ( Exception e ) { logger . error ( e . getMessage ( ) , e ) ; }
public class CouchDBQuery { /** * Gets the columns to output . * @ param m * the m * @ param kunderaQuery * the kundera query * @ return the columns to output */ private List < Map < String , Object > > getColumnsToOutput ( EntityMetadata m , KunderaQuery kunderaQuery ) { } }
if ( kunderaQuery . isSelectStatement ( ) ) { SelectStatement selectStatement = kunderaQuery . getSelectStatement ( ) ; SelectClause selectClause = ( SelectClause ) selectStatement . getSelectClause ( ) ; return KunderaQueryUtils . readSelectClause ( selectClause . getSelectExpression ( ) , m , false , kunderaMetadata ...
public class ODatabaseObjectTx { /** * Create a new POJO by its class name . Assure to have called the registerEntityClasses ( ) declaring the packages that are part of * entity classes . * @ see OEntityManager . registerEntityClasses ( String ) */ public < RET extends Object > RET newInstance ( final String iClass...
checkSecurity ( ODatabaseSecurityResources . CLASS , ORole . PERMISSION_CREATE , iClassName ) ; try { return ( RET ) entityManager . createPojo ( iClassName ) ; } catch ( Exception e ) { OLogManager . instance ( ) . error ( this , "Error on creating object of class " + iClassName , e , ODatabaseException . class ) ; } ...
public class FrameworkUtils { /** * Construct data map from inputting jackson json object */ public static Map < String , String > json2map ( String prefix , JsonNode json ) { } }
logger . trace ( "json to map - prefix: {}" , prefix ) ; if ( json . isArray ( ) ) { Map < String , String > result = new HashMap < > ( ) ; for ( int i = 0 ; i < json . size ( ) ; i ++ ) { result . putAll ( json2map ( prefix + "[" + i + "]" , json . get ( i ) ) ) ; } return result ; } else if ( json . isObject ( ) ) { ...
public class ResourceIdentifierMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ResourceIdentifier resourceIdentifier , ProtocolMarshaller protocolMarshaller ) { } }
if ( resourceIdentifier == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( resourceIdentifier . getResourceArn ( ) , RESOURCEARN_BINDING ) ; protocolMarshaller . marshall ( resourceIdentifier . getResourceType ( ) , RESOURCETYPE_BINDING ) ; ...
public class RecordChangedHandler { /** * Set the date field to the current time . * Also make sure the time is not the same as it is currently . */ public void setTheDate ( ) { } }
boolean [ ] rgbEnabled = m_field . setEnableListeners ( false ) ; Calendar calAfter = m_field . getCalendar ( ) ; Calendar calBefore = m_field . getCalendar ( ) ; m_field . setValue ( DateTimeField . currentTime ( ) , DBConstants . DISPLAY , DBConstants . SCREEN_MOVE ) ; // File written or updated , set the update date...
public class Statement { /** * Returns a new { @ link Statement } with the source location attached . */ public final Statement withSourceLocation ( SourceLocation location ) { } }
checkNotNull ( location ) ; if ( location . equals ( this . location ) ) { return this ; } return new Statement ( location ) { @ Override protected void doGen ( CodeBuilder adapter ) { Statement . this . gen ( adapter ) ; } } ;
public class FileUtils { /** * Sanitize relative paths against " zip slip " vulnerability , by removing path segments if " . . " is found in the * URL , but without allowing navigation above the path hierarchy root . Treats each " ! " character as a new path * hierarchy root . Also removes " . " and empty path segm...
if ( path . isEmpty ( ) ) { return "" ; } // Find all ' / ' and ' ! ' character positions , which split a path into segments boolean foundSegmentToSanitize = false ; { int lastSepIdx = - 1 ; char prevC = '\0' ; for ( int i = 0 ; i < path . length ( ) + 1 ; i ++ ) { final char c = i == path . length ( ) ? '\0' : path . ...
public class ArrayUtils { /** * 判定给定的数组是否为空 。 < / br > Returns true if given object is an not null array and it * is length = = 0 ; false otherwise . * @ param array 用来测试的数组 。 < / br > the array to be tested . * @ return 如果给定的是数组并且为null或长度为0则返回true , 否则返回false 。 < / br > true if given object is * an array and i...
if ( array == null ) { return true ; } boolean isArray = array . getClass ( ) . isArray ( ) ; if ( isArray ) { int length = Array . getLength ( array ) ; return length == 0 ; } return isArray ;
public class OrcSerDeMarshaller { /** * Marshall the given parameter object . */ public void marshall ( OrcSerDe orcSerDe , ProtocolMarshaller protocolMarshaller ) { } }
if ( orcSerDe == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( orcSerDe . getStripeSizeBytes ( ) , STRIPESIZEBYTES_BINDING ) ; protocolMarshaller . marshall ( orcSerDe . getBlockSizeBytes ( ) , BLOCKSIZEBYTES_BINDING ) ; protocolMarshaller...
public class ActionValidator { protected ValidationSuccess doValidate ( Object form , VaMore < MESSAGES > moreValidationLambda , VaErrorHook validationErrorLambda ) { } }
verifyFormType ( form ) ; return actuallyValidate ( wrapAsValidIfNeeds ( form ) , moreValidationLambda , validationErrorLambda ) ;
public class DataFileCache { /** * Writes out all the rows to a new file without fragmentation . */ public void defrag ( ) { } }
if ( cacheReadonly ) { return ; } if ( fileFreePosition == INITIAL_FREE_POS ) { return ; } database . logger . appLog . logContext ( SimpleLog . LOG_NORMAL , "start" ) ; try { boolean wasNio = dataFile . wasNio ( ) ; cache . saveAll ( ) ; DataFileDefrag dfd = new DataFileDefrag ( database , this , fileName ) ; dfd . pr...
public class PatternBox { /** * Pattern for an entity is producing a small molecule , and the small molecule controls state * change of another molecule . * @ param blacklist a skip - list of ubiquitous molecules * @ return the pattern */ public static Pattern controlsStateChangeThroughControllerSmallMolecule ( B...
Pattern p = new Pattern ( SequenceEntityReference . class , "upper controller ER" ) ; p . add ( linkedER ( true ) , "upper controller ER" , "upper controller generic ER" ) ; p . add ( erToPE ( ) , "upper controller generic ER" , "upper controller simple PE" ) ; p . add ( linkToComplex ( ) , "upper controller simple PE"...
public class Menu { /** * This function will return all the menu and sub - menu items that can * be directly ( the shortcut directly corresponds ) and indirectly * ( the ALT - enabled char corresponds to the shortcut ) associated * with the keyCode . */ @ SuppressWarnings ( "deprecation" ) void findItemsWithShort...
final boolean qwerty = isQwertyMode ( ) ; final int metaState = event . getMetaState ( ) ; final KeyCharacterMap . KeyData possibleChars = new KeyCharacterMap . KeyData ( ) ; // Get the chars associated with the keyCode ( i . e using any chording combo ) final boolean isKeyCodeMapped = event . getKeyData ( possibleChar...
public class SQSSession { /** * Creates a < code > MessageProducer < / code > for the specified destination . * Only queue destinations are supported at this time . * @ param destination * a queue destination * @ return new message producer * @ throws JMSException * If session is closed or queue destination...
checkClosed ( ) ; if ( destination != null && ! ( destination instanceof SQSQueueDestination ) ) { throw new JMSException ( "Actual type of Destination/Queue has to be SQSQueueDestination" ) ; } SQSMessageProducer messageProducer ; synchronized ( stateLock ) { checkClosing ( ) ; messageProducer = new SQSMessageProducer...
public class UniqueBondMatches { /** * Convert a mapping to a bitset . * @ param mapping an atom mapping * @ return a bit set of the mapped vertices ( values in array ) */ private Set < Tuple > toEdgeSet ( int [ ] mapping ) { } }
Set < Tuple > edges = new HashSet < Tuple > ( mapping . length * 2 ) ; for ( int u = 0 ; u < g . length ; u ++ ) { for ( int v : g [ u ] ) { edges . add ( new Tuple ( mapping [ u ] , mapping [ v ] ) ) ; } } return edges ;
public class Expression { /** * Validates the expression * @ throws IllegalArgumentException if one or more parameters were invalid */ public void validate ( ) { } }
if ( id == null || id . isEmpty ( ) ) { throw new IllegalArgumentException ( "missing or empty id" ) ; } Query . validateId ( id ) ; if ( expr == null || expr . isEmpty ( ) ) { throw new IllegalArgumentException ( "missing or empty expr" ) ; } // parse it just to make sure we ' re happy and extract the variable names ....
public class UcsApi { /** * Search for interactions based on search query , using lucene search * @ param luceneSearchInteractionData ( required ) * @ return ApiResponse & lt ; ApiSuccessResponse & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body ...
com . squareup . okhttp . Call call = searchInteractionsValidateBeforeCall ( luceneSearchInteractionData , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class ProjectiveStructureByFactorization { /** * Sets depths for a particular value to the values in the passed in array * @ param view * @ param featureDepths */ public void setDepths ( int view , double featureDepths [ ] ) { } }
if ( featureDepths . length < depths . numCols ) throw new IllegalArgumentException ( "Pixel count must be constant and match " + pixels . numCols ) ; int N = depths . numCols ; for ( int i = 0 ; i < N ; i ++ ) { depths . set ( view , i , featureDepths [ i ] ) ; }
public class DatabasesInner { /** * Returns the list of databases of the given Kusto cluster . * @ param resourceGroupName The name of the resource group containing the Kusto cluster . * @ param clusterName The name of the Kusto cluster . * @ throws IllegalArgumentException thrown if parameters fail the validatio...
return listByClusterWithServiceResponseAsync ( resourceGroupName , clusterName ) . map ( new Func1 < ServiceResponse < List < DatabaseInner > > , List < DatabaseInner > > ( ) { @ Override public List < DatabaseInner > call ( ServiceResponse < List < DatabaseInner > > response ) { return response . body ( ) ; } } ) ;
public class CppReader { /** * Defines the given name as a macro . * This is a convnience method . */ public void addMacro ( @ Nonnull String name , @ Nonnull String value ) throws LexerException { } }
cpp . addMacro ( name , value ) ;
public class ParserFJTask { /** * Took a crash / NPE somewhere in the parser . Attempt cleanup . */ @ Override public boolean onExceptionalCompletion ( Throwable ex , CountedCompleter caller ) { } }
Futures fs = new Futures ( ) ; if ( _job != null ) { UKV . remove ( _job . destination_key , fs ) ; UKV . remove ( _job . _progress , fs ) ; // Find & remove all partially - built output vecs & chunks if ( _job . _mfpt != null ) _job . _mfpt . onExceptionCleanup ( fs ) ; } // Assume the input is corrupt - or already pa...
public class JavacParser { /** * Resources = Resource { " ; " Resources } */ List < JCTree > resources ( ) { } }
ListBuffer < JCTree > defs = new ListBuffer < > ( ) ; defs . append ( resource ( ) ) ; while ( token . kind == SEMI ) { // All but last of multiple declarators must subsume a semicolon storeEnd ( defs . last ( ) , token . endPos ) ; int semiColonPos = token . pos ; nextToken ( ) ; if ( token . kind == RPAREN ) { // Opt...
public class TemplateDrivenMultiBranchProject { /** * Triggered by different listeners to enforce state for multi - branch projects and their sub - projects . * < ul > * < li > Watches for changes to the template project and corrects the SCM and enabled / disabled state if modified . < / li > * < li > Looks for r...
if ( item . getParent ( ) instanceof TemplateDrivenMultiBranchProject ) { TemplateDrivenMultiBranchProject parent = ( TemplateDrivenMultiBranchProject ) item . getParent ( ) ; AbstractProject template = parent . getTemplate ( ) ; if ( item . equals ( template ) ) { try { if ( ! ( template . getScm ( ) instanceof NullSC...
public class CmsRestoreView { /** * Click handler for the OK button . < p > * @ param e the click event */ @ UiHandler ( "m_okButton" ) protected void onClickOk ( ClickEvent e ) { } }
final boolean undoMove = m_undoMoveCheckbox . getFormValue ( ) . booleanValue ( ) ; m_popup . hide ( ) ; CmsRpcAction < Void > action = new CmsRpcAction < Void > ( ) { @ Override public void execute ( ) { start ( 200 , true ) ; I_CmsVfsServiceAsync service = CmsCoreProvider . getVfsService ( ) ; service . undoChanges (...
public class ByteBufQueue { /** * Returns the number of ByteBufs in this queue . */ @ Contract ( pure = true ) public int remainingBufs ( ) { } }
return last >= first ? last - first : bufs . length + ( last - first ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcOwnerHistory ( ) { } }
if ( ifcOwnerHistoryEClass == null ) { ifcOwnerHistoryEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 405 ) ; } return ifcOwnerHistoryEClass ;
public class DirectoryWatcher { /** * 为指定目录及其所有子目录注册监控事件 * @ param path 目录 */ private void registerDirectoryTree ( Path path ) { } }
try { Files . walkFileTree ( path , new SimpleFileVisitor < Path > ( ) { @ Override public FileVisitResult preVisitDirectory ( Path dir , BasicFileAttributes attrs ) throws IOException { registerDirectory ( dir ) ; return FileVisitResult . CONTINUE ; } } ) ; } catch ( IOException ex ) { LOGGER . error ( "监控目录失败:" + pat...
public class RootDocumentRepositoryMongoImpl { /** * { @ inheritDoc } */ @ Override public final RootDocument findByFileAndString ( final String filename , final String string ) { } }
final Query searchQuery = new Query ( Criteria . where ( "string" ) . is ( string ) . and ( "filename" ) . is ( filename ) ) ; final RootDocument rootDocument = mongoTemplate . findOne ( searchQuery , RootDocumentMongo . class ) ; if ( rootDocument == null ) { return null ; } final Root root = ( Root ) toObjConverter ....
public class Leaf { /** * Writes the leaf to a JSON object for storage . This is necessary for the CAS * calls and to reduce storage costs since we don ' t need to store UID names * ( particularly as someone may rename a UID ) * @ return The byte array to store */ private byte [ ] toStorageJson ( ) { } }
final ByteArrayOutputStream output = new ByteArrayOutputStream ( display_name . length ( ) + tsuid . length ( ) + 30 ) ; try { final JsonGenerator json = JSON . getFactory ( ) . createGenerator ( output ) ; json . writeStartObject ( ) ; // we only need to write a small amount of information json . writeObjectField ( "d...
public class VectorUtil { /** * Compute the minimum angle between two rectangles . * @ param v1 first rectangle * @ param v2 second rectangle * @ return Angle */ public static double minCosAngle ( SpatialComparable v1 , SpatialComparable v2 ) { } }
if ( v1 instanceof NumberVector && v2 instanceof NumberVector ) { return cosAngle ( ( NumberVector ) v1 , ( NumberVector ) v2 ) ; } final int dim1 = v1 . getDimensionality ( ) , dim2 = v2 . getDimensionality ( ) ; final int mindim = ( dim1 <= dim2 ) ? dim1 : dim2 ; // Essentially , we want to compute this : // absmax (...
public class Periodic { /** * Call from a procedure that gets a < code > @ Context GraphDatbaseAPI db ; < / code > injected and provide that db to the runnable . */ public static < T > JobInfo submit ( String name , Runnable task ) { } }
JobInfo info = new JobInfo ( name ) ; Future < T > future = list . remove ( info ) ; if ( future != null && ! future . isDone ( ) ) future . cancel ( false ) ; Future newFuture = Pools . SCHEDULED . submit ( task ) ; list . put ( info , newFuture ) ; return info ;
public class GlobalSecondaryIndexDescriptionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GlobalSecondaryIndexDescription globalSecondaryIndexDescription , ProtocolMarshaller protocolMarshaller ) { } }
if ( globalSecondaryIndexDescription == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( globalSecondaryIndexDescription . getIndexName ( ) , INDEXNAME_BINDING ) ; protocolMarshaller . marshall ( globalSecondaryIndexDescription . getKeySchema...
public class MultipleAlignmentScorer { /** * Calculates the RMSD of all - to - all structure comparisons ( distances ) , * given a set of superimposed atoms . * @ param transformed * @ return double RMSD * @ see # getRMSD ( MultipleAlignment ) */ public static double getRMSD ( List < Atom [ ] > transformed ) { ...
double sumSqDist = 0 ; int comparisons = 0 ; for ( int r1 = 0 ; r1 < transformed . size ( ) ; r1 ++ ) { for ( int c = 0 ; c < transformed . get ( r1 ) . length ; c ++ ) { Atom refAtom = transformed . get ( r1 ) [ c ] ; if ( refAtom == null ) continue ; double nonNullSqDist = 0 ; int nonNullLength = 0 ; for ( int r2 = r...
public class JDBCStorageConnection { /** * Read property data without value data . For listChildPropertiesData ( NodeData ) . * @ param parentPath * - parent path * @ param item * database - ResultSet with Item record ( s ) * @ return PropertyData instance * @ throws RepositoryException * Repository error...
String cid = item . getString ( COLUMN_ID ) ; String cname = item . getString ( COLUMN_NAME ) ; int cversion = item . getInt ( COLUMN_VERSION ) ; String cpid = item . getString ( COLUMN_PARENTID ) ; int cptype = item . getInt ( COLUMN_PTYPE ) ; boolean cpmultivalued = item . getBoolean ( COLUMN_PMULTIVALUED ) ; try { I...
public class GosuParserFactory { /** * Creates an IGosuParser appropriate for parsing and executing Gosu . * @ param strSource The text of the the rule source * @ param symTable The symbol table the parser uses to parse and execute the rule * @ param scriptabilityConstraint Specifies the types of methods / proper...
return CommonServices . getGosuParserFactory ( ) . createParser ( strSource , symTable , scriptabilityConstraint ) ;
public class StreamEx { /** * Returns a { @ code Map < Boolean , C > } which contains two partitions of the * input elements according to a { @ code Predicate } . * This is a < a href = " package - summary . html # StreamOps " > terminal < / a > * operation . * There are no guarantees on the type , mutability ,...
return collect ( Collectors . partitioningBy ( predicate , Collectors . toCollection ( collectionFactory ) ) ) ;
public class RouteMatcher { /** * Specify a handler that will be called for all HTTP methods * @ param regex A regular expression * @ param handler The handler to call */ public RouteMatcher allWithRegEx ( String regex , Handler < HttpServerRequest > handler ) { } }
addRegEx ( regex , handler , getBindings ) ; addRegEx ( regex , handler , putBindings ) ; addRegEx ( regex , handler , postBindings ) ; addRegEx ( regex , handler , deleteBindings ) ; addRegEx ( regex , handler , optionsBindings ) ; addRegEx ( regex , handler , headBindings ) ; addRegEx ( regex , handler , traceBinding...
public class ExtractBlast { /** * Main . * @ param args command line args */ public static void main ( final String [ ] args ) { } }
Switch about = new Switch ( "a" , "about" , "display about message" ) ; Switch help = new Switch ( "h" , "help" , "display help message" ) ; IntegerArgument alleleCutoff = new IntegerArgument ( "c" , "allele-cutoff" , "allele cutoff value" , false ) ; StringArgument imgtHlaDb = new StringArgument ( "d" , "imgt-db-versi...
public class ParentEditController { @ Override public void onMouseDown ( MouseDownEvent event ) { } }
if ( controller != null ) { controller . onMouseDown ( event ) ; if ( ! controller . isBusy ( ) ) { panController . onMouseDown ( event ) ; } } else { panController . onMouseDown ( event ) ; }
public class PoolManager { /** * QuisceIfPossible should be called when a connection pool is no longer needed , * instead of directly calling quiesce ( ) . This method should be invoked the * first time by ConnectionFactoryDetailsImpl . stop ( ) . Subsequently it will * be invoked at the end of PoolManager . rele...
if ( tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "quiesceIfPossible" , _quiesce ) ; } if ( ! _quiesce ) { // only do this the first time we ' re called _quiesce = true ; _quiesceTime = new Date ( System . currentTimeMillis ( ) ) ; // Begin block copied from serverShutdown ( ) for ( int j = 0 ; j < maxFreePoolH...
public class ApkBuilder { /** * Adds the content from a zip file . * All file keep the same path inside the archive . * @ param zipFile the zip File . * @ throws ApkCreationException if an error occurred * @ throws SealedApkException if the APK is already sealed . * @ throws DuplicateFileException if a file c...
if ( mIsSealed ) { throw new SealedApkException ( "APK is already sealed" ) ; } try { verbosePrintln ( "%s:" , zipFile ) ; // reset the filter with this input . mNullFilter . reset ( zipFile ) ; // ask the builder to add the content of the file . FileInputStream fis = new FileInputStream ( zipFile ) ; mBuilder . writeZ...
public class SelectorRefresher { /** * Refreshable */ @ Override public void prepare ( FeatureProvider provider ) { } }
super . prepare ( provider ) ; collidable = provider . getFeature ( Collidable . class ) ;
public class SimpleRender { /** * Prints standard information about entry . * Example : * < pre > * = = = Algorithm MyAlgorithm used on problem Knapsack , settings default = = = * CPU Time : 16 [ ms ] * System Time : 0 [ ms ] * User Time : 15 [ ms ] * Clock Time : 31 [ ms ] * Optimize counter : 28 [ - ]...
PreciseTimestamp start = resultEntry . getStartTimestamp ( ) ; PreciseTimestamp stop = resultEntry . getStopTimestamp ( ) ; printStream . println ( ) ; printStream . printf ( "=== Algorithm %s used on problem %s ===\n" , resultEntry . getAlgorithm ( ) , resultEntry . getProblem ( ) ) ; printStream . printf ( " CPU Tim...
public class DefaultSwidProcessor { /** * Identifies the licensor of the software ( tag : software _ licensor ) . * @ param softwareLicensorName * software licensor name * @ param softwareLicensorRegId * software licensor registration ID * @ return a reference to this object . */ public DefaultSwidProcessor s...
swidTag . setSoftwareLicensor ( new EntityComplexType ( new Token ( softwareLicensorName , idGenerator . nextId ( ) ) , new RegistrationId ( softwareLicensorRegId , idGenerator . nextId ( ) ) , idGenerator . nextId ( ) ) ) ; return this ;
public class QueryAtomContainer { /** * Create a query from a molecule and a provided set of expressions . The * molecule is converted and any features specified in the { @ code opts } * will be matched . < br > < br > * A good starting point is the following options : * < pre > { @ code * / / [ nH ] 1ccc ( =...
Set < Expr . Type > optset = EnumSet . noneOf ( Expr . Type . class ) ; optset . addAll ( Arrays . asList ( opts ) ) ; QueryAtomContainer query = new QueryAtomContainer ( mol . getBuilder ( ) ) ; Map < IChemObject , IChemObject > mapping = new HashMap < > ( ) ; Map < IChemObject , IStereoElement > stereos = new HashMap...
public class CalendarParsedResult { /** * Parses a string as a date . RFC 2445 allows the start and end fields to be of type DATE ( e . g . 20081021) * or DATE - TIME ( e . g . 20081021T123000 for local time , or 20081021T123000Z for UTC ) . * @ param when The string to parse * @ throws ParseException if not able...
if ( ! DATE_TIME . matcher ( when ) . matches ( ) ) { throw new ParseException ( when , 0 ) ; } if ( when . length ( ) == 8 ) { // Show only year / month / day DateFormat format = new SimpleDateFormat ( "yyyyMMdd" , Locale . ENGLISH ) ; // For dates without a time , for purposes of interacting with Android , the result...
public class NgramExtractor { /** * This is trying to be smart . * It also depends on script ( alphabet less than ideographic ) . * So I ' m not sure how good it really is . Just trying to prevent array copies . . . and for Latin it seems to work fine . */ private static int guessNumDistinctiveGrams ( int textLengt...
switch ( gramLength ) { case 1 : return Math . min ( 80 , textLength ) ; case 2 : if ( textLength < 40 ) return textLength ; if ( textLength < 100 ) return ( int ) ( textLength * 0.8 ) ; if ( textLength < 1000 ) return ( int ) ( textLength * 0.6 ) ; return ( int ) ( textLength * 0.5 ) ; case 3 : if ( textLength < 40 ) ...
public class ApiOvhDedicatedserver { /** * List the availability of dedicated server * REST : GET / dedicated / server / availabilities * @ param country [ required ] The subsidiary company where the availability is requested * @ param hardware [ required ] The kind of hardware which is requested * API beta */ ...
String qPath = "/dedicated/server/availabilities" ; StringBuilder sb = path ( qPath ) ; query ( sb , "country" , country ) ; query ( sb , "hardware" , hardware ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t17 ) ;
public class InheritanceTransformer { /** * Convenience method to reuse the super constructor . * @ param components * @ return a non - null collection */ static Collection < AbstractType > asList ( Collection < Component > components ) { } }
Collection < AbstractType > result = new ArrayList < AbstractType > ( ) ; result . addAll ( components ) ; return result ;
public class Wireframe { /** * Create a wire frame plot canvas . * @ param vertices a n - by - 2 or n - by - 3 array which are coordinates of n vertices . */ public static PlotCanvas plot ( double [ ] [ ] vertices , int [ ] [ ] edges ) { } }
double [ ] lowerBound = Math . colMin ( vertices ) ; double [ ] upperBound = Math . colMax ( vertices ) ; PlotCanvas canvas = new PlotCanvas ( lowerBound , upperBound ) ; Wireframe frame = new Wireframe ( vertices , edges ) ; canvas . add ( frame ) ; return canvas ;
public class StringUtil { /** * Note : copy rights : Google Guava . * Returns the longest string { @ code suffix } such that * { @ code a . toString ( ) . endsWith ( suffix ) & & b . toString ( ) . endsWith ( suffix ) } , * taking care not to split surrogate pairs . If { @ code a } and { @ code b } have * no co...
if ( N . isNullOrEmpty ( a ) || N . isNullOrEmpty ( b ) ) { return N . EMPTY_STRING ; } final int aLength = a . length ( ) ; final int bLength = b . length ( ) ; int maxSuffixLength = Math . min ( aLength , bLength ) ; int s = 0 ; while ( s < maxSuffixLength && a . charAt ( aLength - s - 1 ) == b . charAt ( bLength - s...
public class AbstractRemoteClient { /** * { @ inheritDoc } * @ throws InterruptedException { @ inheritDoc } * @ throws CouldNotPerformException { @ inheritDoc } */ @ Override public void activate ( final Object maintainer ) throws InterruptedException , CouldNotPerformException { } }
if ( ! isLocked ( ) || this . maintainer . equals ( maintainer ) ) { synchronized ( maintainerLock ) { unlock ( maintainer ) ; activate ( ) ; lock ( maintainer ) ; } } else { throw new VerificationFailedException ( "[" + maintainer + "] is not the current maintainer of this remote" ) ; }
public class BtcFormat { /** * Formats a bitcoin monetary value and returns an { @ link AttributedCharacterIterator } . * By iterating , you can examine what fields apply to each character . This can be useful * since a character may be part of more than one field , for example a grouping separator * that is also...
synchronized ( numberFormat ) { DecimalFormatSymbols anteSigns = numberFormat . getDecimalFormatSymbols ( ) ; BigDecimal units = denominateAndRound ( inSatoshis ( obj ) , minimumFractionDigits , decimalGroups ) ; List < Integer > anteDigits = setFormatterDigits ( numberFormat , units . scale ( ) , units . scale ( ) ) ;...
public class DeleteGatewayResponseRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteGatewayResponseRequest deleteGatewayResponseRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteGatewayResponseRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteGatewayResponseRequest . getRestApiId ( ) , RESTAPIID_BINDING ) ; protocolMarshaller . marshall ( deleteGatewayResponseRequest . getResponseType ( ) ,...
public class StringUtils { /** * If both string arguments are non - null , this method concatenates them with ' and ' . * If only one of the arguments is non - null , this method returns the non - null argument . * If both arguments are null , this method returns null . * @ param s1 The first string argument * ...
if ( s1 != null ) { return s2 == null ? s1 : s1 + " and " + s2 ; } else { return s2 ; }
public class AbstractEncoderProxy { /** * Creates a new instance of * { @ link org . apache . commons . codec . EncoderException } with given * { @ code message } and { @ code cause } . * @ param message the message * @ param cause the cause * @ return a new instance of * { @ link org . apache . commons . c...
try { return ENCODER_EXCEPTION . getConstructor ( String . class , Throwable . class ) . newInstance ( message , cause ) ; } catch ( final NoSuchMethodException nsme ) { throw new RuntimeException ( nsme ) ; } catch ( final InstantiationException ie ) { throw new RuntimeException ( ie ) ; } catch ( final IllegalAccessE...
public class StreamService { /** * Dynamic streaming play method . * The following properties are supported on the play options : * < pre > * streamName : String . The name of the stream to play or the new stream to switch to . * oldStreamName : String . The name of the initial stream that needs to be switched ...
log . debug ( "play2 options: {}" , playOptions . toString ( ) ) ; /* { streamName = streams / new . flv , oldStreamName = streams / old . flv , start = 0 , len = - 1 , offset = 12.195 , transition = switch } */ // get the transition type String transition = ( String ) playOptions . get ( "transition" ) ; String stre...
public class RootMetricContext { /** * Add a shutwon hook that first invokes { @ link # stopReporting ( ) } and then closes the { @ link RootMetricContext } . This * ensures all reporting started on the { @ link RootMetricContext } stops properly and any resources obtained by the * { @ link RootMetricContext } are ...
Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( ) { @ Override public void run ( ) { stopReporting ( ) ; try { close ( ) ; } catch ( IOException e ) { log . warn ( "Unable to close " + this . getClass ( ) . getCanonicalName ( ) , e ) ; } } } ) ;
public class TypeRegistry { /** * Process some type pattern objects from the supplied value . For example the value might be * ' com . foo . Bar , ! com . foo . Goo ' * @ param value string defining a comma separated list of type patterns * @ return list of TypePatterns */ private List < TypePattern > getPatterns...
if ( value == null ) { return Collections . emptyList ( ) ; } List < TypePattern > typePatterns = new ArrayList < TypePattern > ( ) ; StringTokenizer st = new StringTokenizer ( value , "," ) ; while ( st . hasMoreElements ( ) ) { String typepattern = st . nextToken ( ) ; TypePattern typePattern = null ; if ( typepatter...
public class ULocale { /** * < strong > [ icu ] < / strong > Returns a locale ' s script localized for display in the provided locale . * This is a cover for the ICU4C API . * @ param localeID the id of the locale whose script will be displayed * @ param displayLocaleID the id of the locale in which to display th...
return getDisplayScriptInContextInternal ( new ULocale ( localeID ) , new ULocale ( displayLocaleID ) ) ;
public class ProjectAnalyzer { /** * Converts the given file name of a class - file to the fully - qualified class name . * @ param fileName The file name ( e . g . a / package / AClass . class ) * @ return The fully - qualified class name ( e . g . a . package . AClass ) */ private static String toQualifiedClassNa...
final String replacedSeparators = fileName . replace ( File . separatorChar , '.' ) ; return replacedSeparators . substring ( 0 , replacedSeparators . length ( ) - ".class" . length ( ) ) ;
public class StringUtils { /** * Returns true if given source string start with target string ignore case * sensitive ; false otherwise . * @ param source string to be tested . * @ param target string to be tested . * @ return true if given source string start with target string ignore case * sensitive ; fals...
if ( source . startsWith ( target ) ) { return true ; } if ( source . length ( ) < target . length ( ) ) { return false ; } return source . substring ( 0 , target . length ( ) ) . equalsIgnoreCase ( target ) ;
public class CurveFittedDistanceCalculator { /** * Calculated the estimated distance in meters to the beacon based on a reference rssi at 1m * and the known actual rssi at the current location * @ param txPower * @ param rssi * @ return estimated distance */ @ Override public double calculateDistance ( int txPo...
if ( rssi == 0 ) { return - 1.0 ; // if we cannot determine accuracy , return - 1. } LogManager . d ( TAG , "calculating distance based on mRssi of %s and txPower of %s" , rssi , txPower ) ; double ratio = rssi * 1.0 / txPower ; double distance ; if ( ratio < 1.0 ) { distance = Math . pow ( ratio , 10 ) ; } else { dist...
public class HttpUrl { /** * Returns the entire path of this URL encoded for use in HTTP resource resolution . The returned * path will start with { @ code " / " } . * < p > < table summary = " " > * < tr > < th > URL < / th > < th > { @ code encodedPath ( ) } < / th > < / tr > * < tr > < td > { @ code http : /...
int pathStart = url . indexOf ( '/' , scheme . length ( ) + 3 ) ; // " : / / " . length ( ) = = 3. int pathEnd = delimiterOffset ( url , pathStart , url . length ( ) , "?#" ) ; return url . substring ( pathStart , pathEnd ) ;
public class DiscoveryUtils { /** * Get the ClassLoader from which implementor classes will be discovered and loaded . */ public static ClassLoader getClassLoader ( ) { } }
try { ClassLoader cl = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( cl != null ) return cl ; } catch ( SecurityException e ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Could not get thread context classloader." , e ) ; } } if ( _log . isTraceEnabled ( ) ) { _log . trace ( "Can't use thread co...
public class StyleUtils { /** * Set the feature row style ( icon or style ) into the marker options * @ param markerOptions marker options * @ param featureStyleExtension feature style extension * @ param featureRow feature row * @ param density display density : { @ link android . util . DisplayMetrics # densi...
return setFeatureStyle ( markerOptions , featureStyleExtension , featureRow , density , null ) ;
public class ConcurrentMultiCache { /** * Releases the specified item from the cache . If it is still in the persistent * store , it will be retrieved back into the cache on next query . Otherwise , * subsequent attempts to search for it in the cache will result in < code > null < / code > . * @ param item the it...
HashMap < String , Object > keys = getKeys ( item ) ; synchronized ( this ) { for ( String key : order ) { ConcurrentCache < Object , T > cache = caches . get ( key ) ; cache . remove ( keys . get ( key ) ) ; } }
public class TextUtils { /** * / * package */ static boolean doesNotNeedBidi ( char [ ] text , int start , int len ) { } }
for ( int i = start , e = i + len ; i < e ; i ++ ) { if ( text [ i ] >= FIRST_RIGHT_TO_LEFT ) { return false ; } } return true ;
public class Links { /** * Returns the list of links having the specified link - relation type . * If CURIs are used to shorten custom link - relation types , it is possible to either use expanded link - relation types , * or the CURI of the link - relation type . Using CURIs to retrieve links is not recommended , ...
final String curiedRel = curies . resolve ( rel ) ; if ( this . links . containsKey ( curiedRel ) ) { final Object links = this . links . get ( curiedRel ) ; return links instanceof List ? ( List < Link > ) links : singletonList ( ( Link ) links ) ; } else { return emptyList ( ) ; }
public class Firmata { /** * Remove a generic messageListener from the Firmata object which will stop the listener from responding to message * received events over the SerialPort . * @ param channel Integer channel to remove the listener from . * @ param messageClass Class indicating the message type to listen t...
removeListener ( channel , messageClass , messageListener ) ;
public class CmsSearchManager { /** * Returns < code > true < / code > if the index for the given name is a Lucene index , < code > false < / code > otherwise . < p > * @ param indexName the name of the index to check * @ return < code > true < / code > if the index for the given name is a Lucene index */ public st...
I_CmsSearchIndex i = OpenCms . getSearchManager ( ) . getIndex ( indexName ) ; return ( i instanceof CmsSearchIndex ) && ( ! ( i instanceof CmsSolrIndex ) ) ;
public class DescribeAccountAttributesResult { /** * A list of attributes assigned to an account . * @ return A list of attributes assigned to an account . */ public java . util . List < AccountAttribute > getAccountAttributes ( ) { } }
if ( accountAttributes == null ) { accountAttributes = new com . amazonaws . internal . SdkInternalList < AccountAttribute > ( ) ; } return accountAttributes ;
public class CreateServerRequest { /** * The IDs of subnets in which to launch the server EC2 instance . * Amazon EC2 - Classic customers : This field is required . All servers must run within a VPC . The VPC must have * " Auto Assign Public IP " enabled . * EC2 - VPC customers : This field is optional . If you d...
if ( subnetIds == null ) { this . subnetIds = null ; return ; } this . subnetIds = new java . util . ArrayList < String > ( subnetIds ) ;
public class FstInputOutput { /** * Deserializes a symbol map from an java . io . ObjectInput * @ param in the java . io . ObjectInput . It should be already be initialized by the caller . * @ return the deserialized symbol map */ public static MutableSymbolTable readStringMap ( ObjectInput in ) throws IOException ...
int mapSize = in . readInt ( ) ; MutableSymbolTable syms = new MutableSymbolTable ( ) ; for ( int i = 0 ; i < mapSize ; i ++ ) { String sym = in . readUTF ( ) ; int index = in . readInt ( ) ; syms . put ( sym , index ) ; } return syms ;
public class AmqpConfiguration { /** * Create AMQP handler service bean . * @ param rabbitTemplate * for converting messages * @ param amqpMessageDispatcherService * to sending events to DMF client * @ param controllerManagement * for target repo access * @ param entityFactory * to create entities * @...
return new AmqpMessageHandlerService ( rabbitTemplate , amqpMessageDispatcherService , controllerManagement , entityFactory ) ;
public class NumberFormatterBase { /** * Format a unit value . */ public void formatUnit ( UnitValue value , StringBuilder destination , UnitFormatOptions options ) { } }
BigDecimal n = value . amount ( ) ; boolean grouping = orDefault ( options . grouping ( ) , false ) ; NumberFormatContext ctx = new NumberFormatContext ( options , NumberFormatMode . DEFAULT ) ; NumberPattern numberPattern = select ( n , unitStandard ) ; ctx . set ( numberPattern ) ; BigDecimal q = ctx . adjust ( n ) ;...
public class PathImpl { /** * Returns true for windows security issues . */ public boolean isWindowsInsecure ( ) { } }
String lower = getPath ( ) . toLowerCase ( Locale . ENGLISH ) ; int lastCh ; if ( ( lastCh = lower . charAt ( lower . length ( ) - 1 ) ) == '.' || lastCh == ' ' || lastCh == '*' || lastCh == '?' || ( ( lastCh == '/' || lastCh == '\\' ) && ! isDirectory ( ) ) || lower . endsWith ( "::$data" ) || isWindowsSpecial ( lower...
public class AnycastOutputHandler { /** * Callback when the Item that records that flush has been started has been committed to persistent storage * @ param stream The stream making this call * @ param startedFlushItem The item written */ public final void writtenStartedFlush ( AOStream stream , Item startedFlushIt...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "writtenStartedFlush" ) ; String key = SIMPUtils . getRemoteGetKey ( stream . getRemoteMEUuid ( ) , stream . getGatheringTargetDestUuid ( ) ) ; StreamInfo sinfo = streamTable . get ( key ) ; if ( ( sinfo != null ) && sinfo ....
public class Polarizability { /** * calculate effective atom polarizability . * @ param atomContainer IAtomContainer * @ param atom atom for which effective atom polarizability should be calculated * @ param addExplicitH if set to true , then explicit H ' s will be added , otherwise it assumes that they have * ...
double polarizabilitiy = 0 ; IAtomContainer acH ; if ( addExplicitH ) { acH = atomContainer . getBuilder ( ) . newInstance ( IAtomContainer . class , atomContainer ) ; addExplicitHydrogens ( acH ) ; } else { acH = atomContainer ; } double bond ; polarizabilitiy += getKJPolarizabilityFactor ( acH , atom ) ; for ( int i ...
public class IfcOrganizationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcPersonAndOrganization > getEngages ( ) { } }
return ( EList < IfcPersonAndOrganization > ) eGet ( Ifc2x3tc1Package . Literals . IFC_ORGANIZATION__ENGAGES , true ) ;
public class MiniSatBackbone { /** * Tests the given literal whether it is unit in the given clause . * @ param lit literal to test * @ param clause clause containing the literal * @ return { @ code true } if the literal is unit , { @ code false } otherwise */ private boolean isUnit ( final int lit , final MSClau...
for ( int i = 0 ; i < clause . size ( ) ; ++ i ) { final int clauseLit = clause . get ( i ) ; if ( lit != clauseLit && this . model . get ( var ( clauseLit ) ) != sign ( clauseLit ) ) { return false ; } } return true ;
public class EmojiParser { /** * Returns end index of a unicode emoji if it is found in text starting at * index startPos , - 1 if not found . * This returns the longest matching emoji , for example , in * " \ uD83D \ uDC68 \ u200D \ uD83D \ uDC69 \ u200D \ uD83D \ uDC66" * it will find alias : family _ man _ w...
int best = - 1 ; for ( int j = startPos + 1 ; j <= text . length ; j ++ ) { EmojiTrie . Matches status = EmojiManager . isEmoji ( Arrays . copyOfRange ( text , startPos , j ) ) ; if ( status . exactMatch ( ) ) { best = j ; } else if ( status . impossibleMatch ( ) ) { return best ; } } return best ;