signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class JmsQueueBrowserImpl { /** * This method is responsible for instantiating the browser , and adding it
* to the list of browsers that we current have associated with this JMS object . */
private Enumeration instantiateBrowser ( ) throws JMSException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "instantiateBrowser" ) ; EnumImpl vEnum = null ; try { DestinationType dt = DestinationType . QUEUE ; String discrim = null ; String mediation = null ; boolean gather = false ; // Establish the correct gatherMessages ... |
public class InChIGenerator { /** * Gets generated InChIKey string . */
public String getInchiKey ( ) throws CDKException { } } | JniInchiOutputKey key ; try { key = JniInchiWrapper . getInchiKey ( output . getInchi ( ) ) ; if ( key . getReturnStatus ( ) == INCHI_KEY . OK ) { return key . getKey ( ) ; } else { throw new CDKException ( "Error while creating InChIKey: " + key . getReturnStatus ( ) ) ; } } catch ( JniInchiException exception ) { thr... |
public class HtmlDocletWriter { /** * Get link to the " overview - summary . html " page .
* @ return a content tree for the link */
protected Content getNavLinkContents ( ) { } } | Content linkContent = getHyperLink ( pathToRoot . resolve ( DocPaths . OVERVIEW_SUMMARY ) , overviewLabel , "" , "" ) ; Content li = HtmlTree . LI ( linkContent ) ; return li ; |
public class IfcProcessImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) public EList < IfcRelSequence > getIsSuccessorFrom ( ) { } } | return ( EList < IfcRelSequence > ) eGet ( Ifc2x3tc1Package . Literals . IFC_PROCESS__IS_SUCCESSOR_FROM , true ) ; |
public class ParsePackage { /** * Method getRuleName . The rule name is normally enclosed in quotes
* but it might be omitted in which case we generate a unique one .
* @ return String
* @ throws ParserException */
private String getRuleName ( RulesTextProvider textProvider ) { } } | if ( ! quotedString ( '"' , textProvider ) ) { return "R" + ( textProvider . incrementRuleCount ( ) ) ; } return textProvider . getLastToken ( ) ; |
public class SimonConsolePluginManager { /** * Return plugin list , filtered by plugin type . */
public < T extends SimonConsolePlugin > List < T > getPluginsByType ( Class < T > pluginType ) { } } | List < T > specPlugins = new ArrayList < > ( ) ; for ( SimonConsolePlugin plugin : plugins ) { if ( pluginType . isInstance ( plugin ) ) { specPlugins . add ( pluginType . cast ( plugin ) ) ; } } return Collections . unmodifiableList ( specPlugins ) ; |
public class Http2Ping { /** * Executes the given runnable . This prevents exceptions from propagating so that an exception
* thrown by one callback won ' t prevent subsequent callbacks from being executed . */
private static void doExecute ( Executor executor , Runnable runnable ) { } } | try { executor . execute ( runnable ) ; } catch ( Throwable th ) { log . log ( Level . SEVERE , "Failed to execute PingCallback" , th ) ; } |
public class GPXTablesFactory { /** * Create the track segments table to store the segments of a track
* @ param connection
* @ param trackSegementsTableName
* @ param isH2 set true if it ' s an H2 database
* @ return
* @ throws SQLException */
public static PreparedStatement createTrackSegmentsTable ( Connec... | try ( Statement stmt = connection . createStatement ( ) ) { StringBuilder sb = new StringBuilder ( "CREATE TABLE " ) ; sb . append ( trackSegementsTableName ) . append ( " (" ) ; if ( isH2 ) { sb . append ( "the_geom LINESTRING CHECK ST_SRID(THE_GEOM) = 4326," ) ; } else { sb . append ( "the_geom GEOMETRY(LINESTRING, 4... |
public class TimeSeriesLookup { /** * Lookup time series associated with the given metric , tagk , tagv or tag
* pairs . Either the meta table or the data table will be scanned . If no
* metric is given , a full table scan must be performed and this call may take
* a long time to complete .
* When dumping to st... | try { return lookupAsync ( ) . join ( ) ; } catch ( InterruptedException e ) { LOG . error ( "Interrupted performing lookup" , e ) ; Thread . currentThread ( ) . interrupt ( ) ; return null ; } catch ( DeferredGroupException e ) { final Throwable ex = Exceptions . getCause ( e ) ; if ( ex instanceof NoSuchUniqueName ) ... |
public class Config { /** * Multiple properties separated by white spaces
* @ param aClass
* @ param key Name of the property to be returned .
* @ param aDefault the default value
* @ return Text . split ( getProperty ( aClass , key , aDefault ) ) */
public static String [ ] getPropertyStrings ( Class < ? > aCl... | return getSettings ( ) . getPropertyStrings ( aClass , key , aDefault ) ; |
public class Ix { /** * Emits a sequence of substring of a string split by the given separator .
* The result ' s iterator ( ) doesn ' t support remove ( ) .
* @ param string the string to split , not null
* @ param by the separator to split along , not null
* @ return the new Ix instance
* @ throws NullPoint... | return new IxSplit ( nullCheck ( string , "string is null" ) , nullCheck ( by , "by is null" ) ) ; |
public class JobsInner { /** * Gets the IP address and port information of all the compute nodes which are used for job execution .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ param serviceFuture the ServiceFuture object tracking the Retrofit calls
* @ param servi... | return AzureServiceFuture . fromPageResponse ( listRemoteLoginInformationNextSinglePageAsync ( nextPageLink ) , new Func1 < String , Observable < ServiceResponse < Page < RemoteLoginInformationInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < RemoteLoginInformationInner > > > call ( String nex... |
public class ColorSpecificationImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setColSize2 ( Integer newColSize2 ) { } } | Integer oldColSize2 = colSize2 ; colSize2 = newColSize2 ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . COLOR_SPECIFICATION__COL_SIZE2 , oldColSize2 , colSize2 ) ) ; |
public class ImageOption { /** * Apply this image option to a url , replacing and updating this url .
* @ param url a url to be handled
* @ return the changed url . */
public String apply ( String url ) { } } | return format ( getDefault ( ) , "%s%s%s=%s" , url , concatenationOperator ( url ) , operation , argument ) ; |
public class Entry { /** * Assigns a new ID to the entry . IDs do not have to be unique . If several
* entries share the same ID it means that they are representing the same
* " real world " entry . An entry spanning multiple days will be shown via
* several entries in the month view . Clicking on one of them wil... | requireNonNull ( id ) ; if ( MODEL . isLoggable ( FINE ) ) { MODEL . fine ( "setting id to " + id ) ; // $ NON - NLS - 1 $
} this . id = id ; |
public class CRLExtensions { /** * helper routine */
private void init ( DerInputStream derStrm ) throws CRLException { } } | try { DerInputStream str = derStrm ; byte nextByte = ( byte ) derStrm . peekByte ( ) ; // check for context specific byte 0 ; skip it
if ( ( ( nextByte & 0x0c0 ) == 0x080 ) && ( ( nextByte & 0x01f ) == 0x000 ) ) { DerValue val = str . getDerValue ( ) ; str = val . data ; } DerValue [ ] exts = str . getSequence ( 5 ) ; ... |
public class TaskDefinition { /** * The container instance attributes required by your task . This field is not valid if you are using the Fargate
* launch type for your task .
* @ return The container instance attributes required by your task . This field is not valid if you are using the
* Fargate launch type f... | if ( requiresAttributes == null ) { requiresAttributes = new com . amazonaws . internal . SdkInternalList < Attribute > ( ) ; } return requiresAttributes ; |
public class DirectoryLookupService { /** * Invoke the serviceInstanceChange of the NotificationHandler .
* @ param instance
* the ServiceInstance . */
protected void onServiceInstanceChanged ( ServiceInstance instance ) { } } | String serviceName = instance . getServiceName ( ) ; List < NotificationHandler > handlerList = new ArrayList < NotificationHandler > ( ) ; synchronized ( notificationHandlers ) { if ( notificationHandlers . containsKey ( serviceName ) ) { handlerList . addAll ( notificationHandlers . get ( serviceName ) ) ; } } for ( ... |
public class PdfSignatureAppearance { /** * This is the last method to be called when using external signatures . The general sequence is :
* preClose ( ) , getDocumentBytes ( ) and close ( ) .
* < CODE > update < / CODE > is a < CODE > PdfDictionary < / CODE > that must have exactly the
* same keys as the ones p... | try { if ( ! preClosed ) throw new DocumentException ( "preClose() must be called first." ) ; ByteBuffer bf = new ByteBuffer ( ) ; for ( Iterator it = update . getKeys ( ) . iterator ( ) ; it . hasNext ( ) ; ) { PdfName key = ( PdfName ) it . next ( ) ; PdfObject obj = update . get ( key ) ; PdfLiteral lit = ( PdfLiter... |
public class SimpleXmlWriter { /** * Writes ' < elementName > < text > < / elementName > \ n ' . */
public void writeSingleLineDateElement ( String elementName , Date value ) throws IOException { } } | if ( elementName == null || elementName . length ( ) == 0 ) { return ; } if ( value == null ) { return ; } addElementName ( elementName ) ; indent ( ) ; writer . write ( "<" ) ; writer . write ( elementName ) ; writer . write ( ">" ) ; writer . write ( DATE_FORMAT . format ( value ) ) ; writer . write ( "</" ) ; writer... |
public class Ids { /** * Returns a new { @ link Id } for the given type .
* @ param type the { @ code Type } from which the { @ code Id } must be constructed .
* @ param < T > the type of the Id .
* @ return an new { @ code Id } based on the given type . */
@ SuppressWarnings ( "unchecked" ) public static < T > I... | return ( Id < T > ) newId ( ( Type ) type ) ; |
public class Studio { /** * Returns preference file : < tt > $ USERHOME / . acolyte / studio . properties < / tt > */
static File preferencesFile ( ) { } } | final File userDir = new File ( System . getProperty ( "user.home" ) ) ; final File prefDir = ( userDir . canWrite ( ) ) ? new File ( userDir , ".acolyte" ) : null ; if ( prefDir != null && ! prefDir . exists ( ) ) { prefDir . mkdir ( ) ; } // end of if
return ( prefDir != null && prefDir . canRead ( ) && prefDir . can... |
public class LessParser { /** * Create an expression from the given atomic string .
* @ param str the expression like a number , color , variable , string , etc
* @ return the expression */
@ Nonnull private Expression buildExpression ( String str ) { } } | switch ( str . charAt ( 0 ) ) { case '@' : return new VariableExpression ( reader , str ) ; case '-' : if ( str . startsWith ( "-@" ) ) { return new FunctionExpression ( reader , "-" , new Operation ( reader , buildExpression ( str . substring ( 1 ) ) , ( char ) 0 ) ) ; } // $ FALL - THROUGH $
default : return new Valu... |
public class Suppliers { /** * Returns a supplier which caches the instance retrieved during the first
* call to { @ code get ( ) } and returns that value on subsequent calls to
* { @ code get ( ) } . See :
* < a href = " http : / / en . wikipedia . org / wiki / Memoization " > memoization < / a >
* < p > The r... | return ( delegate instanceof MemoizingSupplier ) ? delegate : new MemoizingSupplier < > ( Objects . requireNonNull ( delegate ) ) ; |
public class SVD { /** * Returns the Cholesky decomposition of A ' A . */
public Cholesky CholeskyOfAtA ( ) { } } | DenseMatrix VD = Matrix . zeros ( V . nrows ( ) , V . ncols ( ) ) ; for ( int i = 0 ; i < V . nrows ( ) ; i ++ ) { for ( int j = 0 ; j < V . ncols ( ) ; j ++ ) { VD . set ( i , j , V . get ( i , j ) * s [ j ] ) ; } } return new Cholesky ( VD . aat ( ) ) ; |
public class BasicRegistry { /** * { @ inheritDoc } */
@ Override public SearchResult getGroups ( String pattern , int limit ) throws RegistryException { } } | return searchMap ( state . groups , pattern , limit ) ; |
public class BindPath { /** * Add listeners to a specific object . Updates the bould flags and update set
* @ param listener This listener to attach .
* @ param newObject The object we should read our property off of .
* @ param updateSet The list of objects we have added listeners to */
public void addListeners ... | removeListeners ( ) ; if ( newObject != null ) { // check for local synthetics
TriggerBinding syntheticTrigger = getSyntheticTriggerBinding ( newObject ) ; MetaClass mc = InvokerHelper . getMetaClass ( newObject ) ; if ( syntheticTrigger != null ) { PropertyBinding psb = new PropertyBinding ( newObject , propertyName )... |
public class AbstractConsoleEditor { /** * Displays Text highlighting the text that was marked as highlighted .
* @ param text */
protected void displayText ( String text ) { } } | if ( highLight != null && ! highLight . isEmpty ( ) && text . contains ( highLight ) ) { String highLightedText = text . replaceAll ( highLight , ansi ( ) . bold ( ) . bg ( theme . getHighLightBackground ( ) ) . fg ( theme . getHighLightForeground ( ) ) . a ( highLight ) . boldOff ( ) . reset ( ) . toString ( ) ) ; con... |
public class PegDownProcessor { /** * Converts the given markdown source to HTML .
* If the input cannot be parsed within the configured parsing timeout the method returns null .
* @ param markdownSource the markdown source to convert
* @ param linkRenderer the LinkRenderer to use
* @ return the HTML */
public ... | return markdownToHtml ( markdownSource , linkRenderer , Collections . < String , VerbatimSerializer > emptyMap ( ) ) ; |
public class WikiParameters { /** * Creates a new copy of this parameter object with new specified key / value
* pair .
* @ param key the parameter name
* @ param value the value of the parameter
* @ return a new copy of parameters object with the given key / value pair */
public WikiParameters addParameter ( S... | WikiParameters result = new WikiParameters ( ) ; result . fList . addAll ( fList ) ; result . fList . add ( new WikiParameter ( key , value ) ) ; return result ; |
public class DigitList { /** * Return true if truncating the representation to the given number
* of digits will result in an increment to the last digit . This
* method implements the rounding modes defined in the
* java . math . RoundingMode class .
* [ bnf ]
* @ param maximumDigits the number of digits to ... | if ( maximumDigits < count ) { switch ( roundingMode ) { case UP : for ( int i = maximumDigits ; i < count ; ++ i ) { if ( digits [ i ] != '0' ) { return true ; } } break ; case DOWN : break ; case CEILING : for ( int i = maximumDigits ; i < count ; ++ i ) { if ( digits [ i ] != '0' ) { return ! isNegative ; } } break ... |
public class Dispatching { /** * Adapts a ternary function to a ternary consumer .
* @ param < R > the function return type
* @ param < T1 > the function first parameter type
* @ param < T2 > the function second parameter type
* @ param < T3 > the function third parameter type
* @ param function the function ... | dbc . precondition ( function != null , "cannot adapt a null function" ) ; return function :: apply ; |
public class PyGenerator { /** * Generate the given object .
* @ param skill the skill .
* @ param context the context . */
protected void _generate ( SarlSkill skill , IExtraLanguageGeneratorContext context ) { } } | final JvmDeclaredType jvmType = getJvmModelAssociations ( ) . getInferredType ( skill ) ; final PyAppendable appendable = createAppendable ( jvmType , context ) ; List < JvmTypeReference > superTypes = getSuperTypes ( skill . getExtends ( ) , skill . getImplements ( ) ) ; if ( superTypes . isEmpty ( ) ) { superTypes = ... |
public class Binder { /** * Specifies the master properties that are part of the binding .
* @ param masters Master properties .
* @ param < MO > Type of value to be read from the master properties .
* @ return DSL object . */
public static < MO > MultipleMasterBinding < MO , Collection < MO > > read ( ReadablePr... | return new MultipleMasterBinding < MO , Collection < MO > > ( Arrays . asList ( masters ) , null ) ; |
public class RedisTransporter { /** * - - - REDIS EVENT LISTENER METHODS - - - */
@ Override public void publish ( Event event ) { } } | // Connected
if ( event instanceof ConnectedEvent ) { if ( status . compareAndSet ( STATUS_CONNECTING_1 , STATUS_CONNECTING_2 ) ) { // First connection is Ok
return ; } if ( status . compareAndSet ( STATUS_CONNECTING_2 , STATUS_CONNECTED ) ) { // Second connection is Ok
logger . info ( "All Redis pub-sub connections es... |
public class FaceListsImpl { /** * Add a face to a face list . The input face is specified as an image with a targetFace rectangle . It returns a persistedFaceId representing the added face , and persistedFaceId will not expire .
* @ param faceListId Id referencing a particular face list .
* @ param image An image ... | return ServiceFuture . fromResponse ( addFaceFromStreamWithServiceResponseAsync ( faceListId , image , addFaceFromStreamOptionalParameter ) , serviceCallback ) ; |
public class RequestContext { /** * Renders with { " msg " : msg } .
* @ param msg the specified msg
* @ return this context */
public RequestContext renderMsg ( final String msg ) { } } | if ( renderer instanceof JsonRenderer ) { final JsonRenderer r = ( JsonRenderer ) renderer ; final JSONObject ret = r . getJSONObject ( ) ; ret . put ( Keys . MSG , msg ) ; } return this ; |
public class DeleteNetworkAclEntryRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional
* parameters to enable operation dry - run . */
@ Override public Request < DeleteNetworkAclEntryRequest > getDryRunRequest ( ) { } } | Request < DeleteNetworkAclEntryRequest > request = new DeleteNetworkAclEntryRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ; |
public class sslcrl { /** * Use this API to update sslcrl resources . */
public static base_responses update ( nitro_service client , sslcrl resources [ ] ) throws Exception { } } | base_responses result = null ; if ( resources != null && resources . length > 0 ) { sslcrl updateresources [ ] = new sslcrl [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new sslcrl ( ) ; updateresources [ i ] . crlname = resources [ i ] . crlname ; updateresources ... |
public class JobStatus { /** * Creates a copy of this < code > JobStatus < / code > with the state set to
* { @ link JobState # CANCELLED } .
* @ return A copy of this < code > JobStatus < / code > with the state set to
* { @ link JobState # CANCELLED } . */
public JobStatus asCancelled ( ) { } } | return new JobStatus ( jobId , description , JobState . CANCELLED , progress , status , eventId ) ; |
public class Parsers { /** * A { @ link Parser } that runs both { @ code p1 } and { @ code p2 } and selects the longer match .
* If both matches the same length , the first one is favored . */
@ SuppressWarnings ( "unchecked" ) public static < T > Parser < T > longer ( Parser < ? extends T > p1 , Parser < ? extends T... | return longest ( p1 , p2 ) ; |
public class WindowManager { /** * Scans the event queue and returns the list of event ts
* falling between startTs ( exclusive ) and endTs ( inclusive )
* at each sliding interval counts .
* @ param startTs the start timestamp ( exclusive )
* @ param endTs the end timestamp ( inclusive )
* @ param slidingCou... | List < Long > timestamps = new ArrayList < > ( ) ; if ( endTs > startTs ) { int count = 0 ; long ts = Long . MIN_VALUE ; for ( Event < T > event : queue ) { if ( event . getTimestamp ( ) > startTs && event . getTimestamp ( ) <= endTs ) { ts = Math . max ( ts , event . getTimestamp ( ) ) ; if ( ++ count % slidingCount =... |
public class QuoteManager { /** * Process a list with candlesticks
* @ param symbol
* @ param ticksArray */
public void handleCandlestickCollection ( final BitfinexCandlestickSymbol symbol , final Collection < BitfinexCandle > ticksBuffer ) { } } | candleCallbacks . handleEventsCollection ( symbol , ticksBuffer ) ; |
public class PresentsConnection { /** * Initializes the connection with its channel . Must be called with a
* { @ link PresentsConnectionManager } as < code > cmgr < / code > . */
@ Override public void init ( ConnectionManager cmgr , SocketChannel channel , long createStamp ) throws IOException { } } | super . init ( cmgr , channel , createStamp ) ; _pcmgr = ( PresentsConnectionManager ) cmgr ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link StringTypeCustomFieldDefinition } { @ code > } } */
@ XmlElementDecl ( namespace = "http://schema.intuit.com/finance/v3" , name = "StringTypeCustomFieldDefinition" , substitutionHeadNamespace = "http://schema.intuit.co... | return new JAXBElement < StringTypeCustomFieldDefinition > ( _StringTypeCustomFieldDefinition_QNAME , StringTypeCustomFieldDefinition . class , null , value ) ; |
public class FieldValueMappingCallback { /** * Determines whether a given field ' s value can be mapped from either the current resource properties
* or another ( e . g . referenced ) resource . */
private boolean isMappable ( FieldData field ) { } } | return this . properties != null || field . metaData . isThisReference ( ) || field . isReferenceToOtherResource ( ) ; |
public class EquivalenceConverter { /** * Returns an { @ link EquivalentTerm } converted from the supplied
* { @ link Term } .
* @ param t { @ link Term } ; may be null
* @ return { @ link EquivalentTerm } ; null if { @ code t } was null */
public EquivalentTerm convert ( Term t ) { } } | if ( t == null ) return null ; return termCvtr . convert ( t ) ; |
public class ObjectiveComparator { /** * Compares two solutions according to a given objective .
* @ param solution1 The first solution
* @ param solution2 The second solution
* @ return - 1 , or 0 , or 1 if solution1 is less than , equal , or greater than solution2,
* respectively , according to the establishe... | int result ; if ( solution1 == null ) { if ( solution2 == null ) { result = 0 ; } else { result = 1 ; } } else if ( solution2 == null ) { result = - 1 ; } else if ( solution1 . getNumberOfObjectives ( ) <= objectiveId ) { throw new JMetalException ( "The solution1 has " + solution1 . getNumberOfObjectives ( ) + " objec... |
public class Replacer { /** * Returns a MultiPos instance with all occurrences with given replacement
* @ param replacement
* @ return */
public MultiPos < String , String , String > by ( final Object replacement ) { } } | return new MultiPos < String , String , String > ( checkNotNull ( replacement ) . toString ( ) , null ) { @ Override protected String result ( ) { return findingReplacing ( left , Character . class . isInstance ( replacement ) ? 'C' : 'S' , pos , position ) ; } } ; |
public class LeaderAppender { /** * Handles a { @ link io . atomix . protocols . raft . protocol . RaftResponse . Status # ERROR } response . */
protected void handleAppendResponseError ( RaftMemberContext member , AppendRequest request , AppendResponse response ) { } } | // If we ' ve received a greater term , update the term and transition back to follower .
if ( response . term ( ) > raft . getTerm ( ) ) { log . debug ( "Received higher term from {}" , member . getMember ( ) . memberId ( ) ) ; raft . setTerm ( response . term ( ) ) ; raft . setLeader ( null ) ; raft . transition ( Ra... |
public class Transformers { /** * Returns a { @ link Transformer } that allows processing of the source stream
* to be defined in a state machine where transitions of the state machine
* may also emit items to downstream that are buffered if necessary when
* backpressure is requested . < code > flatMap < / code >... | return TransformerStateMachine . < State , In , Out > create ( initialStateFactory , transition , completion , backpressureStrategy , DEFAULT_INITIAL_BATCH ) ; |
public class A_CmsNotification { /** * Append the html - code to start a html mail message to the given buffer . < p >
* @ param buffer The StringBuffer to add the html code to . */
protected void appendHtmlHeader ( StringBuffer buffer ) { } } | if ( m_configuredHeader != null ) { buffer . append ( m_configuredHeader ) ; } else { buffer . append ( "<html>\r\n" ) ; buffer . append ( " <head>\r\n" ) ; buffer . append ( " <style type=\"text/css\">\r\n" ) ; buffer . append ( " body { font-family: Verdana, Arial, Helvetica, sans-serif; background-color:whi... |
public class MultiLayerNetwork { /** * Return the input size ( number of inputs ) for the specified layer . < br >
* Note that the meaning of the " input size " can depend on the type of layer . For example : < br >
* - DenseLayer , OutputLayer , etc : the feature vector size ( nIn configuration option ) < br >
*... | if ( layer < 0 || layer > layers . length ) { throw new IllegalArgumentException ( "Invalid layer index: " + layer + ". Layer index must be between 0 and " + ( layers . length - 1 ) + " inclusive" ) ; } org . deeplearning4j . nn . conf . layers . Layer conf = layers [ layer ] . conf ( ) . getLayer ( ) ; if ( conf == nu... |
public class NumberUtil { /** * 生成不重复随机数 根据给定的最小数字和最大数字 , 以及随机数的个数 , 产生指定的不重复的数组
* @ param begin 最小数字 ( 包含该数 )
* @ param end 最大数字 ( 不包含该数 )
* @ param size 指定产生随机数的个数
* @ return 随机int数组 */
public static int [ ] generateRandomNumber ( int begin , int end , int size ) { } } | if ( begin > end ) { int temp = begin ; begin = end ; end = temp ; } // 加入逻辑判断 , 确保begin < end并且size不能大于该表示范围
if ( ( end - begin ) < size ) { throw new UtilException ( "Size is larger than range between begin and end!" ) ; } // 种子你可以随意生成 , 但不能重复
int [ ] seed = new int [ end - begin ] ; for ( int i = begin ; i < end ; i... |
public class ExecutionResult { /** * Returns a copy of the ExecutionResult with the value set to true , else this if nothing has changed . */
public ExecutionResult withComplete ( ) { } } | return this . complete ? this : new ExecutionResult ( result , failure , nonResult , waitNanos , true , success , successAll ) ; |
public class ProjectOperations { /** * Returns all the { @ link JavaClassSource } objects from the given { @ link Project } */
public List < JavaResource > getProjectClasses ( Project project ) { } } | final List < JavaResource > classes = new ArrayList < > ( ) ; if ( project != null ) { project . getFacet ( JavaSourceFacet . class ) . visitJavaSources ( new JavaClassSourceVisitor ( classes ) ) ; } return classes ; |
public class BigDecimalMath { /** * Calculates the arc tangens ( inverted tangens ) of { @ link BigDecimal } y / x in the range - < i > pi < / i > to < i > pi < / i > .
* < p > This is useful to calculate the angle < i > theta < / i > from the conversion of rectangular
* coordinates ( < code > x < / code > , & nbsp... | checkMathContext ( mathContext ) ; MathContext mc = new MathContext ( mathContext . getPrecision ( ) + 3 , mathContext . getRoundingMode ( ) ) ; if ( x . signum ( ) > 0 ) { // x > 0
return atan ( y . divide ( x , mc ) , mathContext ) ; } else if ( x . signum ( ) < 0 ) { if ( y . signum ( ) > 0 ) { // x < 0 & & y > 0
re... |
public class HttpRequest { /** * Is the request handled .
* @ return True if the request has been set to handled or the associated response is not
* editable . */
public boolean isHandled ( ) { } } | if ( _handled ) return true ; HttpResponse response = getHttpResponse ( ) ; return ( response != null && response . getState ( ) != HttpMessage . __MSG_EDITABLE ) ; |
public class OmsDbfTableReader { /** * Fast read access mode .
* @ param path the dbf path .
* @ return the read table .
* @ throws IOException */
public static Map < String , List < Object > > readDbf ( String path ) throws IOException { } } | OmsDbfTableReader reader = new OmsDbfTableReader ( ) ; reader . file = path ; reader . readTable ( ) ; return reader . outTabledata ; |
public class HdfsBasedUpdateProvider { /** * Get the update time of a { @ link Table }
* @ return the update time if available , 0 otherwise
* { @ inheritDoc }
* @ see HiveUnitUpdateProvider # getUpdateTime ( org . apache . hadoop . hive . ql . metadata . Table ) */
@ Override public long getUpdateTime ( Table ta... | try { return getUpdateTime ( table . getDataLocation ( ) ) ; } catch ( IOException e ) { throw new UpdateNotFoundException ( String . format ( "Failed to get update time for %s." , table . getCompleteName ( ) ) , e ) ; } |
public class TopologyPresenter { /** * - - - - - presenter lifecycle */
public void loadTopology ( ) { } } | if ( fake ) { getView ( ) . updateHosts ( deriveGroups ( generateFakeDomain ( ) ) , hostIndex ) ; } else { Outcome < FunctionContext > outcome = new Outcome < FunctionContext > ( ) { @ Override public void onFailure ( final FunctionContext context ) { Console . error ( "Unable to load topology" , context . getErrorMess... |
public class Admin { /** * @ throws PageException */
private void doGetLocales ( ) throws PageException { } } | Struct sct = new StructImpl ( StructImpl . TYPE_LINKED ) ; // Array arr = new ArrayImpl ( ) ;
String strLocale = getString ( "locale" , "english (united kingdom)" ) ; Locale locale = LocaleFactory . getLocale ( strLocale ) ; pageContext . setVariable ( getString ( "admin" , action , "returnVariable" ) , sct ) ; Map loc... |
public class FractionProcessor { /** * < p > Aktualisiert das prototypische Parse - Ergebnis mit dem richtigen
* Wert . < / p >
* < p > In der ersten Phase wurde prototypisch nur das Standardminimum
* des Elements als Wert angenommen . In dieser Phase wird stattdessen der
* geparste { @ code BigDecimal } - Wert... | if ( ! parsed . contains ( FractionalElement . FRACTION ) ) { return entity ; } BigDecimal fraction = parsed . get ( FractionalElement . FRACTION ) ; int min = entity . getMinimum ( this . element ) . intValue ( ) ; int max = entity . getMaximum ( this . element ) . intValue ( ) ; int num = this . getRealValue ( fracti... |
public class Sequence { /** * Sequencable */
@ Override public void start ( Screen screen ) { } } | Check . notNull ( screen ) ; this . screen = screen ; screen . addListener ( this ) ; renderer . setScreen ( screen ) ; renderer . initResolution ( resolution ) ; currentFrameRate = config . getOutput ( ) . getRate ( ) ; screen . requestFocus ( ) ; load ( ) ; onLoaded ( Constant . EXTRP , screen . getGraphic ( ) ) ; //... |
public class PathMatchingResourcePatternResolver { /** * Retrieve files that match the given path pattern ,
* checking the given directory and its subdirectories .
* @ param rootDir the directory to start from
* @ param pattern the pattern to match against ,
* relative to the root directory
* @ return the Set... | if ( ! rootDir . exists ( ) ) { // Silently skip non - existing directories .
return Collections . emptySet ( ) ; } if ( ! rootDir . isDirectory ( ) ) { // Complain louder if it exists but is no directory .
return Collections . emptySet ( ) ; } if ( ! rootDir . canRead ( ) ) { return Collections . emptySet ( ) ; } Stri... |
public class CmsContainerpageController { /** * Checks whether the given element should be inline editable . < p >
* @ param element the element
* @ param dragParent the element parent
* @ return < code > true < / code > if the element should be inline editable */
public boolean isInlineEditable ( CmsContainerPag... | CmsUUID elemView = element . getElementView ( ) ; return ! getData ( ) . isUseClassicEditor ( ) && CmsStringUtil . isEmptyOrWhitespaceOnly ( element . getNoEditReason ( ) ) && hasActiveSelection ( ) && matchRootView ( elemView ) && isContainerEditable ( dragParent ) && matchesCurrentEditLevel ( dragParent ) && ( getDat... |
public class AbstractHttpRequest { /** * Returns the last response stream as a string .
* @ return String */
public String getResponseBody ( ) { } } | String responseStr = "" ; if ( lastResponseStream == null ) { logger . error ( "Unable to parse JSON from empty response!" ) ; } else { Scanner s = new Scanner ( lastResponseStream ) ; s . useDelimiter ( "\\A" ) ; responseStr = ( s . hasNext ( ) ) ? s . next ( ) : "" ; s . close ( ) ; } return responseStr ; |
public class AbstractSession { /** * Close remaining browsers */
private void closeRemainingBrowsers ( ) { } } | List < AbstractQueueBrowser > browsersToClose = new ArrayList < > ( browsersMap . size ( ) ) ; synchronized ( browsersMap ) { browsersToClose . addAll ( browsersMap . values ( ) ) ; } for ( int n = 0 ; n < browsersToClose . size ( ) ; n ++ ) { QueueBrowser browser = browsersToClose . get ( n ) ; log . debug ( "Auto-clo... |
public class CmsTinyMCEWidget { /** * Used to fire the value changed event from native code . < p > */
private void fireChangeFromNative ( ) { } } | // skip firing the change event , if the external flag is set
if ( m_initialized && ! m_externalValueChange && m_active ) { Scheduler . get ( ) . scheduleDeferred ( new ScheduledCommand ( ) { public void execute ( ) { try { fireValueChange ( false ) ; } catch ( Throwable t ) { // this may happen when returning from ful... |
public class FastMoney { /** * ( non - Javadoc )
* @ see MonetaryAmount # scaleByPowerOfTen ( int ) */
@ Override public FastMoney scaleByPowerOfTen ( int n ) { } } | return new FastMoney ( getNumber ( ) . numberValue ( BigDecimal . class ) . scaleByPowerOfTen ( n ) , getCurrency ( ) , true ) ; |
public class lacp { /** * Use this API to fetch lacp resource of given name . */
public static lacp get ( nitro_service service , Long ownernode ) throws Exception { } } | lacp obj = new lacp ( ) ; obj . set_ownernode ( ownernode ) ; lacp response = ( lacp ) obj . get_resource ( service ) ; return response ; |
public class LiteProtoSubject { /** * TODO ( user ) : Maybe get a way to do this upstream . */
static String getTrimmedToString ( @ NullableDecl MessageLite messageLite ) { } } | String subjectString = String . valueOf ( messageLite ) ; String trimmedSubjectString = subjectString . trim ( ) ; if ( trimmedSubjectString . startsWith ( "# " ) ) { String objectToString = String . format ( "# %s@%s" , messageLite . getClass ( ) . getName ( ) , Integer . toHexString ( messageLite . hashCode ( ) ) ) ;... |
public class HeaderCell { /** * Render the contents of the body of the HTML th tag into the given { @ link AbstractRenderAppender }
* @ param appender the { @ link AbstractRenderAppender } for the output
* @ param jspFragmentOutput the result of having evaluated the tag ' s { @ link JspFragment }
* @ throws IOExc... | if ( _headerValue == null ) { appender . append ( jspFragmentOutput ) ; } else { _headerCellModel . setDataGridTagModel ( DataGridUtil . getDataGridTagModel ( getJspContext ( ) ) ) ; _headerCellModel . setBodyContent ( jspFragmentOutput ) ; _headerCellModel . setValue ( _headerValue ) ; getCellDecorator ( ) . decorate ... |
public class PersistentExecutorImpl { /** * DS method to activate this component .
* Best practice : this should be a protected method , not public or private
* @ param context DeclarativeService defined / populated component context
* @ throws MalformedObjectNameException */
@ Trivial protected void activate ( C... | Dictionary < String , ? > properties = context . getProperties ( ) ; final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "activate" , properties ) ; Config config = new Config ( properties ) ; configRef . set ( config ) ; // Precedence for id... |
public class QualityProfileDao { /** * All descendants , in any order . The specified profiles are not included into results . */
public Collection < QProfileDto > selectDescendants ( DbSession dbSession , Collection < QProfileDto > profiles ) { } } | if ( profiles . isEmpty ( ) ) { return emptyList ( ) ; } Collection < QProfileDto > children = selectChildren ( dbSession , profiles ) ; List < QProfileDto > descendants = new ArrayList < > ( children ) ; descendants . addAll ( selectDescendants ( dbSession , children ) ) ; return descendants ; |
public class StreamEx { /** * Returns a sequential ordered { @ code StreamEx } containing the results of
* applying the given mapper function to the all possible pairs of elements
* taken from the provided list .
* The indices of two elements supplied to the mapper function are always
* ordered : first element ... | return of ( new PairPermutationSpliterator < > ( list , mapper ) ) ; |
public class XMLAssert { /** * Assert that the evaluation of two Xpaths in the same XML string are
* equal
* @ param controlXpath
* @ param testXpath
* @ param inXMLString
* @ throws SAXException
* @ throws IOException */
public static void assertXpathValuesEqual ( String controlXpath , String testXpath , S... | assertXpathValuesEqual ( controlXpath , testXpath , XMLUnit . buildControlDocument ( inXMLString ) ) ; |
public class DBWrapperFactory { /** * Create a wrapper around a collection of entities .
* @ param collection The collection to be wrapped .
* @ param entityClass The class of the entity that the collection contains .
* @ param isRevisionCollection Whether or not the collection is a collection of revision entitie... | "unchecked" , "rawtypes" } ) public < T extends BaseWrapper < T > , U > CollectionWrapper < T > createCollection ( final Collection < U > collection , final Class < U > entityClass , boolean isRevisionCollection , final Class < T > wrapperClass ) { if ( collection == null ) { return null ; } // Create the key
final DBW... |
public class SarlDocumentationParser { /** * Replies the tag that is matching the given text .
* @ param text the text to match .
* @ return the tag or { @ code null } . */
public Tag getTagForPattern ( CharSequence text ) { } } | for ( final Tag tag : Tag . values ( ) ) { Pattern pattern = this . compiledPatterns . get ( tag ) ; if ( pattern == null ) { pattern = Pattern . compile ( "^\\s*" + getPattern ( tag ) , Pattern . DOTALL ) ; // $ NON - NLS - 1 $
this . compiledPatterns . put ( tag , pattern ) ; } final Matcher matcher = pattern . match... |
public class SafariDriver { /** * Open either a new tab or window , depending on what is requested , and return the window handle
* without switching to it .
* @ return The handle of the new window . */
@ Beta public String newWindow ( WindowType type ) { } } | Response response = execute ( "SAFARI_NEW_WINDOW" , ImmutableMap . of ( "newTab" , type == WindowType . TAB ) ) ; return ( String ) response . getValue ( ) ; |
public class hqlLexer { /** * $ ANTLR start " LEADING " */
public final void mLEADING ( ) throws RecognitionException { } } | try { int _type = LEADING ; int _channel = DEFAULT_TOKEN_CHANNEL ; // hql . g : 40:9 : ( ' leading ' )
// hql . g : 40:11 : ' leading '
{ match ( "leading" ) ; if ( state . failed ) return ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving
} |
public class ComputeNodesImpl { /** * Adds a user account to the specified compute node .
* You can add a user account to a node only when it is in the idle or running state .
* @ param poolId The ID of the pool that contains the compute node .
* @ param nodeId The ID of the machine on which you want to create a ... | if ( this . client . batchUrl ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.batchUrl() is required and cannot be null." ) ; } if ( poolId == null ) { throw new IllegalArgumentException ( "Parameter poolId is required and cannot be null." ) ; } if ( nodeId == null ) { throw new IllegalArgum... |
public class Jenkins { /** * Run arbitrary Groovy script and return result as plain text . */
public void doScriptText ( StaplerRequest req , StaplerResponse rsp ) throws IOException , ServletException { } } | _doScript ( req , rsp , req . getView ( this , "_scriptText.jelly" ) , FilePath . localChannel , getACL ( ) ) ; |
public class LDAPRule { /** * Method description
* @ param ldif
* @ param target
* @ throws LDAPException */
private void importLdif ( String ldif , Object target ) throws LDAPException { } } | if ( ldif != null ) { InputStream stream = target . getClass ( ) . getResourceAsStream ( ldif ) ; if ( stream != null ) { LDIFReader reader = new LDIFReader ( stream ) ; directoryServer . importFromLDIF ( true , reader ) ; } else { throw new RuntimeException ( "could not find ldif " . concat ( ldif ) ) ; } } |
public class DefaultBeanContext { /** * Registers an active configuration .
* @ param configuration The configuration to register */
protected void registerConfiguration ( @ Nonnull BeanConfiguration configuration ) { } } | ArgumentUtils . requireNonNull ( "configuration" , configuration ) ; beanConfigurations . put ( configuration . getName ( ) , configuration ) ; ClassLoadingReporter . reportPresent ( configuration . getClass ( ) ) ; |
public class AccountTakeoverActionTypeMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AccountTakeoverActionType accountTakeoverActionType , ProtocolMarshaller protocolMarshaller ) { } } | if ( accountTakeoverActionType == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( accountTakeoverActionType . getNotify ( ) , NOTIFY_BINDING ) ; protocolMarshaller . marshall ( accountTakeoverActionType . getEventAction ( ) , EVENTACTION_BIN... |
public class GenericBoJdbcDao { /** * Create a new BO or update an existing one .
* @ param conn
* @ param bo
* @ return
* @ since 0.8.1 */
protected DaoResult createOrUpdate ( Connection conn , T bo ) { } } | if ( bo == null ) { return null ; } DaoResult result = create ( conn , bo ) ; DaoOperationStatus status = result . getStatus ( ) ; if ( status == DaoOperationStatus . DUPLICATED_VALUE || status == DaoOperationStatus . DUPLICATED_UNIQUE ) { result = update ( conn , bo ) ; } return result ; |
public class MockEventListenerList { /** * Add a new listener .
* @ param aListener
* The listener to be added . May not be < code > null < / code > .
* @ return { @ link EChange } . */
@ Nonnull public EChange addListener ( @ Nonnull final EventListener aListener ) { } } | ValueEnforcer . notNull ( aListener , "Listener" ) ; // Small consistency check
if ( ! ( aListener instanceof ServletContextListener ) && ! ( aListener instanceof HttpSessionListener ) && ! ( aListener instanceof ServletRequestListener ) ) { LOGGER . warn ( "Passed mock listener is none of ServletContextListener, HttpS... |
public class SimpleJob { /** * Easily supports the Join . To use the setSimpleJoin ,
* you must be a size master data appear in the memory of the task .
* @ param masterLabels label of master data
* @ param masterColumn master column
* @ param dataColumn data column
* @ param masterPath master data HDFS path ... | String separator = conf . get ( SEPARATOR ) ; return setSimpleJoin ( masterLabels , masterColumn , dataColumn , masterPath , separator , false ) ; |
public class CmsJspStatusBean { /** * Initializes the members of this bean with the information retrieved from the current request . < p >
* @ param req the JSP request
* @ param t the exception that lead to the error */
protected void initMembers ( HttpServletRequest req , Throwable t ) { } } | // get the status error attribute values from the request
m_servletName = ( String ) req . getAttribute ( ERROR_SERVLET_NAME ) ; m_errorMessage = ( String ) req . getAttribute ( ERROR_MESSAGE ) ; m_requestUri = ( String ) req . getAttribute ( ERROR_REQUEST_URI ) ; m_statusCode = ( Integer ) req . getAttribute ( ERROR_S... |
public class BMPCLocalLauncher { /** * Install Local BrowserMob Proxy . */
public synchronized static void install ( ) { } } | if ( ! isInstalled ( ) ) { InputStream is = BMPCLocalLauncher . class . getResourceAsStream ( BMP_LOCAL_ZIP_RES ) ; try { // Unzip BrowserMob Proxy contained in the project " / resources "
unzip ( is , BMPC_USER_DIR ) ; // Set executable permissions on the BrowserMob Proxy lanching scripts
new File ( BMP_LOCAL_EXEC_UNI... |
public class LeafNode { /** * Publishes an event to the node . This is an empty event
* with no item .
* This is only acceptable for nodes with { @ link ConfigureForm # isPersistItems ( ) } = false
* and { @ link ConfigureForm # isDeliverPayloads ( ) } = false .
* @ throws XMPPErrorException
* @ throws NoResp... | PubSub packet = createPubsubPacket ( Type . set , new NodeExtension ( PubSubElementType . PUBLISH , getId ( ) ) ) ; pubSubManager . getConnection ( ) . createStanzaCollectorAndSend ( packet ) . nextResultOrThrow ( ) ; |
public class SDLayerParams { /** * Clear any previously set weight / bias parameters ( including their shapes ) */
public void clear ( ) { } } | weightParams . clear ( ) ; biasParams . clear ( ) ; paramsList = null ; weightParamsList = null ; biasParamsList = null ; |
public class HtmlDocWriter { /** * Get the link .
* @ param sectionName The section name combined with where to which the link
* will be created .
* @ param where The fragment combined with sectionName to which the link
* will be created .
* @ return a DocLink object for the hyper link */
public DocLink getDo... | return DocLink . fragment ( sectionName . getName ( ) + getName ( where ) ) ; |
public class CmsModelGroupHelper { /** * Updates model group resources to the changed data structure . < p >
* This step is necessary when updating from version 10.0 . x to 10.5 . x . < p >
* @ param request the request
* @ param response the response
* @ param basePath the path to the model group , or the base... | if ( CmsFlexController . isCmsRequest ( request ) ) { try { CmsFlexController controller = CmsFlexController . getController ( request ) ; CmsObject cms = controller . getCmsObject ( ) ; CmsResource base = cms . readResource ( basePath ) ; List < CmsResource > resources ; I_CmsResourceType groupType = OpenCms . getReso... |
public class ClassApi { /** * Calculates distance between from and to methods .
* @ return - 1 if this converter can not handle method value greater or equals then 0 otherwise
* ( 0 - highest priority ) */
public static int methodDistance ( Method from , Method to ) { } } | return from . getName ( ) . equals ( to . getName ( ) ) && to . getDeclaringClass ( ) . isAssignableFrom ( from . getDeclaringClass ( ) ) ? classDistance ( from . getDeclaringClass ( ) , to . getDeclaringClass ( ) ) : - 1 ; |
public class Payment { /** * Fetches all Payments belonging to the PaymentRequest with the specified
* ID .
* @ see < a
* href = " https : / / www . apruve . com / doc / developers / rest - api / " > https : / / www . apruve . com / doc / developers / rest - api / < / a >
* @ param paymentRequestId
* The ID o... | return ApruveClient . getInstance ( ) . index ( getPaymentsPath ( paymentRequestId ) , new GenericType < List < Payment > > ( ) { } ) ; |
public class CookieVersionData { /** * @ see
* com . ibm . ws . http . channel . internal . values . CookieData # validForHeader ( com . ibm
* . wsspi . genericbnf . HeaderKeys , boolean ) */
@ Override public boolean validForHeader ( HeaderKeys hdr , boolean includesDollar ) { } } | // Cookie headers need the $ symbol
if ( HttpHeaderKeys . HDR_COOKIE . equals ( hdr ) || HttpHeaderKeys . HDR_COOKIE2 . equals ( hdr ) ) { return includesDollar ; } // Set - Cookie headers do not
if ( HttpHeaderKeys . HDR_SET_COOKIE . equals ( hdr ) || HttpHeaderKeys . HDR_SET_COOKIE2 . equals ( hdr ) ) { return ! incl... |
public class BusItinerary { /** * Replies the path representation of this itinerary .
* @ param path the path to fill . */
@ Pure public void toPath2D ( Path2d path ) { } } | if ( isValidPrimitive ( ) ) { final BusItineraryHalt startTerminus = getBusHaltAt ( 0 ) ; final BusItineraryHalt endTerminus = getBusHaltAt ( getValidBusHaltCount ( ) - 1 ) ; if ( startTerminus . getRoadSegmentIndex ( ) == endTerminus . getRoadSegmentIndex ( ) ) { // One segment to render
double p1 = startTerminus . ge... |
public class AbstractJasperReportOutputFormat { /** * Renders the jasper report .
* @ param jobId the job ID
* @ param requestData the data from the client , required for writing .
* @ param config the configuration object representing the server side configuration .
* @ param configDir the directory that conta... | final String templateName = requestData . getString ( Constants . JSON_LAYOUT_KEY ) ; final Template template = config . getTemplate ( templateName ) ; final File jasperTemplateFile = new File ( configDir , template . getReportTemplate ( ) ) ; final File jasperTemplateBuild = this . workingDirectories . getBuildFileFor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.