signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class PdfPRow { /** * Initializes the extra heights array . * @ since2.1.6 */ public void initExtraHeights ( ) { } }
extraHeights = new float [ cells . length ] ; for ( int i = 0 ; i < extraHeights . length ; i ++ ) { extraHeights [ i ] = 0 ; }
public class CoverageUtilities { /** * Simple method to get a value from a single band raster . * < p > Note that this method does always return a value . If invalid , a novalue is returned . < / p > * @ param raster * @ param easting * @ param northing * @ return */ public static double getValue ( GridCovera...
double [ ] values = null ; try { values = raster . evaluate ( new Point2D . Double ( easting , northing ) , ( double [ ] ) null ) ; } catch ( Exception e ) { return doubleNovalue ; } return values [ 0 ] ;
public class ExchangeValues { /** * This function switches the values of two numbers . * Examples : * exchange _ values ( 10 , 20 ) - > ( 20 , 10) * exchange _ values ( 15 , 17 ) - > ( 17 , 15) * exchange _ values ( 100 , 200 ) - > ( 200 , 100) * @ param num1 , num2 : Two numbers that are to be swapped . * ...
int tempHolder = num1 ; num1 = num2 ; num2 = tempHolder ; return new int [ ] { num1 , num2 } ;
public class MethodAttribUtils { /** * Returns a map of method name to list of business methods . */ static Map < String , List < Method > > getBusinessMethodsByName ( BeanMetaData bmd ) { } }
Map < String , List < Method > > methodsByName = new HashMap < String , List < Method > > ( ) ; collectBusinessMethodsByName ( methodsByName , bmd . methodInfos ) ; collectBusinessMethodsByName ( methodsByName , bmd . localMethodInfos ) ; return methodsByName ;
public class WorkspaceDirectory { /** * The IP addresses of the DNS servers for the directory . * @ return The IP addresses of the DNS servers for the directory . */ public java . util . List < String > getDnsIpAddresses ( ) { } }
if ( dnsIpAddresses == null ) { dnsIpAddresses = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return dnsIpAddresses ;
public class Filters { /** * Converts a { @ link CommonAttributes # FILTER _ SPEC filter spec } to a legacy { @ link CommonAttributes # FILTER filter } . * @ param value the value to convert * @ return the complex filter object */ static ModelNode filterSpecToFilter ( final String value ) { } }
final ModelNode filter = new ModelNode ( CommonAttributes . FILTER . getName ( ) ) . setEmptyObject ( ) ; final Iterator < String > iterator = tokens ( value ) . iterator ( ) ; parseFilterExpression ( iterator , filter , true ) ; return filter ;
public class EventDistributor { /** * When an object implementing interface < code > Runnable < / code > is used * to create a thread , starting the thread causes the object ' s * < code > run < / code > method to be called in that separately executing * thread . * The general contract of the method < code > ru...
while ( ! stop ) { try { EventModel < ? > event = events . take ( ) ; processEvent ( event ) ; } catch ( InterruptedException e ) { log . warn ( "interrupted" , e ) ; } }
public class UtilIO { /** * Searches for the root BoofCV directory and returns an absolute path from it . * @ param path File path relative to root directory * @ return Absolute path to file */ public static String path ( String path ) { } }
String pathToBase = getPathToBase ( ) ; if ( pathToBase == null ) return path ; return new File ( pathToBase , path ) . getAbsolutePath ( ) ;
public class AsciiArtRenderer { /** * < b > Example : < / b > * { @ code | foo | } */ @ Override public void renderReference ( PositionedText canvas , double x , double y , String target , String name ) { } }
canvas . add ( x , y , "|" + name + "|" ) ;
public class Replacement { /** * Creates a { @ link Replacement } . Start and end positions are represented as code unit indices in * a Unicode 16 - bit string . * @ param startPosition the beginning of the replacement * @ param endPosition the end of the replacement , exclusive * @ param replaceWith the replac...
checkArgument ( startPosition >= 0 && startPosition <= endPosition , "invalid replacement: [%s, %s) (%s)" , startPosition , endPosition , replaceWith ) ; return new AutoValue_Replacement ( Range . closedOpen ( startPosition , endPosition ) , replaceWith ) ;
public class ObjFileImporter { /** * Creates a new { @ link Face } from data and adds it to { @ link # faces } . < br > * Tries to deduct parameters from the normals provided and disable brightness / AO calculations . * @ param data the data */ private void addFace ( String data ) { } }
matcher = facePattern . matcher ( data ) ; List < Vertex > faceVertex = new ArrayList < > ( ) ; List < Vector > faceNormals = new ArrayList < > ( ) ; int v = 0 , t = 0 , n = 0 ; String strV , strT , strN ; Vertex vertex , vertexCopy ; UV uv = null ; Vector normal ; while ( matcher . find ( ) ) { normal = null ; uv = nu...
public class GeneralContextExtractor { /** * { @ inheritDoc } */ public void processDocument ( BufferedReader document , Wordsi wordsi ) { } }
Queue < String > prevWords = new ArrayDeque < String > ( ) ; Queue < String > nextWords = new ArrayDeque < String > ( ) ; Iterator < String > it = IteratorFactory . tokenizeOrdered ( document ) ; // Skip empty documents . if ( ! it . hasNext ( ) ) return ; // Read the header and use it as the secondary key for wordsi ,...
public class XmlScanner { /** * 从xmlPath的Set集合中解析判断是否是zealot的xml文件 , 如果是的话则将其添加到XmlContext上下文中 , 供后面解析 . */ private void addZealotXmlInContext ( ) { } }
for ( String xmlPath : xmlPaths ) { String nameSpace = XmlNodeHelper . getZealotXmlNameSpace ( xmlPath ) ; if ( StringHelper . isNotBlank ( nameSpace ) ) { XmlContext . INSTANCE . add ( nameSpace , xmlPath ) ; } }
public class UserDto { /** * transformers / / / / / */ public static UserDto fromUser ( User user , boolean isIncludeCredentials ) { } }
UserDto userDto = new UserDto ( ) ; userDto . setProfile ( UserProfileDto . fromUser ( user ) ) ; if ( isIncludeCredentials ) { userDto . setCredentials ( UserCredentialsDto . fromUser ( user ) ) ; } return userDto ;
public class DBUtils { /** * 用于查询SQL语句中返回的记录中的第一个字段的值 , 适用于单条记录单个字段的查询 * @ param sql 查询SQL语句 * @ param arg 传入的占位符的参数 * @ return 返回查询的记录的第一个字段的值 , 若有多个记录符合查询条件 , 则返回第一条记录的第一个字段的值 , 若没有符合条件的记录 , 则返回NULL */ public static < T > T getValueOfCertainColumnOfCertainRecord ( String sql , Object ... arg ) { } }
List < T > list = DBUtils . getValueOfCertainColumnOfAllRecord ( sql , arg ) ; if ( list . isEmpty ( ) ) { return null ; } return list . get ( 0 ) ;
public class WaitForFieldChangeHandler { /** * Set the field that owns this listener . * @ owner The field that this listener is being added to ( if null , this listener is being removed ) . */ public void setOwner ( ListenerOwner owner ) { } }
if ( owner == null ) { if ( m_messageListener != null ) { m_messageListener . free ( ) ; m_messageListener = null ; } } super . setOwner ( owner ) ; if ( owner != null ) { Record record = this . getOwner ( ) . getRecord ( ) ; MessageManager messageManager = ( ( Application ) record . getTask ( ) . getApplication ( ) ) ...
public class SelectList { /** * Deselect the option at the given index . This is done by examing the " index " attribute of an element , and not * merely by counting . * @ param index * the index to deselect */ public void deselectByIndex ( int index ) { } }
getDispatcher ( ) . beforeDeselect ( this , index ) ; new Select ( getElement ( ) ) . deselectByIndex ( index ) ; if ( Config . getBoolConfigProperty ( ConfigProperty . ENABLE_GUI_LOGGING ) ) { logUIActions ( UIActions . CLEARED , Integer . toString ( index ) ) ; } getDispatcher ( ) . afterDeselect ( this , index ) ;
public class AbcGrammar { /** * field - composer : : = % x43.3A * WSP tex - text header - eol < p > * < tt > C : < / tt > */ Rule FieldComposer ( ) { } }
return Sequence ( String ( "C:" ) , ZeroOrMore ( WSP ( ) ) . suppressNode ( ) , TexText ( ) , HeaderEol ( ) ) . label ( FieldComposer ) ;
public class JadeAgentIntrospector { /** * Non - supported in JadeAgentIntrospector */ @ Override public Object [ ] getAgentPlans ( String agent_name , Connector connector ) { } }
// Not supported in JADE connector . getLogger ( ) . warning ( "Non suported method for Jade Platform. There is no plans in Jade platform." ) ; throw new java . lang . UnsupportedOperationException ( "Non suported method for Jade Platform. There is no extra properties." ) ;
public class TagAttributeImpl { /** * If literal , call { @ link Integer # parseInt ( java . lang . String ) Integer . parseInt ( String ) } , otherwise call * { @ link # getObject ( FaceletContext , Class ) getObject ( FaceletContext , Class ) } . * @ see Integer # parseInt ( java . lang . String ) * @ see # get...
if ( ( this . capabilities & EL_LITERAL ) != 0 ) { return Integer . parseInt ( this . value ) ; } else { return ( ( Number ) this . getObject ( ctx , Integer . class ) ) . intValue ( ) ; }
public class Blob { /** * Sends a copy request for the current blob to the target bucket , preserving its name . Possibly * copying also some of the metadata ( e . g . content - type ) . * < p > Example of copying the blob to a different bucket , keeping the original name . * < pre > { @ code * String bucketNam...
return copyTo ( targetBucket , getName ( ) , options ) ;
public class CommonOps_ZDRM { /** * Solves for x in the following equation : < br > * < br > * A * x = b * If the system could not be solved then false is returned . If it returns true * that just means the algorithm finished operating , but the results could still be bad * because ' A ' is singular or nearly...
LinearSolverDense < ZMatrixRMaj > solver ; if ( a . numCols == a . numRows ) { solver = LinearSolverFactory_ZDRM . lu ( a . numRows ) ; } else { solver = LinearSolverFactory_ZDRM . qr ( a . numRows , a . numCols ) ; } // make sure the inputs ' a ' and ' b ' are not modified solver = new LinearSolverSafe < ZMatrixRMaj >...
public class PreauthIntegrityNegotiateContext { /** * { @ inheritDoc } * @ see jcifs . Decodable # decode ( byte [ ] , int , int ) */ @ Override public int decode ( byte [ ] buffer , int bufferIndex , int len ) throws SMBProtocolDecodingException { } }
int start = bufferIndex ; int nalgos = SMBUtil . readInt2 ( buffer , bufferIndex ) ; int nsalt = SMBUtil . readInt2 ( buffer , bufferIndex + 2 ) ; bufferIndex += 4 ; this . hashAlgos = new int [ nalgos ] ; for ( int i = 0 ; i < nalgos ; i ++ ) { this . hashAlgos [ i ] = SMBUtil . readInt2 ( buffer , bufferIndex ) ; buf...
public class IfcReinforcingMeshTypeImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcBendingParameterSelect > getBendingParameters ( ) { } }
return ( EList < IfcBendingParameterSelect > ) eGet ( Ifc4Package . Literals . IFC_REINFORCING_MESH_TYPE__BENDING_PARAMETERS , true ) ;
public class Math { /** * Returns the maximum of a matrix . */ public static int max ( int [ ] [ ] matrix ) { } }
int m = matrix [ 0 ] [ 0 ] ; for ( int [ ] x : matrix ) { for ( int y : x ) { if ( m < y ) { m = y ; } } } return m ;
public class Agg { /** * Get a { @ link Collector } that calculates the < code > MAX ( ) < / code > function . */ public static < T > Collector < T , ? , Optional < T > > max ( Comparator < ? super T > comparator ) { } }
return maxBy ( t -> t , comparator ) ;
public class Console { /** * Changes workspace in the URL displayed by browser . * @ param name the name of the repository . * @ param changeHistory if true store URL changes in browser ' s history . */ public void changeWorkspaceInURL ( String name , boolean changeHistory ) { } }
jcrURL . setWorkspace ( name ) ; if ( changeHistory ) { htmlHistory . newItem ( jcrURL . toString ( ) , false ) ; }
public class YearQuarter { /** * Returns a copy of this year - quarter with the specified period in years added . * This instance is immutable and unaffected by this method call . * @ param yearsToAdd the years to add , may be negative * @ return a { @ code YearQuarter } based on this year - quarter with the year...
if ( yearsToAdd == 0 ) { return this ; } int newYear = YEAR . checkValidIntValue ( year + yearsToAdd ) ; // safe overflow return with ( newYear , quarter ) ;
public class Base58 { /** * Decodes the given base58 string into the original data bytes . * @ param input the base58 - encoded string to decode * @ return the decoded data bytes * @ throws AddressFormatException if the given string is not a valid base58 string */ public static byte [ ] decode ( String input ) th...
if ( input . length ( ) == 0 ) { return new byte [ 0 ] ; } // Convert the base58 - encoded ASCII chars to a base58 byte sequence ( base58 digits ) . byte [ ] input58 = new byte [ input . length ( ) ] ; for ( int i = 0 ; i < input . length ( ) ; ++ i ) { char c = input . charAt ( i ) ; int digit = c < 128 ? INDEXES [ c ...
public class AuthEngine { /** * Checks that the " test " array is in the data array starting at the given offset . */ private void checkSubArray ( byte [ ] test , byte [ ] data , int offset ) { } }
Preconditions . checkArgument ( data . length >= test . length + offset ) ; for ( int i = 0 ; i < test . length ; i ++ ) { Preconditions . checkArgument ( test [ i ] == data [ i + offset ] ) ; }
public class DOValidatorSchematron { /** * Run the Schematron validation on a Fedora object . * @ param objectSource * the Fedora object as an StreamSource * @ throws ServerException */ public void validate ( StreamSource objectSource ) throws ServerException { } }
DOValidatorSchematronResult result = null ; try { // Create a transformer that uses the validating stylesheet . // Run the Schematron validation of the Fedora object and // output results in DOM format . Transformer vtransformer = validatingStyleSheet . newTransformer ( ) ; DOMResult validationResult = new DOMResult ( ...
public class DatabasesInner { /** * Returns database metric definitions . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param databaseName The n...
return ServiceFuture . fromResponse ( listMetricDefinitionsWithServiceResponseAsync ( resourceGroupName , serverName , databaseName ) , serviceCallback ) ;
public class ODataEntity { /** * Get the link with the given rel attribute * @ param rel * rel of link to retrieve * @ return The link if found , null if not . */ public < U extends ODataEntity < ? > > LinkInfo < U > getLink ( String rel ) { } }
for ( Object child : entry . getEntryChildren ( ) ) { LinkType link = linkFromChild ( child ) ; if ( link != null && link . getRel ( ) . equals ( rel ) ) { return new LinkInfo < U > ( link ) ; } } return null ;
public class UpdateServicePrimaryTaskSetRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateServicePrimaryTaskSetRequest updateServicePrimaryTaskSetRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateServicePrimaryTaskSetRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateServicePrimaryTaskSetRequest . getCluster ( ) , CLUSTER_BINDING ) ; protocolMarshaller . marshall ( updateServicePrimaryTaskSetRequest . getServ...
public class BinaryFast { /** * Returns the int [ ] values of the Binary Fast image * @ return int [ ] the greylevel array of the image */ public int [ ] getValues ( ) { } }
int [ ] graylevel = new int [ size ] ; int [ ] values1D = convertToArray ( ) ; for ( int i = 0 ; i < size ; i ++ ) { graylevel [ i ] = values1D [ i ] & 0x000000ff ; } return graylevel ;
public class GetParameterRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetParameterRequest getParameterRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getParameterRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getParameterRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( getParameterRequest . getWithDecryption ( ) , WITHDECRYPTION_BINDING ) ; } catch...
public class SolrRepositoryConfigExtension { /** * ( non - Javadoc ) * @ see org . springframework . data . repository . config . RepositoryConfigurationExtensionSupport # postProcess ( org . springframework . beans . factory . support . BeanDefinitionBuilder , org . springframework . data . repository . config . Xml...
Element element = config . getElement ( ) ; builder . addPropertyReference ( BeanDefinitionName . SOLR_OPERATIONS . getBeanName ( ) , element . getAttribute ( "solr-template-ref" ) ) ; if ( StringUtils . hasText ( element . getAttribute ( "schema-creation-support" ) ) ) { builder . addPropertyValue ( "schemaCreationSup...
public class ResourceName { /** * Creates a new resource name based on given template and path . The path must match the template , * otherwise null is returned . * @ throws ValidationException if the path does not match the template . */ public static ResourceName create ( PathTemplate template , String path ) { }...
ImmutableMap < String , String > values = template . match ( path ) ; if ( values == null ) { throw new ValidationException ( "path '%s' does not match template '%s'" , path , template ) ; } return new ResourceName ( template , values , null ) ;
public class EditText { /** * Called when an attached input method calls * { @ link InputConnection # performEditorAction ( int ) * InputConnection . performEditorAction ( ) } * for this text view . The default implementation will call your action * listener supplied to { @ link # setOnEditorActionListener } , ...
if ( mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE ) ( ( InternalEditText ) mInputView ) . superOnEditorAction ( actionCode ) ; else if ( mAutoCompleteMode == AUTOCOMPLETE_MODE_SINGLE ) ( ( InternalAutoCompleteTextView ) mInputView ) . superOnEditorAction ( actionCode ) ; else ( ( InternalMultiAutoCompleteTextView ) mInp...
import java . util . * ; import java . util . regex . * ; class GetQuotedValues { /** * This function extracts and returns values enclosed in quotation marks in a given string . * Examples : * get _ quoted _ values ( ' " Python " , " PHP " , " Java " ' ) * [ ' Python ' , ' PHP ' , ' Java ' ] * get _ quoted _ va...
List < String > resultList = new ArrayList < > ( ) ; Pattern pattern = Pattern . compile ( "\"(.*?)\"" ) ; Matcher matcher = pattern . matcher ( txt ) ; while ( matcher . find ( ) ) { resultList . add ( matcher . group ( 1 ) ) ; } return resultList ;
public class StringFunctions { /** * TODO : implement N arguments char concat */ @ Description ( "concatenates given character strings" ) @ ScalarFunction @ LiteralParameters ( { } }
"x" , "y" , "u" } ) @ Constraint ( variable = "u" , expression = "x + y" ) @ SqlType ( "char(u)" ) public static Slice concat ( @ LiteralParameter ( "x" ) Long x , @ SqlType ( "char(x)" ) Slice left , @ SqlType ( "char(y)" ) Slice right ) { int rightLength = right . length ( ) ; if ( rightLength == 0 ) { return left ; ...
public class Http { /** * Executes a DELETE request . * @ param url url of resource to delete * @ param connectTimeout connection timeout in milliseconds . * @ param readTimeout read timeout in milliseconds . * @ return { @ link Delete } */ public static Delete delete ( String url , int connectTimeout , int rea...
try { return new Delete ( url , connectTimeout , readTimeout ) ; } catch ( Exception e ) { throw new HttpException ( "Failed URL: " + url , e ) ; }
public class SimpleLog { /** * - - - - - Initializer */ private static String getStringProperty ( String name ) { } }
String prop = null ; try { prop = System . getProperty ( name ) ; } catch ( SecurityException e ) { // Ignore } return prop == null ? simpleLogProps . getProperty ( name ) : prop ;
public class StatementBuilder { /** * Adds a qualifier { @ link Snak } to the constructed statement . * @ param qualifier * the qualifier to add * @ return builder object to continue construction */ public StatementBuilder withQualifier ( Snak qualifier ) { } }
getQualifierList ( qualifier . getPropertyId ( ) ) . add ( qualifier ) ; return getThis ( ) ;
public class BadgeTextView { /** * if width and height of the view needs to be changed * @ param width new width that needs to be set * @ param height new height that needs to be set */ void setDimens ( int width , int height ) { } }
mAreDimensOverridden = true ; mDesiredWidth = width ; mDesiredHeight = height ; requestLayout ( ) ;
public class CPDefinitionUtil { /** * Returns the last cp definition in the ordered set where CProductId = & # 63 ; and status = & # 63 ; . * @ param CProductId the c product ID * @ param status the status * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @...
return getPersistence ( ) . fetchByC_S_Last ( CProductId , status , orderByComparator ) ;
public class PDF417 { /** * Sets max / min row / col values * @ param maxCols maximum allowed columns * @ param minCols minimum allowed columns * @ param maxRows maximum allowed rows * @ param minRows minimum allowed rows */ public void setDimensions ( int maxCols , int minCols , int maxRows , int minRows ) { }...
this . maxCols = maxCols ; this . minCols = minCols ; this . maxRows = maxRows ; this . minRows = minRows ;
public class HttpRecorderMethod { /** * If a ' Proxy - Connection ' header has been added to the request , * it ' ll be of a ' keep - alive ' type . Until we support ' keep - alives ' , * override the Proxy - Connection setting and instead pass a ' close ' * ( Otherwise every request has to timeout before we noti...
Header h = method . getRequestHeader ( "Proxy-Connection" ) ; if ( h != null ) { h . setValue ( "close" ) ; method . setRequestHeader ( h ) ; }
public class WalletApplication { /** * This is an optional bean , you can modify Dubbo reference here to change the behavior of consumer */ @ Bean public DubboServiceCustomizationer dubboProviderCustomizationer ( ) { } }
return new DubboServiceCustomizationer ( ) { @ Override public void customDubboService ( BusinessIdentifer businessIdentifer , ServiceConfig < GenericService > serviceConfig ) { Logger logger = LoggerFactory . getLogger ( getClass ( ) ) ; logger . info ( "custom dubbo provider!" ) ; } } ;
public class StringUtils { /** * Convert String to an integer . Parses up to the first non - numeric * character . If no number is found an IllegalArgumentException is thrown * @ param string A String containing an integer . * @ param from The index to start parsing from * @ return an int */ public static int t...
int val = 0 ; boolean started = false ; boolean minus = false ; for ( int i = from ; i < string . length ( ) ; i ++ ) { char b = string . charAt ( i ) ; if ( b <= ' ' ) { if ( started ) break ; } else if ( b >= '0' && b <= '9' ) { val = val * 10 + ( b - '0' ) ; started = true ; } else if ( b == '-' && ! started ) { min...
public class SvgPathData { /** * Checks an ' A ' command . */ private State checkA ( State state ) throws DatatypeException , IOException { } }
if ( state . context . length ( ) == 0 ) { state = appendToContext ( state ) ; } state . current = state . reader . read ( ) ; state = appendToContext ( state ) ; state = skipSpaces ( state ) ; boolean expectNumber = true ; for ( ; ; ) { switch ( state . current ) { default : if ( expectNumber ) reportNonNumber ( 'A' ,...
public class DefaultRankCostCalculator { /** * Returns a { @ code SponsorTeam } ' s rank cost . * @ param team * the { @ code SponsorTeam } of which the rank cost will be * calculated * @ return the rank cost of the { @ code SponsorTeam } */ @ Override public final Integer getCost ( final SponsorTeam team ) { }...
Integer valoration ; checkNotNull ( team , "Received a null pointer as the team" ) ; valoration = 0 ; valoration += team . getCoachingDice ( ) * getDieCost ( ) ; valoration += team . getNastySurpriseCards ( ) * getNastySurpriseCardCost ( ) ; valoration += team . getSpecialMoveCards ( ) * getSpecialMoveCost ( ) ; valora...
public class XMemcachedClient { /** * ( non - Javadoc ) * @ see net . rubyeye . xmemcached . MemcachedClient # decr ( java . lang . String , int ) */ public final long decr ( String key , final long delta ) throws TimeoutException , InterruptedException , MemcachedException { } }
key = this . preProcessKey ( key ) ; return this . sendIncrOrDecrCommand ( key , delta , 0 , CommandType . DECR , false , this . opTimeout , 0 ) ;
public class AccountsInner { /** * Deletes the specified firewall rule from the specified Data Lake Store account . * @ param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account . * @ param accountName The name of the Data Lake Store account from which to delete the fire...
return ServiceFuture . fromResponse ( deleteFirewallRuleWithServiceResponseAsync ( resourceGroupName , accountName , firewallRuleName ) , serviceCallback ) ;
public class WmsUtilities { /** * Checks if the DPI value is already set for GeoServer . */ private static boolean isDpiSet ( final Multimap < String , String > extraParams ) { } }
String searchKey = "FORMAT_OPTIONS" ; for ( String key : extraParams . keys ( ) ) { if ( key . equalsIgnoreCase ( searchKey ) ) { for ( String value : extraParams . get ( key ) ) { if ( value . toLowerCase ( ) . contains ( "dpi:" ) ) { return true ; } } } } return false ;
public class JSConsumerSet { /** * Because there may be multiple members or the ConsumerSet , if we ' re managing * the active mesage count we must ' reserve ' a space for any message that a consumer * may lock , rather than lock it first then realise that the ConsumerSet has reached * its maximum active message ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "prepareAddActiveMessage" ) ; boolean messageAccepted = false ; boolean limitReached = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "maxActiveMessagePrepareRe...
public class TableFactor { /** * Product two factors , taking the multiplication at the intersections . * @ param other the other factor to be multiplied * @ return a factor containing the union of both variable sets */ public TableFactor multiply ( TableFactor other ) { } }
// Calculate the result domain List < Integer > domain = new ArrayList < > ( ) ; List < Integer > otherDomain = new ArrayList < > ( ) ; List < Integer > resultDomain = new ArrayList < > ( ) ; for ( int n : neighborIndices ) { domain . add ( n ) ; resultDomain . add ( n ) ; } for ( int n : other . neighborIndices ) { ot...
public class VersionParser { /** * Try to determine the version number of the operating system by parsing the user agent string . * @ param family * family of the operating system * @ param userAgent * user agent string * @ return extracted version number */ public static VersionNumber parseOperatingSystemVer...
Check . notNull ( family , "family" ) ; Check . notNull ( userAgent , "userAgent" ) ; final VersionNumber v ; if ( OperatingSystemFamily . ANDROID == family ) { v = identifyAndroidVersion ( userAgent ) ; } else if ( OperatingSystemFamily . BADA == family ) { v = identifyBadaVersion ( userAgent ) ; } else if ( Operating...
public class GridGenerator { /** * Method sets the maximal 3d dimensions to given min and max values . */ public void setDimension ( double min , double max ) { } }
this . minx = min ; this . maxx = max ; this . miny = min ; this . maxy = max ; this . minz = min ; this . maxz = max ;
public class VarOptItemsSketch { /** * Creates a copy of the sketch , optionally discarding any information about marks that would * indicate the class ' s use as a union gadget as opposed to a valid sketch . * @ param asSketch If true , copies as a sketch ; if false , copies as a union gadget * @ param adjustedN...
final VarOptItemsSketch < T > sketch ; sketch = new VarOptItemsSketch < > ( data_ , weights_ , k_ , n_ , currItemsAlloc_ , rf_ , h_ , r_ , totalWtR_ ) ; if ( ! asSketch ) { sketch . marks_ = this . marks_ ; sketch . numMarksInH_ = this . numMarksInH_ ; } if ( adjustedN >= 0 ) { sketch . n_ = adjustedN ; } return sketch...
public class OptimizationRequestHandler { /** * rPri : = Ax - b */ protected DoubleMatrix1D rPri ( DoubleMatrix1D X ) { } }
if ( getA ( ) == null ) { return F1 . make ( 0 ) ; } return ColtUtils . zMult ( getA ( ) , X , getB ( ) , - 1 ) ;
public class TextBox { /** * Base support for the attribute tag . This is overridden to prevent setting the < code > type < / code > , * and < code > value < / code > attributes . * @ param name The name of the attribute . This value may not be null or the empty string . * @ param value The value of the attribute...
if ( name != null ) { if ( name . equals ( TYPE ) || name . equals ( VALUE ) ) { String s = Bundle . getString ( "Tags_AttributeMayNotBeSet" , new Object [ ] { name } ) ; registerTagError ( s , null ) ; } else { if ( name . equals ( DISABLED ) ) { setDisabled ( Boolean . parseBoolean ( value ) ) ; return ; } else if ( ...
public class RelatedTablesCoreExtension { /** * Determine if the relation type is valid between the base and related * table * @ param baseTableName * base table name * @ param relatedTableName * related table name * @ param relationType * relation type */ private void validateRelationship ( String baseTa...
if ( relationType != null ) { if ( ! geoPackage . isTableType ( relationType . getDataType ( ) , relatedTableName ) ) { throw new GeoPackageException ( "The related table must be a " + relationType . getDataType ( ) + " table. Related Table: " + relatedTableName + ", Type: " + geoPackage . getTableType ( relatedTableNa...
public class MockInternetGatewayController { /** * Delete InternetGateway . * @ param internetgatewayId * internetgatewayId to be deleted * @ return Mock InternetGateway . */ public MockInternetGateway deleteInternetGateway ( final String internetgatewayId ) { } }
if ( internetgatewayId != null && allMockInternetGateways . containsKey ( internetgatewayId ) ) { return allMockInternetGateways . remove ( internetgatewayId ) ; } return null ;
public class DestinationDefinitionImpl { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . admin . DestinationDefinition # isAuditAllowed ( ) */ public boolean isAuditAllowed ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "isAuditAllowed" , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , "isAuditAllowed" , Boolean . valueOf ( _isAuditAllowed ) ) ; } return _isAuditAllowed ;
public class GISTreeSetUtil { /** * Compute the union of the building bounds of the given node and the given geolocation . */ private static Rectangle2d union ( AbstractGISTreeSetNode < ? , ? > node , Rectangle2afp < ? , ? , ? , ? , ? , ? > shape ) { } }
final Rectangle2d b = getNodeBuildingBounds ( node ) ; b . setUnion ( shape ) ; normalize ( b , shape ) ; return b ;
public class ProtobufIDLProxy { /** * Gets the proxy class name . * @ param name the name * @ param mappedUniName the mapped uni name * @ param isUniName the is uni name * @ return the proxy class name */ private static String getProxyClassName ( String name , Map < String , String > mappedUniName , boolean isU...
Set < String > emptyPkgs = Collections . emptySet ( ) ; return getProxyClassName ( name , emptyPkgs , mappedUniName , isUniName ) ;
public class DefaultAccountManager { /** * Returns the Account observable */ @ Override public Observable < Account > doLogin ( AuthCredentials credentials ) { } }
return Observable . just ( credentials ) . flatMap ( new Func1 < AuthCredentials , Observable < Account > > ( ) { @ Override public Observable < Account > call ( AuthCredentials credentials ) { try { // Simulate network delay Thread . sleep ( 3000 ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } if ...
public class LoggingUtil { /** * Static version to log a warning message . * @ param message Warning message , may be null ( defaults to e . getMessage ( ) ) * @ param e causing exception */ public static void warning ( String message , Throwable e ) { } }
if ( message == null && e != null ) { message = e . getMessage ( ) ; } logExpensive ( Level . WARNING , message , e ) ;
public class KeysInner { /** * Retrieve the automation keys for an account . * @ param resourceGroupName Name of an Azure Resource group . * @ param automationAccountName The name of the automation account . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable t...
return listByAutomationAccountWithServiceResponseAsync ( resourceGroupName , automationAccountName ) . map ( new Func1 < ServiceResponse < KeyListResultInner > , KeyListResultInner > ( ) { @ Override public KeyListResultInner call ( ServiceResponse < KeyListResultInner > response ) { return response . body ( ) ; } } ) ...
public class Solo { /** * Waits for an Activity matching the specified class . Default timeout is 20 seconds . * @ param activityClass the class of the { @ code Activity } to wait for . Example is : { @ code MyActivity . class } * @ return { @ code true } if { @ code Activity } appears before the timeout and { @ co...
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "waitForActivity(" + activityClass + ")" ) ; } return waiter . waitForActivity ( activityClass , Timeout . getLargeTimeout ( ) ) ;
public class ContactType { /** * Add this field in the Record ' s field sequence . */ public BaseField setupField ( int iFieldSeq ) { } }
BaseField field = null ; // if ( iFieldSeq = = 0) // field = new CounterField ( this , ID , Constants . DEFAULT _ FIELD _ LENGTH , null , null ) ; // field . setHidden ( true ) ; // if ( iFieldSeq = = 1) // field = new RecordChangedField ( this , LAST _ CHANGED , Constants . DEFAULT _ FIELD _ LENGTH , null , null ) ; /...
public class DefaultInteractionListener { /** * / * ( non - Javadoc ) * @ see com . vilt . minium . actions . InteractionListener # onEvent ( com . vilt . minium . actions . InteractionEvent ) */ @ Override public void onEvent ( InteractionEvent event ) { } }
switch ( event . getType ( ) ) { case BEFORE_WAIT : onBeforeWaitEvent ( ( BeforeWaitInteractionEvent ) event ) ; break ; case BEFORE : onBeforeEvent ( ( BeforeInteractionEvent ) event ) ; break ; case AFTER_SUCCESS : onAfterSuccessEvent ( ( AfterSuccessInteractionEvent ) event ) ; onAfterEvent ( ( AfterInteractionEvent...
public class ExtensionManager { /** * Update an existing plugin with modified information If * < code > extension < / code > is null then a < code > NullPointerException < / code > is * thrown . * @ param extension The extension object with updated information * @ throws RemoteException * @ throws RuntimeFaul...
if ( extension == null ) { throw new NullPointerException ( ) ; } encodeUrl ( extension ) ; getVimService ( ) . updateExtension ( getMOR ( ) , extension ) ;
public class Conversions { /** * Convert a string to a big decimal . * @ param value value to convert * @ return converted value , or < code > null < / code > if the supplied value was < code > null < / code > * @ throws IllegalArgumentException if the supplied value could not be parsed */ static BigDecimal decim...
BigDecimal result ; if ( value != null ) { value = value . trim ( ) ; Matcher matcher = DECIMAL_PATTERN . matcher ( value ) ; if ( matcher . matches ( ) ) { result = new BigDecimal ( matcher . group ( 1 ) ) ; } else { throw new IllegalArgumentException ( "Unknown format for value: " + value ) ; } } else { result = null...
public class ClientConnection { /** * Save statistics to a CSV file . * @ param file * File path * @ throws IOException */ public void saveStatistics ( String file ) throws IOException { } }
if ( file != null && ! file . trim ( ) . isEmpty ( ) ) { FileWriter fw = new FileWriter ( file ) ; fw . write ( getStatistics ( ) . toRawString ( ',' ) ) ; fw . flush ( ) ; fw . close ( ) ; }
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcLoop ( ) { } }
if ( ifcLoopEClass == null ) { ifcLoopEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 303 ) ; } return ifcLoopEClass ;
public class AuthleteApiFactory { /** * Create an instance of { @ link AuthleteApi } . * This method repeats to call { @ link # create ( AuthleteConfiguration , String ) } * until one of the known classes is successfully instantiated . * The classes listed below are the ones that the current implementation knows ...
for ( String className : sKnownImpls ) { try { return create ( configuration , className ) ; } catch ( Exception e ) { // Ignore . } } // No implementation was found . return null ;
public class BitcointoyouMarketDataServiceRaw { /** * List all public trades made at Bitcointoyou Exchange . * @ param currencyPair the trade currency pair * @ return an array of { @ link BitcointoyouPublicTrade } * @ throws IOException */ BitcointoyouPublicTrade [ ] getBitcointoyouPublicTrades ( CurrencyPair cur...
try { return getBitcointoyouPublicTrades ( currencyPair , null , null ) ; } catch ( BitcointoyouException e ) { throw new ExchangeException ( e . getError ( ) ) ; }
public class GetServiceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetServiceRequest getServiceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getServiceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getServiceRequest . getId ( ) , ID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e...
public class AccSessionFactoryImpl { /** * App Session Factory - - - - - */ @ Override public AppSession getSession ( String sessionId , Class < ? extends AppSession > aClass ) { } }
if ( sessionId == null ) { throw new IllegalArgumentException ( "SessionId must not be null" ) ; } if ( ! this . iss . exists ( sessionId ) ) { return null ; } AppSession appSession = null ; try { if ( aClass == ClientAccSession . class ) { IClientAccSessionData data = ( IClientAccSessionData ) this . sessionDataFactor...
public class Configuration { /** * Get the SQL type name for the given java type * @ param type java type * @ return SQL type name */ public String getTypeName ( Class < ? > type ) { } }
Integer jdbcType = jdbcTypeMapping . get ( type ) ; if ( jdbcType == null ) { jdbcType = javaTypeMapping . getType ( type ) . getSQLTypes ( ) [ 0 ] ; } return templates . getTypeNameForCode ( jdbcType ) ;
public class JnlpDownloadServletMojo { /** * Resolve artifact of incoming jar resources ( user configured ones ) , check their main class . * If must include transitive dependencies , collect them and wrap them as new jar resources . * For each collected jar resource , copy his artifact file to lib directory ( if i...
Set < ResolvedJarResource > collectedJarResources = new LinkedHashSet < > ( ) ; if ( commonJarResources != null ) { collectedJarResources . addAll ( commonJarResources ) ; } ArtifactUtil artifactUtil = getArtifactUtil ( ) ; // artifacts resolved from repositories Set < Artifact > artifacts = new LinkedHashSet < > ( ) ;...
public class BaseTraceService { /** * Route only trace log records . Messages including Systemout , err will not be routed to trace source to avoid duplicate entries */ protected boolean invokeTraceRouters ( RoutedMessage routedTrace ) { } }
boolean retMe = true ; LogRecord logRecord = routedTrace . getLogRecord ( ) ; /* * Avoid any feedback traces that are emitted after this point . * The first time the counter increments is the first pass - through . * The second time the counter increments is the second pass - through due * to trace emitted . We d...
public class HeapPriorityQueueSet { /** * In contrast to the superclass and to maintain set semantics , removal here is based on comparing the given element * via { @ link # equals ( Object ) } . * @ return < code > true < / code > if the operation changed the head element or if is it unclear if the head element ch...
T storedElement = getDedupMapForElement ( toRemove ) . remove ( toRemove ) ; return storedElement != null && super . remove ( storedElement ) ;
public class AmazonElasticLoadBalancingClient { /** * Associates the specified security groups with the specified Application Load Balancer . The specified security * groups override the previously associated security groups . * You can ' t specify a security group for a Network Load Balancer . * @ param setSecur...
request = beforeClientExecution ( request ) ; return executeSetSecurityGroups ( request ) ;
public class UnionBasedQueryMergerImpl { /** * When such substitution DO NOT EXIST , returns an EMPTY OPTIONAL . * When NO renaming is NEEDED returns an EMPTY SUBSTITUTION . */ private Optional < InjectiveVar2VarSubstitution > computeRenamingSubstitution ( DistinctVariableOnlyDataAtom sourceProjectionAtom , DistinctV...
int arity = sourceProjectionAtom . getEffectiveArity ( ) ; if ( ! sourceProjectionAtom . getPredicate ( ) . equals ( targetProjectionAtom . getPredicate ( ) ) || ( arity != targetProjectionAtom . getEffectiveArity ( ) ) ) { return Optional . empty ( ) ; } else { ImmutableMap < Variable , Variable > newMap = FunctionalT...
public class FilterBlur { /** * Create a blur kernel . * @ param radius The blur radius . * @ param width The image width . * @ param height The image height . * @ return The blur kernel . */ private static Kernel createKernel ( float radius , int width , int height ) { } }
final int r = ( int ) Math . ceil ( radius ) ; final int rows = r * 2 + 1 ; final float [ ] matrix = new float [ rows ] ; final float sigma = radius / 3 ; final float sigma22 = 2 * sigma * sigma ; final float sigmaPi2 = ( float ) ( 2 * Math . PI * sigma ) ; final float sqrtSigmaPi2 = ( float ) Math . sqrt ( sigmaPi2 ) ...
public class MACNumber { /** * Join the specified MAC numbers to reply a string . * @ param addresses is the list of mac addresses to join . * @ return the joined string . */ @ Pure public static String join ( MACNumber ... addresses ) { } }
if ( ( addresses == null ) || ( addresses . length == 0 ) ) { return null ; } final StringBuilder buf = new StringBuilder ( ) ; for ( final MACNumber number : addresses ) { if ( buf . length ( ) > 0 ) { buf . append ( MACNUMBER_SEPARATOR ) ; } buf . append ( number ) ; } return buf . toString ( ) ;
public class Utility { /** * Are these two numbers effectively equal ? * The same logic is applied for each of the 3 vector dimensions : see { @ link # equal } * @ param v1 * @ param v2 */ public static boolean equal ( Vector3f v1 , Vector3f v2 ) { } }
return equal ( v1 . x , v2 . x ) && equal ( v1 . y , v2 . y ) && equal ( v1 . z , v2 . z ) ;
public class Status { /** * Method to initialize the Cache of this CacheObjectInterface . * @ param _ class class that called the method * @ throws CacheReloadException on error */ public static void initialize ( final Class < ? > _class ) throws CacheReloadException { } }
if ( InfinispanCache . get ( ) . exists ( Status . UUIDCACHE4GRP ) ) { InfinispanCache . get ( ) . < UUID , Status > getCache ( Status . UUIDCACHE4GRP ) . clear ( ) ; } else { InfinispanCache . get ( ) . < UUID , Status > getCache ( Status . UUIDCACHE4GRP ) . addListener ( new CacheLogListener ( Status . LOG ) ) ; } if...
public class AnimatorModel { /** * Check state in playing case . */ private void checkStatePlaying ( ) { } }
if ( ! reverse ) { if ( repeat ) { state = AnimState . PLAYING ; current = first ; } else { state = AnimState . FINISHED ; } } else { state = AnimState . REVERSING ; }
public class WebApp { /** * Add a listener . * @ param listener to add * @ throws NullArgumentException if listener or listener class is null */ public void addListener ( final WebAppListener listener ) { } }
NullArgumentException . validateNotNull ( listener , "Listener" ) ; NullArgumentException . validateNotNull ( listener . getListenerClass ( ) , "Listener class" ) ; if ( ! listeners . contains ( listener ) ) { listeners . add ( listener ) ; }
public class JdbcRow { /** * Returns the column as a boolean . * @ param index 1 - based * @ return column as a boolean */ public boolean getBoolean ( int index ) { } }
Object value = _values [ index - 1 ] ; if ( value instanceof Boolean ) { return ( Boolean ) value ; } else { return Boolean . valueOf ( value . toString ( ) ) ; }
public class LRFUEvictor { /** * This function is used to update CRF of all the blocks according to current logic time . When * some block is accessed in some time , only CRF of that block itself will be updated to current * time , other blocks who are not accessed recently will only be updated until * { @ link #...
long currentLogicTime = mLogicTimeCount . get ( ) ; for ( Entry < Long , Double > entry : mBlockIdToCRFValue . entrySet ( ) ) { long blockId = entry . getKey ( ) ; double crfValue = entry . getValue ( ) ; mBlockIdToCRFValue . put ( blockId , crfValue * calculateAccessWeight ( currentLogicTime - mBlockIdToLastUpdateTime...
public class NamespaceContextImpl { /** * { @ inheritDoc } */ public String getPrefix ( String namespaceURI ) { } }
if ( namespaceURI == null ) { throw new IllegalArgumentException ( "null namespaceURI not allowed." ) ; } for ( String prefix : prefix2ns . keySet ( ) ) { if ( prefix2ns . get ( prefix ) . equals ( namespaceURI ) ) { return prefix ; } } return null ;
public class FilePermissions { /** * Check whether the current process can create a directory at the specified path . This is useful * for providing immediate feedback to an end user that a path they have selected or typed may not * be suitable before attempting to create the directory ; e . g . in a tooltip . * ...
Preconditions . checkNotNull ( path , "Null directory path" ) ; for ( Path segment = path ; segment != null ; segment = segment . getParent ( ) ) { if ( Files . exists ( segment ) ) { if ( Files . isDirectory ( segment ) ) { // Can ' t create a directory if the bottom most currently existing directory in // the path is...
public class JsonConfigReader { /** * Reads configuration file , parameterizes its content and converts it into JSON * object . * @ param correlationId ( optional ) transaction id to trace execution through * call chain . * @ param parameters values to parameters the configuration . * @ return a JSON object w...
if ( _path == null ) throw new ConfigException ( correlationId , "NO_PATH" , "Missing config file path" ) ; try { Path path = Paths . get ( _path ) ; String json = new String ( Files . readAllBytes ( path ) ) ; json = parameterize ( json , parameters ) ; return jsonMapper . readValue ( json , typeRef ) ; } catch ( Exce...
public class CrossTab { /** * Returns a table containing two - dimensional cross - tabulated counts for each combination of values in * { @ code column1 } and { @ code column2} * @ param table The table we ' re deriving the counts from * @ param column1 A column in { @ code table } * @ param column2 Another col...
Table t = Table . create ( "Crosstab Counts: " + column1 . name ( ) + " x " + column2 . name ( ) ) ; t . addColumns ( column1 . type ( ) . create ( LABEL_COLUMN_NAME ) ) ; Table temp = table . sortOn ( column1 . name ( ) , column2 . name ( ) ) ; int colIndex1 = table . columnIndex ( column1 . name ( ) ) ; int colIndex2...
public class Colorization { /** * Adjusts the supplied color by the offsets in this colorization , taking the appropriate * measures for hue ( wrapping it around ) and saturation and value ( clipping ) . * @ return the RGB value of the recolored color . */ public int recolorColor ( float [ ] hsv ) { } }
// hue will be wrapped - around by HSBtoRGB , we don ' t need to do it float hue = hsv [ 0 ] + offsets [ 0 ] ; // the others we must clip float sat = Math . min ( Math . max ( hsv [ 1 ] + offsets [ 1 ] , 0 ) , 1 ) ; float val = Math . min ( Math . max ( hsv [ 2 ] + offsets [ 2 ] , 0 ) , 1 ) ; // convert back to RGB spa...