signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class BufferNeeds { /** * This method considers the various factors of the specified output size * ( in blocks ) , and returns the highest factor that is less than the number * of available buffers . * @ param size * the size of the output file * @ param tx * the tx to execute * @ return the highes...
int avail = tx . bufferMgr ( ) . available ( ) ; if ( avail <= 1 ) return 1 ; long k = size ; double i = 1.0 ; while ( k > avail ) { i ++ ; k = ( int ) Math . ceil ( size / i ) ; } return ( int ) k ;
public class CommerceVirtualOrderItemLocalServiceBaseImpl { /** * Returns a range of commerce virtual order items matching the UUID and company . * @ param uuid the UUID of the commerce virtual order items * @ param companyId the primary key of the company * @ param start the lower bound of the range of commerce ...
return commerceVirtualOrderItemPersistence . findByUuid_C ( uuid , companyId , start , end , orderByComparator ) ;
public class AT_Row { /** * Sets the left padding for all cells in the row . * @ param paddingLeft new padding , ignored if smaller than 0 * @ return this to allow chaining */ public AT_Row setPaddingLeft ( int paddingLeft ) { } }
if ( this . hasCells ( ) ) { for ( AT_Cell cell : this . getCells ( ) ) { cell . getContext ( ) . setPaddingLeft ( paddingLeft ) ; } } return this ;
public class ErfcStddevWeight { /** * Return Erfc weight , scaled by standard deviation . max is ignored . */ @ Override public double getWeight ( double distance , double max , double stddev ) { } }
if ( stddev <= 0 ) { return 1 ; } return NormalDistribution . erfc ( MathUtil . SQRTHALF * distance / stddev ) ;
public class User { /** * Gets the { @ link User } object representing the supplied { @ link Authentication } or * { @ code null } if the supplied { @ link Authentication } is either anonymous or { @ code null } * @ param a the supplied { @ link Authentication } . * @ return a { @ link User } object for the suppl...
if ( a == null || a instanceof AnonymousAuthenticationToken ) return null ; // Since we already know this is a name , we can just call getOrCreateById with the name directly . return getById ( a . getName ( ) , true ) ;
public class RequestTools { /** * This method is used to get a serialized object into its equivalent JSON representation . * @ param object * { @ code Object } the body object . * @ param contentType * { @ ContentType } the content type header . * @ return { @ code String } */ String getBody ( Object object ,...
if ( contentType == ContentType . APPLICATION_FORM_URLENCODED ) { return jsonToUrlEncodedString ( ( JsonObject ) new JsonParser ( ) . parse ( gson . toJson ( object ) ) ) ; } return gson . toJson ( object ) ;
public class YUIErrorReporter { /** * Creates an EvaluatorException that will be thrown by Rhino . * @ param message * a String describing the error * @ param sourceName * a String describing the JavaScript source where the error * occured ; typically a filename or URL * @ param line * the line number ass...
StringBuilder errorMsg = new StringBuilder ( "YUI failed to minify the bundle with id: '" + status . getCurrentBundle ( ) . getId ( ) + "'.\n" ) ; errorMsg . append ( "YUI error message(s):[" ) . append ( this . yuiErrorMessage ) . append ( "]\n" ) ; errorMsg . append ( "The error happened at this point in your javascr...
public class AnnotationTypeFieldWriterImpl { /** * { @ inheritDoc } */ protected void addNavDetailLink ( boolean link , Content liNav ) { } }
if ( link ) { liNav . addContent ( writer . getHyperLink ( SectionName . ANNOTATION_TYPE_FIELD_DETAIL , contents . navField ) ) ; } else { liNav . addContent ( contents . navField ) ; }
public class ToolTipPopup { /** * Display this tool tip to the user */ public void show ( ) { } }
if ( mAnchorViewRef . get ( ) != null ) { mPopupContent = new PopupContentView ( mContext ) ; TextView body = ( TextView ) mPopupContent . findViewById ( R . id . com_facebook_tooltip_bubble_view_text_body ) ; body . setText ( mText ) ; if ( mStyle == Style . BLUE ) { mPopupContent . bodyFrame . setBackgroundResource (...
public class ContentSpecValidator { /** * Validate the Bug Links MetaData for a Content Specification . * @ param contentSpec The Content Spec to validate . * @ param strict If strict validation should be performed ( invalid matches throws an error instead of a warning ) * @ return True if the links are valid , o...
// If Bug Links are turned off then there isn ' t any need to validate them . if ( ! contentSpec . isInjectBugLinks ( ) ) { return true ; } try { final BugLinkOptions bugOptions ; final BugLinkType type ; if ( contentSpec . getBugLinks ( ) . equals ( BugLinkType . JIRA ) ) { type = BugLinkType . JIRA ; bugOptions = con...
public class ToStringStyle { /** * < p > Sets the content end text . < / p > * < p > < code > null < / code > is accepted , but will be converted to * an empty String . < / p > * @ param contentEnd the new content end text */ protected void setContentEnd ( String contentEnd ) { } }
if ( contentEnd == null ) { contentEnd = StringUtils . EMPTY ; } this . contentEnd = contentEnd ;
public class ManagedComponent { /** * Emits an alert for a caught Throwable through this manageable , entering the alert into a logger along the way . */ @ Override public < T extends Throwable > T emit ( T throwable , String message , long sequence , Logger logger ) { } }
message = message == null ? Throwables . getFullMessage ( throwable ) : message + ": " + Throwables . getFullMessage ( throwable ) ; emit ( Level . WARNING , message , sequence , logger ) ; return throwable ;
public class Matrix { /** * Validate the properties have the correct values . */ public final void postConstruct ( ) { } }
Assert . equals ( 2 , this . tileSize . length , "tileSize must have exactly 2 elements to the array. Was: " + Arrays . toString ( this . tileSize ) ) ; Assert . equals ( 2 , this . topLeftCorner . length , "topLeftCorner must have exactly 2 elements to the array. Was: " + Arrays . toString ( this . topLeftCorner ) )...
public class ManagementClientImpl { /** * / * ( non - Javadoc ) * @ see tuwien . auto . calimero . mgmt . ManagementClient # writeAddress * ( byte [ ] , tuwien . auto . calimero . IndividualAddress ) */ public void writeAddress ( byte [ ] serialNo , IndividualAddress newAddress ) throws KNXTimeoutException , KNXLin...
if ( serialNo . length != 6 ) throw new KNXIllegalArgumentException ( "length of serial number not 6 bytes" ) ; final byte [ ] asdu = new byte [ 12 ] ; for ( int i = 0 ; i < 6 ; ++ i ) asdu [ i ] = serialNo [ i ] ; asdu [ 6 ] = ( byte ) ( newAddress . getRawAddress ( ) >>> 8 ) ; asdu [ 7 ] = ( byte ) newAddress . getRa...
public class DateTimeExtensions { /** * Returns a { @ link java . time . LocalDateTime } of this time and the provided { @ link java . time . LocalDate } . * @ param self a LocalTime * @ param date a LocalDate * @ return a LocalDateTime * @ since 2.5.0 */ public static LocalDateTime leftShift ( final LocalTime ...
return LocalDateTime . of ( date , self ) ;
public class KTypeHashSet { /** * Adds all elements from the given iterable to this set . * @ return Returns the number of elements actually added as a result of this * call ( not previously present in the set ) . */ public int addAll ( Iterable < ? extends KTypeCursor < ? extends KType > > iterable ) { } }
int count = 0 ; for ( KTypeCursor < ? extends KType > cursor : iterable ) { if ( add ( cursor . value ) ) { count ++ ; } } return count ;
public class CloudWatchDestination { /** * A list of dimensions upon which to categorize your emails when you publish email sending events to Amazon * CloudWatch . * @ return A list of dimensions upon which to categorize your emails when you publish email sending events to Amazon * CloudWatch . */ public java . u...
if ( dimensionConfigurations == null ) { dimensionConfigurations = new com . amazonaws . internal . SdkInternalList < CloudWatchDimensionConfiguration > ( ) ; } return dimensionConfigurations ;
public class SSLChannel { /** * @ see com . ibm . wsspi . channelfw . Channel # start ( ) */ @ Override public void start ( ) throws ChannelException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "start" ) ; } stop0Called = false ; try { // If this is an inbound channel , we can pull out the listening host / port / endpointName . if ( getConfig ( ) . isInbound ( ) ) { // Get access to the ChainData object for future u...
public class ShardingEncryptorStrategy { /** * Get assisted query column count . * @ param logicTableName logic table name * @ return assisted query column count */ public Integer getAssistedQueryColumnCount ( final String logicTableName ) { } }
if ( Collections2 . filter ( columns , new Predicate < ColumnNode > ( ) { @ Override public boolean apply ( final ColumnNode input ) { return input . getTableName ( ) . equals ( logicTableName ) ; } } ) . isEmpty ( ) ) { return 0 ; } return Collections2 . filter ( assistedQueryColumns , new Predicate < ColumnNode > ( )...
public class MSPDIReader { /** * This method extracts data for a normal working day from an MSPDI file . * @ param calendar Calendar data * @ param weekDay Day data */ private void readNormalDay ( ProjectCalendar calendar , Project . Calendars . Calendar . WeekDays . WeekDay weekDay ) { } }
int dayNumber = weekDay . getDayType ( ) . intValue ( ) ; Day day = Day . getInstance ( dayNumber ) ; calendar . setWorkingDay ( day , BooleanHelper . getBoolean ( weekDay . isDayWorking ( ) ) ) ; ProjectCalendarHours hours = calendar . addCalendarHours ( day ) ; Project . Calendars . Calendar . WeekDays . WeekDay . Wo...
public class Drawable { /** * Set the DPI to use . Computed automatically depending of the baseline resolution and the current configuration . * Resources has to be suffixed with " _ DPI " before the extension . * For example , baseline resources is " image . png " , support for other DPI will need : * < ul > *...
Check . notNull ( baseline ) ; Check . notNull ( config ) ; setDpi ( DpiType . from ( baseline , config . getOutput ( ) ) ) ;
public class HiggsBosonDemo { /** * Overriding this to weed out the - 999.0 values in the dataset */ @ Override public void addToMap ( Map < String , String > properties , Map < String , List < Float > > rawHistogramData ) { } }
// System . out . println ( Arrays . toString ( properties . entrySet ( ) . toArray ( ) ) ) ; 0 for ( Entry < String , String > entrySet : properties . entrySet ( ) ) { String key = entrySet . getKey ( ) ; String value = entrySet . getValue ( ) ; try { Float floatValue = Float . parseFloat ( value ) ; if ( floatValue >...
public class CreateBranchRequest { /** * Tag for the branch . * @ param tags * Tag for the branch . * @ return Returns a reference to this object so that method calls can be chained together . */ public CreateBranchRequest withTags ( java . util . Map < String , String > tags ) { } }
setTags ( tags ) ; return this ;
public class Smb2NegotiateRequest { /** * { @ inheritDoc } * @ see jcifs . internal . smb2 . ServerMessageBlock2 # writeBytesWireFormat ( byte [ ] , int ) */ @ Override protected int writeBytesWireFormat ( byte [ ] dst , int dstIndex ) { } }
int start = dstIndex ; SMBUtil . writeInt2 ( 36 , dst , dstIndex ) ; SMBUtil . writeInt2 ( this . dialects . length , dst , dstIndex + 2 ) ; dstIndex += 4 ; SMBUtil . writeInt2 ( this . securityMode , dst , dstIndex ) ; SMBUtil . writeInt2 ( 0 , dst , dstIndex + 2 ) ; // Reserved dstIndex += 4 ; SMBUtil . writeInt4 ( t...
public class QueryBuilder { /** * Get the QAbstractValue for a value . * @ param _ value value the QAbstractValue is wanted for * @ return QAbstractValue * @ throws EFapsException on error */ private AbstractQValue getValue ( final Object _value ) throws EFapsException { } }
AbstractQValue ret = null ; if ( _value == null ) { ret = new QNullValue ( ) ; } else if ( _value instanceof Number ) { ret = new QNumberValue ( ( Number ) _value ) ; } else if ( _value instanceof String ) { ret = new QStringValue ( ( String ) _value ) ; } else if ( _value instanceof DateTime ) { ret = new QDateTimeVal...
public class NodeImpl { /** * { @ inheritDoc } */ public void checkout ( ) throws RepositoryException , UnsupportedRepositoryOperationException { } }
checkValid ( ) ; if ( ! session . getAccessManager ( ) . hasPermission ( getACL ( ) , new String [ ] { PermissionType . SET_PROPERTY } , session . getUserState ( ) . getIdentity ( ) ) ) { throw new AccessDeniedException ( "Access denied: checkout operation " + getPath ( ) + " for: " + session . getUserID ( ) + " item o...
public class MoleculeBuilder { /** * Builds the main chain which may act as a foundation for futher working groups . * @ param mainChain The parsed prefix which depicts the chain ' s length . * @ param isMainCyclic A flag to show if the molecule is a ring . 0 means not a ring , 1 means is a ring . * @ return A Mo...
IAtomContainer currentChain ; if ( length > 0 ) { // If is cyclic if ( isMainCyclic ) { // Rely on CDK ' s ring class constructor to generate our cyclic molecules . currentChain = currentMolecule . getBuilder ( ) . newInstance ( IAtomContainer . class ) ; currentChain . add ( currentMolecule . getBuilder ( ) . newInsta...
public class ResponseCollector { /** * If you really must name the variable something other than ' serviceSummary ' , * you can override this method to retrieve its value . */ protected ServiceSummary getServiceSummary ( ) throws ActivityException { } }
ServiceSummary serviceSummary = ( ServiceSummary ) getVariableValue ( "serviceSummary" ) ; if ( serviceSummary == null ) throw new ActivityException ( "Missing variable: serviceSummary" ) ; return serviceSummary ;
public class DateTimePicker { /** * toStringPermissive , This returns a string representation of the values which are currently * stored in the date and time picker . If the last valid value of the date picker is null , then * this will return an empty string ( " " ) . If the last valid value of the time picker is ...
LocalDateTime dateTime = getDateTimePermissive ( ) ; String text = ( dateTime == null ) ? "" : dateTime . toString ( ) ; return text ;
public class CnvIbnIntegerToCv { /** * < p > Put Integer object to ColumnsValues without transformation . < / p > * @ param pAddParam additional params , e . g . version algorithm or * bean source class for generic converter that consume set of subtypes . * @ param pFrom from a Integer object * @ param pTo to C...
pTo . put ( pName , pFrom ) ;
public class PublicKeyEncryptor { /** * { @ inheritDoc } */ @ Override protected Cipher newCipher ( final PublicKey key , final String algorithm , final byte [ ] salt , final int iterationCount , final int operationMode ) throws NoSuchAlgorithmException , InvalidKeySpecException , NoSuchPaddingException , InvalidKeyExc...
final Cipher cipher = CipherFactory . newCipher ( algorithm ) ; cipher . init ( operationMode , key ) ; return cipher ;
public class AlluxioBlockStore { /** * Gets the total capacity of Alluxio ' s BlockStore . * @ return the capacity in bytes */ public long getCapacityBytes ( ) throws IOException { } }
try ( CloseableResource < BlockMasterClient > blockMasterClientResource = mContext . acquireBlockMasterClientResource ( ) ) { return blockMasterClientResource . get ( ) . getCapacityBytes ( ) ; }
public class SingletonTokenStream { /** * { @ inheritDoc } */ @ Override public void reset ( ) throws IOException { } }
consumed = false ; if ( termAttribute == null ) { termAttribute = addAttribute ( CharTermAttribute . class ) ; } if ( payloadAttribute == null ) { payloadAttribute = addAttribute ( PayloadAttribute . class ) ; }
public class Paging { /** * / * package */ List < HttpParameter > asPostParameterList ( char [ ] supportedParams , String perPageParamName ) { } }
java . util . List < HttpParameter > pagingParams = new ArrayList < HttpParameter > ( supportedParams . length ) ; addPostParameter ( supportedParams , 's' , pagingParams , "since_id" , getSinceId ( ) ) ; addPostParameter ( supportedParams , 'm' , pagingParams , "max_id" , getMaxId ( ) ) ; addPostParameter ( supportedP...
public class KriptonXmlContext { /** * / * ( non - Javadoc ) * @ see com . abubusoft . kripton . AbstractContext # createParser ( java . io . InputStream ) */ public XmlWrapperParser createParser ( InputStream inputStream ) { } }
try { return new XmlWrapperParser ( this , inputStream , getSupportedFormat ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new KriptonRuntimeException ( e ) ; }
public class VorbisStyleComments { /** * Returns all comments for a given tag , in * file order . Will return an empty list for * tags which aren ' t present . */ public List < String > getComments ( String tag ) { } }
List < String > c = comments . get ( normaliseTag ( tag ) ) ; if ( c == null ) { return new ArrayList < String > ( ) ; } else { return c ; }
public class RewriteGenderMsgsPass { /** * Helper to verify that a rewritten soy msg tree does not exceed the restriction on number of * total genders allowed ( 2 if includes plural , 3 otherwise ) . * @ param selectNode The select node to start searching from . * @ param depth The current depth of the select nod...
for ( int caseNum = 0 ; caseNum < selectNode . numChildren ( ) ; caseNum ++ ) { if ( selectNode . getChild ( caseNum ) . numChildren ( ) > 0 ) { StandaloneNode caseNodeChild = selectNode . getChild ( caseNum ) . getChild ( 0 ) ; // Plural cannot contain plurals or selects , so no need to recurse further . if ( caseNode...
public class ActionResourceImpl { /** * Publishes an API to the gateway . * @ param action */ private void publishApi ( ActionBean action ) throws ActionException { } }
if ( ! securityContext . hasPermission ( PermissionType . apiAdmin , action . getOrganizationId ( ) ) ) throw ExceptionFactory . notAuthorizedException ( ) ; ApiVersionBean versionBean ; try { versionBean = orgs . getApiVersion ( action . getOrganizationId ( ) , action . getEntityId ( ) , action . getEntityVersion ( ) ...
public class RedisCache { /** * 获得byte [ ] 型的key * @ param key * @ return */ private byte [ ] getByteKey ( K key ) { } }
if ( key instanceof String ) { String preKey = this . keyPrefix + key ; return preKey . getBytes ( ) ; } else { return SerializeUtils . serialize ( key ) ; }
public class DeleteJobExecutionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteJobExecutionRequest deleteJobExecutionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteJobExecutionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteJobExecutionRequest . getJobId ( ) , JOBID_BINDING ) ; protocolMarshaller . marshall ( deleteJobExecutionRequest . getThingName ( ) , THINGNAME_BINDING )...
public class Page { /** * Add content to a named sections . If the named section cannot . * be found , the content is added to the page . */ public void addTo ( String section , Object element ) { } }
Composite s = ( Composite ) sections . get ( section ) ; if ( s == null ) add ( element ) ; else s . add ( element ) ;
public class LdapConfiguration { /** * Add an authentication filter that requires a certain LDAP role to access secured paths . * All routes starting with the value of the { @ code edison . ldap . prefixes } property will be secured by LDAP . * If no property is set this will default to all routes starting with ' /...
FilterRegistrationBean < LdapRoleAuthenticationFilter > filterRegistration = new FilterRegistrationBean < > ( ) ; filterRegistration . setFilter ( new LdapRoleAuthenticationFilter ( ldapProperties ) ) ; filterRegistration . setOrder ( Ordered . LOWEST_PRECEDENCE ) ; ldapProperties . getPrefixes ( ) . forEach ( prefix -...
public class AssessmentTemplate { /** * The rules packages that are specified for this assessment template . * @ param rulesPackageArns * The rules packages that are specified for this assessment template . */ public void setRulesPackageArns ( java . util . Collection < String > rulesPackageArns ) { } }
if ( rulesPackageArns == null ) { this . rulesPackageArns = null ; return ; } this . rulesPackageArns = new java . util . ArrayList < String > ( rulesPackageArns ) ;
public class ElevationApi { /** * Retrieves the elevation of a single location . * @ param context The { @ link GeoApiContext } to make requests through . * @ param location The location to retrieve the elevation for . * @ return The elevation as a { @ link PendingResult } . */ public static PendingResult < Eleva...
return context . get ( API_CONFIG , SingularResponse . class , "locations" , location . toString ( ) ) ;
public class ChannelFrameworkImpl { /** * @ see com . ibm . wsspi . channelfw . ChannelFramework # startChain ( String ) */ @ Override public synchronized void startChain ( String chainName ) throws ChannelException , ChainException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "startChain: " + chainName ) ; } if ( null == chainName ) { throw new InvalidChainNameException ( "Null chain name" ) ; } // Get the chain configuration ChainData chainData = this . chainDataMap . get ( chainName ) ; if ( nul...
public class WorkWrapper { /** * Calls listener if setup failed * @ param listener work context listener */ private void fireWorkContextSetupFailed ( Object workContext ) { } }
if ( workContext != null && workContext instanceof WorkContextLifecycleListener ) { if ( trace ) log . tracef ( "WorkContextSetupFailed(%s) for %s" , workContext , this ) ; WorkContextLifecycleListener listener = ( WorkContextLifecycleListener ) workContext ; listener . contextSetupFailed ( WorkContextErrorCodes . CONT...
public class SSLWriteServiceContext { /** * Check the status of the buffers set by the caller taking into account * the JITAllocation size if the buffers are null or verifying there is * space available in the the buffers based on the size of data requested . * @ param numBytes * @ param async * @ return IOEx...
IOException exception = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "checkForErrors: numBytes=" + numBytes + " buffers=" + SSLUtils . getBufferTraceInfo ( getBuffers ( ) ) ) ; } // Extract the buffers provided by the calling channel . WsByteBuffer callerBuffers ...
public class DatabaseManager { /** * loosecannon1 @ users 1.7.2 patch properties on the JDBC URL */ private static synchronized Database getDatabaseObject ( String type , String path , HsqlProperties props ) { } }
Database db ; String key = path ; // A VoltDB extension to work around ENG - 6044 /* disable 13 lines . . . HashMap databaseMap ; if ( type = = DatabaseURL . S _ FILE ) { databaseMap = fileDatabaseMap ; key = filePathToKey ( path ) ; } else if ( type = = DatabaseURL . S _ RES ) { databaseMap = resDatabaseMa...
public class JCusparse { /** * Description : Wrapper that sorts sparse matrix stored in CSR format * ( without exposing the permutation ) . */ public static int cusparseScsru2csr_bufferSizeExt ( cusparseHandle handle , int m , int n , int nnz , Pointer csrVal , Pointer csrRowPtr , Pointer csrColInd , csru2csrInfo inf...
return checkResult ( cusparseScsru2csr_bufferSizeExtNative ( handle , m , n , nnz , csrVal , csrRowPtr , csrColInd , info , pBufferSizeInBytes ) ) ;
public class LogFileHandle { /** * Get a new WritableLogRecord for the log file managed by this LogFileHandleInstance . * The size of the record must be specified along with the record ' s sequence number . * It is the caller ' s responsbility to ensure that both the sequence number is correct * and that the reco...
if ( ! _headerFlushedFollowingRestart ) { // ensure header is updated now we start to write records for the first time // synchronization is assured through locks in LogHandle . getWriteableLogRecord writeFileHeader ( true ) ; _headerFlushedFollowingRestart = true ; } if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "g...
public class CmsPreviewDialog { /** * Generates the dialog caption . < p > * @ param previewInfo the preview info * @ return the caption */ private static String generateCaption ( CmsPreviewInfo previewInfo ) { } }
return ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( previewInfo . getTitle ( ) ) ? previewInfo . getTitle ( ) + " / " : "" ) + previewInfo . getSitePath ( ) ;
public class HttpResourceConnection { /** * Retrieves the resource identified by the given URL and returns the * InputStream . * @ param url the URL of the resource to download * @ return the stream to read the retrieved content from * @ throws org . owasp . dependencycheck . utils . DownloadFailedException is ...
if ( "file" . equalsIgnoreCase ( url . getProtocol ( ) ) ) { final File file ; try { file = new File ( url . toURI ( ) ) ; } catch ( URISyntaxException ex ) { final String msg = format ( "Download failed, unable to locate '%s'" , url . toString ( ) ) ; throw new DownloadFailedException ( msg ) ; } if ( file . exists ( ...
public class TagFileScanVisitor { /** * new method for jsp2.1ELwork */ private String checkConflict ( Element elem , String oldAttrValue , String attr ) throws JspCoreException { } }
String result = oldAttrValue ; String attrValue = null ; if ( elem . getAttributeNode ( attr ) != null ) { attrValue = elem . getAttributeNode ( attr ) . getValue ( ) ; } if ( attrValue != null ) { if ( oldAttrValue != null && ! oldAttrValue . equals ( attrValue ) ) { throw new JspTranslationException ( elem , "jsp.err...
public class XSLTElementDef { /** * Tell if two objects are equal , when either one may be null . * If both are null , they are considered equal . * @ param obj1 A reference to the first object , or null . * @ param obj2 A reference to the second object , or null . * @ return true if the to objects are equal by...
return ( obj2 == obj1 ) || ( ( null != obj1 ) && ( null != obj2 ) && obj2 . equals ( obj1 ) ) ;
public class RtedAlgorithm { /** * Returns j for given i , result of j ( i ) form Demaine ' s algorithm . * @ param it * @ param aI * @ param aSubtreeWeight * @ param aSubtreeRevPre * @ param aSubtreePre * @ param aStrategy * @ param treeSize * @ return j for given i */ private int jOfI ( InfoTree it , ...
return aStrategy == LEFT ? aSubtreeWeight - aI - it . info [ POST2_SIZE ] [ treeSize - 1 - ( aSubtreeRevPre + aI ) ] : aSubtreeWeight - aI - it . info [ POST2_SIZE ] [ it . info [ RPOST2_POST ] [ treeSize - 1 - ( aSubtreePre + aI ) ] ] ;
public class Attribute { /** * Set an attribute in the COSE object . * Setting an attribute in one map will remove it from all other maps as a side effect . * @ param label CBOR object which identifies the attribute in the map * @ param value CBOR object which contains the value of the attribute * @ param where...
removeAttribute ( label ) ; if ( ( label . getType ( ) != CBORType . Number ) && ( label . getType ( ) != CBORType . TextString ) ) { throw new CoseException ( "Labels must be integers or strings" ) ; } switch ( where ) { case PROTECTED : if ( rgbProtected != null ) throw new CoseException ( "Cannot modify protected at...
public class RetrieveEnvironmentInfoResult { /** * The < a > EnvironmentInfoDescription < / a > of the environment . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setEnvironmentInfo ( java . util . Collection ) } or { @ link # withEnvironmentInfo ( java . u...
if ( this . environmentInfo == null ) { setEnvironmentInfo ( new com . amazonaws . internal . SdkInternalList < EnvironmentInfoDescription > ( environmentInfo . length ) ) ; } for ( EnvironmentInfoDescription ele : environmentInfo ) { this . environmentInfo . add ( ele ) ; } return this ;
public class PropositionUtil { /** * Filters a list of temporal propositions by time . * @ param params * a < code > List < / code > of propositions . * @ param minValid * @ param maxValid * @ return */ public static < T extends TemporalProposition > List < T > getView ( List < T > params , Long minValid , Lo...
if ( params != null ) { if ( minValid == null && maxValid == null ) { return params ; } else { int min = minValid != null ? binarySearchMinStart ( params , minValid . longValue ( ) ) : 0 ; int max = maxValid != null ? binarySearchMaxFinish ( params , maxValid . longValue ( ) ) : params . size ( ) ; return params . subL...
public class FileUtils { /** * Get a hash for a supplied file . * @ param aFile A file to get a hash for * @ param aAlgorithm A hash algorithm supported by < code > MessageDigest < / code > * @ return A hash string * @ throws NoSuchAlgorithmException If the supplied algorithm isn ' t supported * @ throws IOEx...
final MessageDigest md = MessageDigest . getInstance ( aAlgorithm ) ; final FileInputStream inStream = new FileInputStream ( aFile ) ; final DigestInputStream mdStream = new DigestInputStream ( inStream , md ) ; final byte [ ] bytes = new byte [ 8192 ] ; int bytesRead = 0 ; while ( bytesRead != - 1 ) { bytesRead = mdSt...
public class DefaultManagedConnectionPool { /** * { @ inheritDoc } */ public synchronized void shutdown ( ) { } }
if ( pool . getConfiguration ( ) . isBackgroundValidation ( ) && pool . getConfiguration ( ) . getBackgroundValidationMillis ( ) > 0 ) { ConnectionValidator . getInstance ( ) . unregisterPool ( this ) ; } if ( pool . getConfiguration ( ) . getIdleTimeoutMinutes ( ) > 0 ) { IdleConnectionRemover . getInstance ( ) . unre...
public class BaseApplet { /** * Set the help pane . * @ return the help pane . */ public void setHelpView ( JBaseHtmlEditor helpEditor ) { } }
if ( m_helpEditor != null ) m_helpEditor . setCallingApplet ( null ) ; m_helpEditor = helpEditor ; if ( m_helpEditor != null ) m_helpEditor . setCallingApplet ( this ) ;
public class Track { /** * Register webhook for tracking shipment of a package . This corresponds to * API defined in https : / / goshippo . com / docs / reference # tracks - create . Please * note that the webhook where information will be posted need to be already * provided in https : / / app . goshippo . com ...
Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( "carrier" , carrier ) ; params . put ( "tracking_number" , trackingNumber ) ; params . put ( "metadata" , metadata ) ; return request ( RequestMethod . POST , classURLWithTrailingSlash ( Track . class ) , params , Track . class , apiK...
public class VoiceApi { /** * Reconnect the specified call . This releases the established call and retrieves the held call * in one step . This is a quick way to to do ` releaseCall ( ) ` and ` retrieveCall ( ) ` . * @ param connId The connection ID of the established call ( will be released ) . * @ param heldCo...
try { VoicecallsidreconnectData reconnectData = new VoicecallsidreconnectData ( ) ; reconnectData . setHeldConnId ( heldConnId ) ; reconnectData . setReasons ( Util . toKVList ( reasons ) ) ; reconnectData . setExtensions ( Util . toKVList ( extensions ) ) ; ReconnectData data = new ReconnectData ( ) ; data . data ( re...
public class EventFilterMarshaller { /** * Marshall the given parameter object . */ public void marshall ( EventFilter eventFilter , ProtocolMarshaller protocolMarshaller ) { } }
if ( eventFilter == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( eventFilter . getEventArns ( ) , EVENTARNS_BINDING ) ; protocolMarshaller . marshall ( eventFilter . getEventTypeCodes ( ) , EVENTTYPECODES_BINDING ) ; protocolMarshaller . ...
public class DrawerView { /** * Removes a fixed item from the drawer view * @ param id ID to remove */ public DrawerView removeFixedItemById ( long id ) { } }
for ( DrawerItem item : mAdapterFixed . getItems ( ) ) { if ( item . getId ( ) == id ) { mAdapterFixed . remove ( item ) ; updateFixedList ( ) ; return this ; } } return this ;
public class PaymentKit { /** * HmacSHA256 签名 * @ param stringSignTemp * @ param partnerKey * @ return * @ throws Exception */ public static String hmacSHA256 ( String stringSignTemp , String partnerKey ) throws UnsupportedEncodingException , NoSuchAlgorithmException , InvalidKeyException { } }
Mac sha256_HMAC = Mac . getInstance ( "HmacSHA256" ) ; SecretKeySpec secret_key = new SecretKeySpec ( partnerKey . getBytes ( ) , "HmacSHA256" ) ; sha256_HMAC . init ( secret_key ) ; return byteArrayToHexString ( sha256_HMAC . doFinal ( stringSignTemp . getBytes ( "utf-8" ) ) ) ;
public class SqlLineHighlighter { /** * Marks numbers position based on input . * < p > Assumes that a number starts at the specified position , * i . e . { @ code Character . isDigit ( line . charAt ( startingPoint ) ) = = true } * @ param line Line where to handle number string * @ param numberBitSet BitSet t...
int end = startingPoint + 1 ; while ( end < line . length ( ) && Character . isDigit ( line . charAt ( end ) ) ) { end ++ ; } if ( end == line . length ( ) ) { if ( Character . isDigit ( line . charAt ( line . length ( ) - 1 ) ) ) { numberBitSet . set ( startingPoint , end ) ; } } else if ( Character . isWhitespace ( l...
public class JmsMsgProducerImpl { /** * This method carries out validation on the priority field . * @ param x */ private void validatePriority ( int x ) throws JMSException { } }
// Priority must be in the range 0-9 if ( ( x < 0 ) || ( x > 9 ) ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "INVALID_VALUE_CWSIA0068" , new Object [ ] { "JMSPriority" , "" + x } , tc ) ; }
public class GraniteUiSyntheticResource { /** * Copy the given source resource as synthetic child under the target parent resource , including all children . * @ param targetParent Target parent resource * @ param source Source resource */ public static void copySubtree ( @ NotNull Resource targetParent , @ NotNull...
Resource targetChild = GraniteUiSyntheticResource . child ( targetParent , source . getName ( ) , source . getResourceType ( ) , source . getValueMap ( ) ) ; for ( Resource sourceChild : source . getChildren ( ) ) { copySubtree ( targetChild , sourceChild ) ; }
public class ImplColorHsv { /** * Converts an image from RGB into HSV . Pixels must have a value within the range of [ 0,1 ] . * @ param rgb ( Input ) Image in RGB format * @ param hsv ( Output ) Image in HSV format */ public static void rgbToHsv_F32 ( Planar < GrayF32 > rgb , Planar < GrayF32 > hsv ) { } }
GrayF32 R = rgb . getBand ( 0 ) ; GrayF32 G = rgb . getBand ( 1 ) ; GrayF32 B = rgb . getBand ( 2 ) ; GrayF32 H = hsv . getBand ( 0 ) ; GrayF32 S = hsv . getBand ( 1 ) ; GrayF32 V = hsv . getBand ( 2 ) ; // CONCURRENT _ BELOW BoofConcurrency . loopFor ( 0 , hsv . height , row - > { for ( int row = 0 ; row < hsv . heigh...
public class MapUtils { /** * Transforms the values of the given Map with the specified Transformer . * @ param < K > Class type of the key . * @ param < V > Class type of the value . * @ param map { @ link Map } to transform . * @ param transformer { @ link Transformer } used to transform the { @ link Map } ' ...
Assert . notNull ( map , "Map is required" ) ; Assert . notNull ( transformer , "Transformer is required" ) ; return map . entrySet ( ) . stream ( ) . collect ( Collectors . toMap ( Map . Entry :: < K > getKey , ( entry ) -> transformer . transform ( entry . getValue ( ) ) ) ) ;
public class Base64Data { /** * Creates in instance from the given JSON object . * @ param jsonObj * Object to read values from . * @ return New instance . */ public static Base64Data create ( final JsonObject jsonObj ) { } }
final String base64Str = jsonObj . getString ( EL_ROOT_NAME ) ; return new Base64Data ( base64Str ) ;
public class CmsUserDriver { /** * Updates additional user info . < p > * @ param dbc the current dbc * @ param userId the user id to add the user info for * @ param key the name of the additional user info * @ param value the value of the additional user info * @ throws CmsDataAccessException if something go...
PreparedStatement stmt = null ; Connection conn = null ; try { conn = getSqlManager ( ) . getConnection ( dbc ) ; stmt = m_sqlManager . getPreparedStatement ( conn , "C_USERDATA_UPDATE_4" ) ; // write data to database m_sqlManager . setBytes ( stmt , 1 , CmsDataTypeUtil . dataSerialize ( value ) ) ; stmt . setString ( ...
public class ObjectTreeParser { /** * Find a field in a class by it ' s name . Note that this method is * only needed because the general reflection method is case * sensitive * @ param clazz The clazz to search * @ param name The name of the field to search for * @ return The field or null if none could be l...
Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { if ( fields [ i ] . getName ( ) . equalsIgnoreCase ( name ) ) { if ( fields [ i ] . getType ( ) . isPrimitive ( ) ) { return fields [ i ] ; } if ( fields [ i ] . getType ( ) == String . class ) { return fields [ i ] ; } ...
public class DefaultBtrpOperand { /** * Pretty textual representation of a given element type . * @ param degree 0 for a literal , 1 for a set , 2 for a set of sets , . . . * @ param t the literal * @ return a String */ public static String prettyType ( int degree , Type t ) { } }
StringBuilder b = new StringBuilder ( ) ; for ( int i = degree ; i > 0 ; i -- ) { b . append ( "set<" ) ; } b . append ( t . toString ( ) . toLowerCase ( ) ) ; for ( int i = 0 ; i < degree ; i ++ ) { b . append ( ">" ) ; } return b . toString ( ) ;
public class CmsImageGalleryField { /** * Parses the value and all its informations . < p > * First part is the URL of the image . The second one describes the scale of this image . < p > * The last one sets the selected format . < p > * @ param value that should be parsed * @ return the URL of the image withou...
m_croppingParam = CmsCroppingParamBean . parseImagePath ( value ) ; String path = "" ; String params = "" ; if ( value . indexOf ( "?" ) > - 1 ) { path = value . substring ( 0 , value . indexOf ( "?" ) ) ; params = value . substring ( value . indexOf ( "?" ) ) ; } else { path = value ; } int indexofscale = params . ind...
public class PlanAssembler { /** * Given a relatively complete plan - sub - graph , apply a trivial projection * ( filter ) to it . If the root node can embed the projection do so . If not , * add a new projection node . * @ param rootNode * The root of the plan - sub - graph to add the projection to . * @ re...
assert ( m_parsedSelect != null ) ; assert ( m_parsedSelect . m_displayColumns != null ) ; // Build the output schema for the projection based on the display columns NodeSchema proj_schema = m_parsedSelect . getFinalProjectionSchema ( ) ; for ( SchemaColumn col : proj_schema ) { // Adjust the differentiator fields of T...
public class VaultsInner { /** * Gets information about the deleted vaults in a subscription . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; De...
return listDeletedNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < DeletedVaultInner > > , Page < DeletedVaultInner > > ( ) { @ Override public Page < DeletedVaultInner > call ( ServiceResponse < Page < DeletedVaultInner > > response ) { return response . body ( ) ; } } ) ;
public class CPDefinitionOptionRelPersistenceImpl { /** * Returns an ordered range of all the cp definition option rels where CPDefinitionId = & # 63 ; and skuContributor = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < co...
return findByC_SC ( CPDefinitionId , skuContributor , start , end , orderByComparator , true ) ;
public class AmazonCodeDeployClient { /** * For a blue / green deployment , starts the process of rerouting traffic from instances in the original environment * to instances in the replacement environment without waiting for a specified wait time to elapse . ( Traffic * rerouting , which is achieved by registering ...
request = beforeClientExecution ( request ) ; return executeContinueDeployment ( request ) ;
public class Rectangle { /** * Computes the membership function evaluated at ` x ` * @ param x * @ return ` \ begin { cases } 1h & \ mbox { if $ x \ in [ s , e ] $ } \ cr 0h & * \ mbox { otherwise } \ end { cases } ` * where ` h ` is the height of the Term , * ` s ` is the start of the Rectangle , * ` e ` i...
if ( Double . isNaN ( x ) ) { return Double . NaN ; } if ( Op . isGE ( x , start ) && Op . isLE ( x , end ) ) { return height * 1.0 ; } return height * 0.0 ;
public class ReportGenerator { /** * Determines the report file name based on the give output location and * format . If the output location contains a full file name that has the * correct extension for the given report type then the output location is * returned . However , if the output location is a directory...
File outFile = new File ( outputLocation ) ; if ( outFile . getParentFile ( ) == null ) { outFile = new File ( "." , outputLocation ) ; } final String pathToCheck = outputLocation . toLowerCase ( ) ; if ( format == Format . XML && ! pathToCheck . endsWith ( ".xml" ) ) { return new File ( outFile , "dependency-check-rep...
public class LifeCycleThread { public synchronized void start ( ) throws Exception { } }
if ( _running ) { log . debug ( "Already started" ) ; return ; } _running = true ; if ( _thread == null ) { _thread = new Thread ( this ) ; _thread . setDaemon ( _daemon ) ; } _thread . start ( ) ;
public class CFMLWriterImpl { /** * reset configuration of buffer * @ param bufferSize size of the buffer * @ param autoFlush does the buffer autoflush * @ throws IOException */ @ Override public void setBufferConfig ( int bufferSize , boolean autoFlush ) throws IOException { } }
this . bufferSize = bufferSize ; this . autoFlush = autoFlush ; _check ( ) ;
public class GmailAd { /** * Gets the productImages value for this GmailAd . * @ return productImages * Product images . Support up to 15 product images . * < span class = " constraint Selectable " > This field * can be selected using the value " ProductImages " . < / span > */ public com . google . api . ads . a...
return productImages ;
public class Matchers { /** * Matches a whitelisted method invocation that is known to never return null */ public static Matcher < ExpressionTree > methodReturnsNonNull ( ) { } }
return anyOf ( instanceMethod ( ) . onDescendantOf ( "java.lang.Object" ) . named ( "toString" ) , instanceMethod ( ) . onExactClass ( "java.lang.String" ) , staticMethod ( ) . onClass ( "java.lang.String" ) , instanceMethod ( ) . onExactClass ( "java.util.StringTokenizer" ) . named ( "nextToken" ) ) ;
public class MicroServiceTemplateSupport { /** * � � װ � � � � value � ַ � * @ param dbColMap � ύ � � � * @ param modelEntryMap � � � ģ � � * @ return * @ throws Exception */ public String createInsertValueStr4ModelEntry ( Map dbColMap0 , Map < String , MicroDbModelEntry > modelEntryMap ) { } }
if ( dbColMap0 == null ) { return null ; } // add 201902 ning Map dbColMap = new CaseInsensitiveKeyMap ( ) ; if ( dbColMap0 != null ) { dbColMap . putAll ( dbColMap0 ) ; } Cobj crealValues = Cutil . createCobj ( ) ; Map metaFlagMap = new TreeMap ( ) ; String tempDbType = calcuDbType ( ) ; Iterator it = dbColMap . keySe...
public class EntityListenersService { /** * Update all registered listeners of the entities * @ return Stream < Entity > */ Stream < Entity > updateEntities ( String repoFullName , Stream < Entity > entities ) { } }
lock . readLock ( ) . lock ( ) ; try { verifyRepoRegistered ( repoFullName ) ; SetMultimap < Object , EntityListener > entityListeners = this . entityListenersByRepo . get ( repoFullName ) ; return entities . filter ( entity -> { Set < EntityListener > entityEntityListeners = entityListeners . get ( entity . getIdValue...
public class UserGroupManager { /** * Delete the user group with the specified ID * @ param sUserGroupID * The ID of the user group to be deleted . May be < code > null < / code > . * @ return { @ link EChange # CHANGED } if the user group was deleted , * { @ link EChange # UNCHANGED } otherwise */ @ Nonnull pu...
if ( StringHelper . hasNoText ( sUserGroupID ) ) return EChange . UNCHANGED ; final UserGroup aDeletedUserGroup = getOfID ( sUserGroupID ) ; if ( aDeletedUserGroup == null ) { AuditHelper . onAuditDeleteFailure ( UserGroup . OT , "no-such-usergroup-id" , sUserGroupID ) ; return EChange . UNCHANGED ; } if ( aDeletedUser...
public class Deflater { /** * Resets deflater so that a new set of input data can be processed . * Keeps current compression level and strategy settings . */ public void reset ( ) { } }
synchronized ( zsRef ) { ensureOpen ( ) ; reset ( zsRef . address ( ) ) ; finish = false ; finished = false ; off = len = 0 ; bytesRead = bytesWritten = 0 ; }
public class CheckMethodAdapter { /** * Checks that the given string is a valid unqualified name . * @ param version * the class version . * @ param name * the string to be checked . * @ param msg * a message to be used in case of error . */ static void checkUnqualifiedName ( int version , final String name...
if ( ( version & 0xFFFF ) < Opcodes . V1_5 ) { checkIdentifier ( name , msg ) ; } else { for ( int i = 0 ; i < name . length ( ) ; ++ i ) { if ( ".;[/" . indexOf ( name . charAt ( i ) ) != - 1 ) { throw new IllegalArgumentException ( "Invalid " + msg + " (must be a valid unqualified name): " + name ) ; } } }
public class Header { /** * getter for language - gets The language of the document , O * @ generated * @ return value of the feature */ public String getLanguage ( ) { } }
if ( Header_Type . featOkTst && ( ( Header_Type ) jcasType ) . casFeat_language == null ) jcasType . jcas . throwFeatMissing ( "language" , "de.julielab.jules.types.Header" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Header_Type ) jcasType ) . casFeatCode_language ) ;
public class Parser { /** * 11.7 Shift Expression */ private ParseTree parseShiftExpression ( ) { } }
SourcePosition start = getTreeStartLocation ( ) ; ParseTree left = parseAdditiveExpression ( ) ; while ( peekShiftOperator ( ) ) { Token operator = nextToken ( ) ; ParseTree right = parseAdditiveExpression ( ) ; left = new BinaryOperatorTree ( getTreeLocation ( start ) , left , operator , right ) ; } return left ;
public class Spinner { /** * Obtains the color of the hint , which should be shown , when no item is selected , from a * specific typed array . * @ param typedArray * The typed array , the hint should be obtained from , as an instance of the class { @ link * TypedArray } . The typed array may not be null */ pri...
ColorStateList colors = typedArray . getColorStateList ( R . styleable . Spinner_android_textColorHint ) ; if ( colors == null ) { TypedArray styledAttributes = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( new int [ ] { android . R . attr . textColorSecondary } ) ; colors = ColorStateList . valueOf ( styled...
public class FormMappingOption { public FormMappingOption filterSimpleTextParameter ( FormSimpleTextParameterFilter filter ) { } }
if ( filter == null ) { throw new IllegalArgumentException ( "The argument 'filter' should not be null." ) ; } this . simpleTextParameterFilter = OptionalThing . of ( filter ) ; return this ;
public class CndImporter { /** * Parse the child node definition ' s attributes , if they appear next on the token stream . * @ param tokens the tokens containing the attributes ; never null * @ param childDefn the child node definition ; never null * @ param nodeType the node type being created ; never null * ...
boolean autoCreated = false ; boolean mandatory = false ; boolean isProtected = false ; boolean sns = false ; String onParentVersion = "COPY" ; while ( true ) { if ( tokens . canConsumeAnyOf ( "AUTOCREATED" , "AUT" , "A" ) ) { tokens . canConsume ( '?' ) ; autoCreated = true ; } else if ( tokens . canConsumeAnyOf ( "MA...
public class DatabaseUtils { /** * Concatenates two SQL WHERE clauses , handling empty or null values . */ public static String concatenateWhere ( String a , String b ) { } }
if ( TextUtils . isEmpty ( a ) ) { return b ; } if ( TextUtils . isEmpty ( b ) ) { return a ; } return "(" + a + ") AND (" + b + ")" ;
public class OWLValueObject { /** * Builds an instance * @ param model * @ param value * @ return * @ throws NotYetImplementedException * @ throws OWLTranslationException */ public static OWLValueObject buildFromOWLValue ( OWLModel model , OWLValue value ) throws NotYetImplementedException , OWLTranslationExc...
if ( value . isDataValue ( ) ) { return new OWLValueObject ( model , OWLURIClass . from ( value . castTo ( OWLDataValue . class ) . getValue ( ) ) , value ) ; } if ( value . isIndividual ( ) ) { try { if ( value instanceof OWLListImpl ) { OWLList < OWLIndividual > owlList = ( OWLListImpl ) value ; OWLURIClass owlURICla...
public class KMeansPlusPlusInitialMeans { /** * Initialize the weight list . * @ param weights Weight list * @ param ids IDs * @ param first Added ID * @ param distQ Distance query * @ return Weight sum */ static double initialWeights ( WritableDoubleDataStore weights , DBIDs ids , NumberVector first , Distan...
double weightsum = 0. ; for ( DBIDIter it = ids . iter ( ) ; it . valid ( ) ; it . advance ( ) ) { // Distance will usually already be squared double weight = distQ . distance ( first , it ) ; weights . putDouble ( it , weight ) ; weightsum += weight ; } return weightsum ;
public class NamespaceSpecification { /** * Check if this namespace specification competes with * another namespace specification . * @ param other The namespace specification we need to check if * it competes with this namespace specification . * @ return true if the namespace specifications compete . */ publi...
// if no wildcard for other then we check coverage if ( "" . equals ( other . wildcard ) ) { return covers ( other . ns ) ; } // split the namespaces at wildcards String [ ] otherParts = split ( other . ns , other . wildcard ) ; // if the given namepsace specification does not use its wildcard // then we just look if t...