signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class XsdAsmAttributes { /** * Generates a method to add a given { @ link XsdAttribute } . * @ param classWriter The { @ link ClassWriter } of the class where the method that adds the { @ link XsdAttribute } will * be generated . * @ param elementAttribute The { @ link XsdAttribute } containing the informa...
String attributeName = ATTRIBUTE_PREFIX + getCleanName ( elementAttribute ) ; String camelCaseName = attributeName . toLowerCase ( ) . charAt ( 0 ) + attributeName . substring ( 1 ) ; String attributeClassType = getFullClassTypeName ( getAttributeName ( elementAttribute ) , apiName ) ; String attributeGroupInterfaceTyp...
public class WebGroup { /** * Method getSessionContext . * @ param moduleConfig * @ param webApp * @ return IHttpSessionContext */ @ SuppressWarnings ( "unchecked" ) public IHttpSessionContext getSessionContext ( com . ibm . ws . container . DeployedModule moduleConfig , WebApp webApp , ArrayList [ ] listeners ) ...
// System . out . println ( " WebGroup createSC " ) ; return ( ( VirtualHost ) parent ) . getSessionContext ( moduleConfig , webApp , listeners ) ;
public class MobileApplication { /** * Gets the appStore value for this MobileApplication . * @ return appStore * The app store the mobile application belongs to . This attribute * is required for * creation and then is read - only . */ public com . google . api . ads . admanager . axis . v201811 . MobileApplicat...
return appStore ;
public class JspUrlResourceFileSource { /** * / * ( non - Javadoc ) * @ see org . archive . wayback . resourcestore . resourcefile . ResourceFileSource # getBasename ( java . lang . String ) */ public String getBasename ( String path ) { } }
int sepIdx = path . lastIndexOf ( WEB_SEPARATOR_CHAR ) ; if ( sepIdx != - 1 ) { return path . substring ( sepIdx + 1 ) ; } return path ;
public class SmartObject { /** * This protected method allows a subclass to add to the mappers a class type that can be * serialized using mixin class . * @ param serializable The type of class that can be serialized using its toString ( ) method . * @ param mixin The type of class that can be used to serialized ...
safeMapper . addMixIn ( serializable , mixin ) ; fullMapper . addMixIn ( serializable , mixin ) ;
public class StatementParameter { /** * 生成PreparedStatementSetter对象 . * @ return PreparedStatementSetter */ public PreparedStatementSetter getParameters ( ) { } }
if ( list . size ( ) == 0 ) { return null ; } PreparedStatementSetter param = new PreparedStatementSetter ( ) { @ Override public void setValues ( PreparedStatement pstmt ) { try { StatementParameter . this . setValues ( pstmt ) ; } catch ( SQLException e ) { throw new InvalidParamDataAccessException ( e ) ; } } } ; re...
public class MpxjQuery { /** * Helper method called recursively to list child tasks . * @ param task task whose children are to be displayed * @ param indent whitespace used to indent hierarchy levels */ private static void listHierarchy ( Task task , String indent ) { } }
for ( Task child : task . getChildTasks ( ) ) { System . out . println ( indent + "Task: " + child . getName ( ) + "\t" + child . getStart ( ) + "\t" + child . getFinish ( ) ) ; listHierarchy ( child , indent + " " ) ; }
public class ResteasyClientFactoryImpl { /** * N . B . This method signature may change in the future to add new parameters * @ param fastFail * @ param authScope * @ param credentials * @ param preemptiveAuth * @ param storeCookies * @ param customiser * @ return */ public Consumer < HttpClientBuilder > ...
// Customise timeouts if fast fail mode is enabled if ( fastFail ) { customiser = concat ( customiser , b -> { RequestConfig . Builder requestBuilder = RequestConfig . custom ( ) ; requestBuilder . setConnectTimeout ( ( int ) fastFailConnectionTimeout . getMilliseconds ( ) ) . setSocketTimeout ( ( int ) fastFailSocketT...
public class IfcCartesianPointList2DImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < ListOfIfcLengthMeasure > getCoordList ( ) { } }
return ( EList < ListOfIfcLengthMeasure > ) eGet ( Ifc4Package . Literals . IFC_CARTESIAN_POINT_LIST2_D__COORD_LIST , true ) ;
public class RLS { /** * Learn a new instance with online regression . * @ param x the training instances . * @ param y the target values . */ public void learn ( double [ ] [ ] x , double y [ ] ) { } }
if ( x . length != y . length ) { throw new IllegalArgumentException ( String . format ( "Input vector x of size %d not equal to length %d of y" , x . length , y . length ) ) ; } for ( int i = 0 ; i < x . length ; i ++ ) { learn ( x [ i ] , y [ i ] ) ; }
public class ConciseSet { /** * { @ inheritDoc } */ @ Override public ConciseSet convert ( Collection < Integer > c ) { } }
ConciseSet res = empty ( ) ; Collection < Integer > sorted ; if ( c != null ) { if ( c instanceof SortedSet < ? > && ( ( SortedSet < ? > ) c ) . comparator ( ) == null ) { sorted = c ; } else { sorted = new ArrayList < Integer > ( c ) ; Collections . sort ( ( List < Integer > ) sorted ) ; } for ( int i : sorted ) { if ...
public class Async { /** * Returns an Observable that starts the specified asynchronous factory function whenever a new observer * subscribes . * < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / deferFuture . s . png " alt = " " > * @ param < T >...
return OperatorDeferFuture . deferFuture ( observableFactoryAsync , scheduler ) ;
public class ServletConfidentialityConstraintHandler { /** * Use the HttpServerExchange supplied to check if this request is already ' sufficiently ' confidential . * Here we say ' sufficiently ' as sub - classes can override this and maybe even go so far as querying the actual SSLSession . * @ param exchange - The...
ServletRequestContext src = exchange . getAttachment ( ServletRequestContext . ATTACHMENT_KEY ) ; if ( src != null ) { return src . getOriginalRequest ( ) . isSecure ( ) ; } return super . isConfidential ( exchange ) ;
public class JobHistoryService { /** * Returns the most recent { @ link Flow } runs within that time range , up to * { @ code limit } instances . If the { @ code version } parameter is non - null , the * returned results will be restricted to those matching this app version . * @ param cluster the cluster where t...
// TODO : use RunMatchFilter to limit scan on the server side byte [ ] rowPrefix = Bytes . toBytes ( cluster + Constants . SEP + user + Constants . SEP + appId + Constants . SEP ) ; Scan scan = createFlowScan ( rowPrefix , limit , version ) ; // set the start and stop rows for scan so that it ' s time bound if ( endTim...
public class Overrider { /** * Checks if override is present , but it won ' t be actually read * @ param operation name of the operation * @ return true if override is present */ public boolean hasOverride ( String operation ) { } }
boolean result = false ; if ( this . overrideOnce . containsKey ( operation ) == true || this . override . containsKey ( operation ) == true ) { result = true ; } return result ;
public class Builder { /** * get distance of one GeneralName from another * @ param base GeneralName at base of subtree * @ param test GeneralName to be tested against base * @ param incomparable the value to return if the names are * incomparable * @ return distance of test name from base , where 0 * means...
switch ( base . constrains ( test ) ) { case GeneralNameInterface . NAME_DIFF_TYPE : if ( debug != null ) { debug . println ( "Builder.distance(): Names are different types" ) ; } return incomparable ; case GeneralNameInterface . NAME_SAME_TYPE : if ( debug != null ) { debug . println ( "Builder.distance(): Names are s...
public class BoxFile { /** * Gets any previous versions of this file . Note that only users with premium accounts will be able to retrieve * previous versions of their files . * @ return a list of previous file versions . */ public Collection < BoxFileVersion > getVersions ( ) { } }
URL url = VERSIONS_URL_TEMPLATE . build ( this . getAPI ( ) . getBaseURL ( ) , this . getID ( ) ) ; BoxAPIRequest request = new BoxAPIRequest ( this . getAPI ( ) , url , "GET" ) ; BoxJSONResponse response = ( BoxJSONResponse ) request . send ( ) ; JsonObject jsonObject = JsonObject . readFrom ( response . getJSON ( ) )...
public class Viterbi { /** * Viterbi inference . * @ param seq the seq */ public void viterbiInference ( List seq ) { } }
int i , j , k ; int seqLen = seq . size ( ) ; if ( seqLen <= 0 ) { return ; } if ( memorySize < seqLen ) { allocateMemory ( seqLen ) ; } // compute Vi for the first position in the sequence computeVi ( seq , 0 , Vi , true ) ; for ( j = 0 ; j < numLabels ; j ++ ) { memory [ 0 ] [ j ] . first = Vi . vect [ j ] ; memory [...
public class JDBCStorageConnection { /** * Returns from storage the next page of nodes and its properties . */ public List < NodeDataIndexing > getNodesAndProperties ( String lastNodeId , int offset , int limit ) throws RepositoryException , IllegalStateException { } }
List < NodeDataIndexing > result = new ArrayList < NodeDataIndexing > ( ) ; checkIfOpened ( ) ; try { startTxIfNeeded ( ) ; ResultSet resultSet = findNodesAndProperties ( lastNodeId , offset , limit ) ; int processed = 0 ; try { TempNodeData tempNodeData = null ; while ( resultSet . next ( ) ) { if ( tempNodeData == nu...
public class DSFactory { /** * 创建数据源实现工厂 < br > * 此方法通过 “ 试错 ” 方式查找引入项目的连接池库 , 按照优先级寻找 , 一旦寻找到则创建对应的数据源工厂 < br > * 连接池优先级 : Hikari > Druid > Tomcat > Dbcp > C3p0 > Hutool Pooled * @ return 日志实现类 * @ since 4.1.3 */ private static DSFactory doCreate ( Setting setting ) { } }
try { return new HikariDSFactory ( setting ) ; } catch ( NoClassDefFoundError e ) { // ignore } try { return new DruidDSFactory ( setting ) ; } catch ( NoClassDefFoundError e ) { // ignore } try { return new TomcatDSFactory ( setting ) ; } catch ( NoClassDefFoundError e ) { // 如果未引入包 , 此处会报org . apache . tomcat . jdbc ...
public class DefaultSelendroidDriver { /** * @ see org . openqa . selenium . android . server . AndroidDriver # takeScreenshot ( ) */ @ Override @ SuppressWarnings ( "deprecation" ) public byte [ ] takeScreenshot ( ) { } }
ViewHierarchyAnalyzer viewAnalyzer = ViewHierarchyAnalyzer . getDefaultInstance ( ) ; // TODO ddary review later , but with getRecentDecorView ( ) it seems to work better // long drawingTime = 0; // View container = null ; // for ( View view : viewAnalyzer . getTopLevelViews ( ) ) { // if ( view ! = null & & view . isS...
public class SecondsBasedEntryTaskScheduler { /** * Cancels the scheduled future and removes the entries map for the given second If no entries are left * Cleans up parent container ( second - > entries map ) if it doesn ' t hold anymore items this second . * Cancels associated scheduler ( second - > scheduler map ...
if ( entries . isEmpty ( ) ) { scheduledEntries . remove ( second ) ; ScheduledFuture removedFeature = scheduledTaskMap . remove ( second ) ; if ( removedFeature != null ) { removedFeature . cancel ( false ) ; } }
public class WavefrontStrings { /** * Create a map of tags for wavefront . * The tag values are escaped and should be surrounded by double quotes . * This function does not put the surrounding quotes around the tag values . */ public static Map < String , String > tags ( Tags tags ) { } }
return tags . stream ( ) . map ( WavefrontStrings :: createTagEntry ) . flatMap ( opt -> opt . map ( Stream :: of ) . orElseGet ( Stream :: empty ) ) . map ( WavefrontStrings :: maybeTruncateTagEntry ) . collect ( Collectors . toMap ( Map . Entry :: getKey , Map . Entry :: getValue ) ) ;
public class CommonOps_DDRM { /** * Element - wise exp operation < br > * c < sub > ij < / sub > = Math . log ( a < sub > ij < / sub > ) * @ param A input * @ param C output ( modified ) */ public static void elementExp ( DMatrixD1 A , DMatrixD1 C ) { } }
if ( A . numCols != C . numCols || A . numRows != C . numRows ) { throw new MatrixDimensionException ( "All matrices must be the same shape" ) ; } int size = A . getNumElements ( ) ; for ( int i = 0 ; i < size ; i ++ ) { C . data [ i ] = Math . exp ( A . data [ i ] ) ; }
public class JasperReportBuilder { /** * Set the directory and test that the directory exists and is contained within the Configuration * directory . * @ param directory the new directory */ public void setDirectory ( final String directory ) { } }
this . directory = new File ( this . configuration . getDirectory ( ) , directory ) ; if ( ! this . directory . exists ( ) ) { throw new IllegalArgumentException ( String . format ( "Directory does not exist: %s.\n" + "Configuration contained value %s which is supposed to be relative to " + "configuration directory." ,...
public class ProcessCommonJSModules { /** * Recognize if a node is a dynamic module import . Currently only the webpack dynamic import is * recognized : * < ul > * < li > _ _ webpack _ require _ _ . e ( 0 ) . then ( function ( ) { return _ _ webpack _ require _ _ ( 4 ) ; } ) * < li > Promise . all ( [ _ _ webpa...
if ( n == null || resolutionMode != ModuleLoader . ResolutionMode . WEBPACK ) { return false ; } if ( n . isFunction ( ) && isWebpackRequireEnsureCallback ( n ) ) { return true ; } return false ;
public class LocalDateTime { /** * Queries this date - time using the specified query . * This queries this date - time using the specified query strategy object . * The { @ code TemporalQuery } object defines the logic to be used to * obtain the result . Read the documentation of the query to understand * what...
if ( query == TemporalQueries . localDate ( ) ) { return ( R ) date ; } return ChronoLocalDateTime . super . query ( query ) ;
public class Transition { /** * Adds a listener to the set of listeners that are sent events through the * life of an animation , such as start , repeat , and end . * @ param listener the listener to be added to the current set of listeners * for this animation . * @ return This transition object . */ @ NonNull...
if ( mListeners == null ) { mListeners = new ArrayList < TransitionListener > ( ) ; } mListeners . add ( listener ) ; return this ;
public class TangoCacheManager { /** * Get cache of a command * @ param cmd * The command * @ return The command cache */ public synchronized SelfPopulatingCache getCommandCache ( final CommandImpl cmd ) { } }
SelfPopulatingCache cache = null ; if ( cmd . getName ( ) . equalsIgnoreCase ( DeviceImpl . STATE_NAME ) ) { cache = stateCache . getCache ( ) ; } else if ( cmd . getName ( ) . equalsIgnoreCase ( DeviceImpl . STATUS_NAME ) ) { cache = statusCache . getCache ( ) ; } else { CommandCache cmdCache = commandCacheMap . get (...
public class HopkinsStatisticClusteringTendency { /** * Search nearest neighbors for < em > real < / em > data members . * @ param knnQuery KNN query * @ param relation Data relation * @ return Aggregated 1NN distances */ protected double computeNNForRealData ( final KNNQuery < NumberVector > knnQuery , Relation ...
double w = 0. ; ModifiableDBIDs dataSampleIds = DBIDUtil . randomSample ( relation . getDBIDs ( ) , sampleSize , random ) ; for ( DBIDIter iter = dataSampleIds . iter ( ) ; iter . valid ( ) ; iter . advance ( ) ) { final double kdist = knnQuery . getKNNForDBID ( iter , k + 1 ) . getKNNDistance ( ) ; w += MathUtil . pow...
public class MultiLanguageTextProcessor { /** * Format the given multiLanguageText by removing duplicated white spaces , underscores and camel cases in all entries . * @ param multiLanguageText the multiLanguageText to format . * @ return the formatted multiLanguageText . */ public static MultiLanguageText . Builde...
for ( final MapFieldEntry . Builder entryBuilder : multiLanguageText . getEntryBuilderList ( ) ) { final String value = entryBuilder . getValue ( ) ; entryBuilder . clearValue ( ) ; entryBuilder . setValue ( format ( value ) ) ; } return multiLanguageText ;
public class LongRangeRandomizer { /** * Create a new { @ link LongRangeRandomizer } . * @ param min min value * @ param max max value * @ param seed initial seed * @ return a new { @ link LongRangeRandomizer } . */ public static LongRangeRandomizer aNewLongRangeRandomizer ( final Long min , final Long max , fi...
return new LongRangeRandomizer ( min , max , seed ) ;
public class WikipediaTemplateInfoGenerator { /** * Start generator */ public void process ( ) throws Exception { } }
WikipediaTemplateInfo info = new WikipediaTemplateInfo ( getWiki ( ) ) ; pageTableExists = info . tableExists ( GeneratorConstants . TABLE_TPLID_PAGEID ) ; revisionTableExists = info . tableExists ( GeneratorConstants . TABLE_TPLID_REVISIONID ) ; if ( ! pageTableExists && ! revisionTableExists && mode . active_for_page...
public class AnalysisContext { /** * Report an error */ static public void logError ( String msg , Exception e ) { } }
AnalysisContext currentAnalysisContext2 = currentAnalysisContext ( ) ; if ( currentAnalysisContext2 == null ) { if ( e instanceof NoSuchBugPattern ) { return ; } /* if ( false & & SystemProperties . ASSERTIONS _ ENABLED ) { AssertionError e2 = new AssertionError ( " Exception logged with no analysis context " ) ; e...
public class CompilerInput { /** * Gets a list of types provided , but does not attempt to * regenerate the dependency information . Typically this occurs * from module rewriting . */ ImmutableCollection < String > getKnownProvides ( ) { } }
return concat ( dependencyInfo != null ? dependencyInfo . getProvides ( ) : ImmutableList . < String > of ( ) , extraProvides ) ;
public class WebcamUtils { /** * Capture image as BYteBuffer . * @ param webcam the webcam from which image should be obtained * @ param format the file format * @ return Byte buffer */ public static final ByteBuffer getImageByteBuffer ( Webcam webcam , String format ) { } }
return ByteBuffer . wrap ( getImageBytes ( webcam , format ) ) ;
public class UrlUtils { /** * Retrieve the var value for varName from a HTTP query string ( format is * " var1 = val1 & amp ; var2 = val2 " ) . * @ param varName the name . * @ param haystack the haystack . * @ return variable value for varName */ public static String getVarFromQueryString ( String varName , St...
if ( haystack == null || haystack . length ( ) == 0 ) { return null ; } String modifiedHaystack = haystack ; if ( modifiedHaystack . charAt ( 0 ) == '?' ) { modifiedHaystack = modifiedHaystack . substring ( 1 ) ; } String [ ] vars = modifiedHaystack . split ( "&" ) ; for ( String var : vars ) { String [ ] tuple = var ....
public class ManagementResource { /** * Get the file name extension from its name . * @ param filename the filename . * @ return the file name extension . */ private static String getFileExtension ( final String filename ) { } }
String extension = "" ; int i = filename . lastIndexOf ( '.' ) ; int p = Math . max ( filename . lastIndexOf ( '/' ) , filename . lastIndexOf ( '\\' ) ) ; if ( i > p ) extension = filename . substring ( i + 1 ) ; return extension ;
public class Matrices { /** * MatrixSort is able to sort matrix rows when matrix is stored in one dimensional * array as in DenseMatrix64F . * < p > Sort is using Quick Sort algorithm . * @ param matrix * @ param comparator */ public static void sort ( DenseMatrix64F matrix , RowComparator comparator ) { } }
int len = matrix . numCols ; quickSort ( matrix . data , 0 , matrix . numRows - 1 , len , comparator , new double [ len ] , new double [ len ] ) ;
public class AsciidocRuleParserPlugin { /** * Evaluates required concepts of a rule . * @ param ruleSource * The rule source . * @ param attributes * The attributes of an asciidoc rule block * @ param id * The id . * @ return A map where the keys represent the ids of required concepts and the * values i...
Map < String , String > requiresDeclarations = getReferences ( attributes , REQUIRES_CONCEPTS ) ; Map < String , Boolean > required = new HashMap < > ( ) ; for ( Map . Entry < String , String > requiresEntry : requiresDeclarations . entrySet ( ) ) { String conceptId = requiresEntry . getKey ( ) ; String dependencyAttri...
public class IOUtil { /** * Note : copied from Google Guava under Apache License v2. * Maps a file in to memory as per * { @ link FileChannel # map ( java . nio . channels . FileChannel . MapMode , long , long ) } * using the requested { @ link MapMode } . * < p > Files are mapped from offset 0 to { @ code size...
N . checkArgNotNull ( file ) ; N . checkArgNotNull ( mode ) ; RandomAccessFile raf = null ; try { raf = new RandomAccessFile ( file , mode == MapMode . READ_ONLY ? "r" : "rw" ) ; return raf . getChannel ( ) . map ( mode , offset , len ) ; } catch ( IOException e ) { throw new UncheckedIOException ( e ) ; } finally { IO...
public class HttpFields { /** * Get multiple header of the same name * @ param header the header * @ return List the values */ public List < String > getValuesList ( HttpHeader header ) { } }
final List < String > list = new ArrayList < > ( ) ; for ( HttpField f : this ) if ( f . getHeader ( ) == header ) list . add ( f . getValue ( ) ) ; return list ;
public class LogRecord { /** * 次のメッセージを持つ操作ログオブジェクトを作成します 。 * @ param logger * ロガー * @ param position * 要素位置 * @ param testStep * テストステップ * @ param pattern * メッセージパターン * @ param params * メッセージパラメーター * @ return 操作ログ */ public static LogRecord create ( SitLogger logger , ElementPosition p...
Object [ ] newParams = new Object [ ] { testStep . getItemName ( ) , testStep . getLocator ( ) } ; newParams = ArrayUtils . addAll ( newParams , params ) ; return create ( logger , position , testStep , pattern . getPattern ( ) , newParams ) ;
public class ExampleFourierTransform { /** * Demonstration of how to apply a box filter in the frequency domain and compares the results * to a box filter which has been applied in the spatial domain */ public static void applyBoxFilter ( GrayF32 input ) { } }
// declare storage GrayF32 boxImage = new GrayF32 ( input . width , input . height ) ; InterleavedF32 boxTransform = new InterleavedF32 ( input . width , input . height , 2 ) ; InterleavedF32 transform = new InterleavedF32 ( input . width , input . height , 2 ) ; GrayF32 blurredImage = new GrayF32 ( input . width , inp...
public class RegexRequestMatcher { /** * Performs the match of the request URL ( { @ code servletPath + pathInfo + queryString } ) against * the compiled * pattern . * @ param request the request to match * @ return true if the pattern matches the URL , false otherwise . */ public boolean matches ( HttpServletR...
if ( httpMethod != null && httpMethod != HttpMethod . valueOf ( request . getMethod ( ) ) ) { return false ; } String url = request . getServletPath ( ) ; String pathInfo = request . getPathInfo ( ) ; String query = request . getQueryString ( ) ; if ( pathInfo != null || query != null ) { StringBuilder sb = new StringB...
public class ConfigEntry { /** * This method returns an array of DependencyId objects that specified addditional cache * indentifers that associated multiple cache entries to the same group identiifier . * @ return Array of DependencyId objects */ public DependencyId [ ] getDependencyIds ( ) { } }
DependencyId [ ] depIds = new DependencyId [ configEntry . dependencyIds . length ] ; for ( int i = 0 ; i < configEntry . dependencyIds . length ; i ++ ) { depIds [ i ] = new DependencyId ( configEntry . dependencyIds [ i ] ) ; } return depIds ;
public class CUstreamWriteValue_flags { /** * Returns the String identifying the given CUstreamWriteValue _ flags * @ param n The CUstreamWriteValue _ flags * @ return The String identifying the given CUstreamWriteValue _ flags */ public static String stringFor ( int n ) { } }
if ( n == 0 ) { return "CU_STREAM_WRITE_VALUE_DEFAULT" ; } String result = "" ; if ( ( n & CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER ) != 0 ) result += "CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER " ; return result ;
public class ResourceLimit { /** * Check if the node has enough memory to run tasks * @ param node node to check * @ return true if the node has enough memory , false otherwise */ public boolean hasEnoughMemory ( ClusterNode node ) { } }
int total = node . getTotal ( ) . memoryMB ; int free = node . getFree ( ) . memoryMB ; if ( free < nodeReservedMemoryMB ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( node . getHost ( ) + " not enough memory." + " totalMB:" + total + " free:" + free + " limit:" + nodeReservedMemoryMB ) ; } return false ; } return...
public class DataSiftPylon { /** * Compile a CSDL string to a stream hash to which you can later subscribe and receive interactions from . * For information on this endpoint see documentation page : * http : / / dev . datasift . com / pylon / docs / api / pylon - api - endpoints / pyloncompile * @ param csdl the ...
FutureData < PylonStream > future = new FutureData < PylonStream > ( ) ; URI uri = newParams ( ) . forURL ( config . newAPIEndpointURI ( COMPILE ) ) ; JSONRequest request = config . http ( ) . postJSON ( uri , new PageReader ( newRequestCallback ( future , new PylonStream ( ) , config ) ) ) . addField ( "csdl" , csdl )...
public class ComputeExecutor { /** * Helper method to convert type labels to IDs * @ param labelSet * @ return a set of LabelIds */ private Set < LabelId > convertLabelsToIds ( Set < Label > labelSet ) { } }
return labelSet . stream ( ) . map ( tx :: convertToId ) . filter ( LabelId :: isValid ) . collect ( toSet ( ) ) ;
public class StandardDdlParser { /** * Parses DDL CREATE CHARACTER SET { @ link AstNode } based on SQL 92 specifications . * @ param tokens the { @ link DdlTokenStream } representing the tokenized DDL content ; may not be null * @ param parentNode the parent { @ link AstNode } node ; may not be null * @ return th...
assert tokens != null ; assert parentNode != null ; markStartOfStatement ( tokens ) ; tokens . consume ( STMT_CREATE_CHARACTER_SET ) ; String name = parseName ( tokens ) ; AstNode node = nodeFactory ( ) . node ( name , parentNode , TYPE_CREATE_CHARACTER_SET_STATEMENT ) ; // TODO author = Horia Chiorean date = 1/4/12 de...
public class MapUtil { /** * 对两个Map进行比较 , 返回MapDifference , 然后各种妙用 . * 包括key的差集 , key的交集 , 以及key相同但value不同的元素 。 * @ see com . google . common . collect . MapDifference */ public static < K , V > MapDifference < K , V > difference ( Map < ? extends K , ? extends V > left , Map < ? extends K , ? extends V > right ) {...
return Maps . difference ( left , right ) ;
public class FromCobolVisitor { /** * Retrieve the size of an array . * For variable size arrays this requires an ODOObject whose value * determines the size at runtime . * @ param type the array type * @ return the actual size of the array */ private int getOccurs ( CobolArrayType type ) { } }
if ( type . isVariableSize ( ) ) { return getOdoValue ( type . getDependingOn ( ) ) ; } else { return type . getMaxOccurs ( ) ; }
public class LaCountdownRaceLatch { public void await ( ) { } }
final CountDownLatch latch ; final boolean last ; synchronized ( this ) { latch = prepareLatch ( ) ; last = ( actuallyGetCount ( latch ) == 1 ) ; if ( last ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "...Restarting count down race" ) ; } clearLatch ( ) ; } actuallyCountDown ( latch ) ; // ready go if last } i...
public class MatrixFunctions { /** * Applies the < i > logarithm with basis to 10 < / i > element - wise on this * matrix . Note that this is an in - place operation . * @ see MatrixFunctions # log10 ( DoubleMatrix ) * @ return this matrix */ public static DoubleMatrix log10i ( DoubleMatrix x ) { } }
/* # mapfct ( ' Math . log10 ' ) # */ // RJPP - BEGIN - - - - - for ( int i = 0 ; i < x . length ; i ++ ) x . put ( i , ( double ) Math . log10 ( x . get ( i ) ) ) ; return x ; // RJPP - END - - - - -
public class EtcdClient { /** * Get the Members of Etcd * @ return vEtcdMembersResponse */ public EtcdMembersResponse getMembers ( ) { } }
try { return new EtcdMembersRequest ( this . client , retryHandler ) . send ( ) . get ( ) ; } catch ( IOException | EtcdException | EtcdAuthenticationException | TimeoutException e ) { return null ; }
public class Futures { /** * Returns a new { @ code ListenableFuture } whose result is asynchronously * derived from the result of the given { @ code Future } . More precisely , the * returned { @ code Future } takes its result from a { @ code Future } produced by * applying the given { @ code AsyncFunction } to ...
checkNotNull ( executor ) ; ChainingListenableFuture < I , O > output = new ChainingListenableFuture < I , O > ( function , input ) ; input . addListener ( rejectionPropagatingRunnable ( output , output , executor ) , directExecutor ( ) ) ; return output ;
public class SocialAuthenticationFilter { /** * Indicates whether this filter should attempt to process a social network login request for the current invocation . * < p > Check if request URL matches filterProcessesUrl with valid providerId . * The URL must be like { filterProcessesUrl } / { providerId } . * @ r...
String providerId = getRequestedProviderId ( request ) ; if ( providerId != null ) { Set < String > authProviders = authServiceLocator . registeredAuthenticationProviderIds ( ) ; return authProviders . contains ( providerId ) ; } return false ;
public class YieldWait { /** * / * ( non - Javadoc ) * @ see cyclops2 . async . wait . WaitStrategy # take ( cyclops2 . async . wait . WaitStrategy . Takeable ) */ @ Override public T take ( final WaitStrategy . Takeable < T > t ) throws InterruptedException { } }
T result ; while ( ( result = t . take ( ) ) == null ) { Thread . yield ( ) ; } return result ;
public class TrustGraphNode { /** * This method performs the forwarding behavior for a received * message . The message is forwarded to the next hop on the * route according to the routing table , with ttl decreased by 1. * The message is dropped if it has an invalid hop count or * the sender of the message is ...
// don ' t forward if the forwarding policy rejects if ( ! shouldForward ( message ) ) { return false ; } // determine the next hop to send to TrustGraphNodeId nextHop = getRoutingTable ( ) . getNextHop ( message ) ; // if there is no next hop , reject if ( nextHop == null ) { return false ; } // forward the message to...
public class LongArrayList { /** * Inserts all of the elements in the specified Collection into this * list , starting at the specified position . Shifts the element * currently at that position ( if any ) and any subsequent elements to * the right ( increases their indices ) . The new elements will appear * in...
if ( index > size || index < 0 ) throw new IndexOutOfBoundsException ( "Index: " + index + ", Size: " + size ) ; int numNew = c . size ( ) ; ensureCapacity ( size + numNew ) ; // Increments modCount int numMoved = size - index ; if ( numMoved > 0 ) System . arraycopy ( elementData , index , elementData , index + numNew...
public class ActionButton { /** * Initializes the stroke color * @ param attrs attributes of the XML tag that is inflating the view */ private void initStrokeColor ( TypedArray attrs ) { } }
int index = R . styleable . ActionButton_stroke_color ; if ( attrs . hasValue ( index ) ) { strokeColor = attrs . getColor ( index , strokeColor ) ; LOGGER . trace ( "Initialized Action Button stroke color: {}" , getStrokeColor ( ) ) ; }
public class StringParser { /** * Parse the given { @ link Object } as short with the specified radix . * @ param aObject * The object to parse . May be < code > null < / code > . * @ param nRadix * The radix to use . Must be & ge ; { @ link Character # MIN _ RADIX } and & le ; * { @ link Character # MAX _ RA...
if ( aObject == null ) return nDefault ; if ( aObject instanceof Number ) return ( ( Number ) aObject ) . shortValue ( ) ; return parseShort ( aObject . toString ( ) , nRadix , nDefault ) ;
public class RendererUtils { /** * Convenient utility method that returns the currently selected values of * a UISelectMany component as a Set , of which the contains method can then be * easily used to determine if a value is currently selected . * Calling the contains method of this Set with the item value * ...
Object selectedValues = uiSelectMany . getValue ( ) ; return internalSubmittedOrSelectedValuesAsSet ( context , component , converter , uiSelectMany , selectedValues , true ) ;
public class AmazonRoute53DomainsClient { /** * This operation configures Amazon Route 53 to automatically renew the specified domain before the domain * registration expires . The cost of renewing your domain registration is billed to your AWS account . * The period during which you can renew a domain name varies ...
request = beforeClientExecution ( request ) ; return executeEnableDomainAutoRenew ( request ) ;
public class ResourceXMLParser { /** * Parse the DOM attributes as properties for the particular entity node type * @ param ent Entity object * @ param node entity DOM node * @ throws ResourceXMLParserException if the DOM node is an unexpected tag name */ private void parseEntProperties ( final Entity ent , final...
if ( null == entityProperties . get ( node . getName ( ) ) ) { throw new ResourceXMLParserException ( "Unexpected entity declaration: " + node . getName ( ) + ": " + reportNodeErrorLocation ( node ) ) ; } final Element node1 = ( Element ) node ; // load all element attributes as properties for ( final Object o : node1 ...
public class CommerceUserSegmentCriterionLocalServiceBaseImpl { /** * Performs a dynamic query on the database and returns the matching rows . * @ param dynamicQuery the dynamic query * @ return the matching rows */ @ Override public < T > List < T > dynamicQuery ( DynamicQuery dynamicQuery ) { } }
return commerceUserSegmentCriterionPersistence . findWithDynamicQuery ( dynamicQuery ) ;
public class SignatureHelper { /** * Return the type name of the given ASM type . * @ param t * The ASM type . * @ return The type name . */ public static String getType ( final Type t ) { } }
switch ( t . getSort ( ) ) { case Type . ARRAY : return getType ( t . getElementType ( ) ) ; default : return t . getClassName ( ) ; }
public class GeneratedDOAuth2UserDaoImpl { /** * query - by method for field profileLink * @ param profileLink the specified attribute * @ return an Iterable of DOAuth2Users for the specified profileLink */ public Iterable < DOAuth2User > queryByProfileLink ( java . lang . String profileLink ) { } }
return queryByField ( null , DOAuth2UserMapper . Field . PROFILELINK . getFieldName ( ) , profileLink ) ;
public class TypeToStringUtils { /** * Print class with generic variables . For example , { @ code List < T > } . * @ param type class to print * @ return string containing class and it ' s declared generics */ public static String toStringWithNamedGenerics ( final Class < ? > type ) { } }
return toStringType ( new ParameterizedTypeImpl ( type , type . getTypeParameters ( ) ) , new PrintableGenericsMap ( ) ) ;
public class GVRGenericConstraint { /** * Sets the upper limits for the " moving " body translation relative to joint point . * @ param limitX the X upper lower translation limit * @ param limitY the Y upper lower translation limit * @ param limitZ the Z upper lower translation limit */ public void setLinearUpper...
Native3DGenericConstraint . setLinearUpperLimits ( getNative ( ) , limitX , limitY , limitZ ) ;
public class BaseAPI { /** * 通用get请求 * @ param url 地址 , 其中token用 # 代替 * @ return 请求结果 */ protected BaseResponse executeGet ( String url ) { } }
BaseResponse response ; BeanUtil . requireNonNull ( url , "url is null" ) ; // 需要传token String getUrl = url . replace ( "#" , config . getAccessToken ( ) ) ; response = NetWorkCenter . get ( getUrl ) ; return response ;
public class RuntimeConfiguration { /** * Given an array of parser specifications , it returns the corresponding list of parsers ( only * the correct specifications are put in the list . * @ param specs the parser specifications ( they will be parsed using { @ link ObjectParser } . * @ return a list of parsers bu...
final ArrayList < Parser < ? > > parsers = new ArrayList < > ( ) ; for ( final String spec : specs ) parsers . add ( ObjectParser . fromSpec ( spec , Parser . class , new String [ ] { "it.unimi.di.law.bubing.parser" } ) ) ; return parsers ;
public class ShowNextSlideCommand { /** * { @ inheritDoc } */ @ Override protected void perform ( final Wave wave ) { } }
if ( getModel ( SlideStackModel . class ) . isReadyForSlideUpdate ( false ) ) { getModel ( SlideStackModel . class ) . next ( wave . get ( PrezWaves . SKIP_SLIDE_STEP ) ) ; }
public class AzureClient { /** * Given a polling state representing state of a PUT or PATCH operation , this method returns { @ link Single } object , * when subscribed to it , a single poll will be performed and emits the latest polling state . A poll will be * performed only if the current polling state is not in...
pollingState . withResourceType ( resourceType ) ; pollingState . withSerializerAdapter ( restClient ( ) . serializerAdapter ( ) ) ; if ( pollingState . isStatusTerminal ( ) ) { if ( pollingState . isStatusSucceeded ( ) && pollingState . resource ( ) == null ) { return updateStateFromGetResourceOperationAsync ( polling...
public class ServiceTools { /** * Get template for unknown type ( class or parameterizedType ) * @ param type * @ param jsonUnmarshaller * @ return */ String _getTemplateOfType ( Type type , IJsonMarshaller jsonMarshaller ) { } }
if ( ParameterizedType . class . isAssignableFrom ( type . getClass ( ) ) ) { return getTemplateOfParameterizedType ( ( ParameterizedType ) type , jsonMarshaller ) ; } try { return jsonMarshaller . toJson ( getInstanceOfClass ( ( Class ) type ) ) ; } catch ( JsonMarshallingException ex ) { } return ( ( Class ) type ) ....
public class DefaultEventMulticaster { /** * { @ inheritDoc } */ @ SuppressWarnings ( { } }
"rawtypes" , "unchecked" } ) public void multicast ( Event e ) { List < EventListener < ? > > adapted = getListeners ( e ) ; for ( EventListener listener : adapted ) listener . onEvent ( e ) ;
public class CSP2SourceList { /** * Add the provided Base64 encoded hash value . The { @ value # HASH _ PREFIX } and * { @ link # HASH _ SUFFIX } are added automatically . * @ param eMDAlgo * The message digest algorithm used . May only * { @ link EMessageDigestAlgorithm # SHA _ 256 } , * { @ link EMessageDig...
ValueEnforcer . notNull ( eMDAlgo , "MDAlgo" ) ; ValueEnforcer . notEmpty ( sHashBase64Value , "HashBase64Value" ) ; String sAlgorithmName ; switch ( eMDAlgo ) { case SHA_256 : sAlgorithmName = "sha256" ; break ; case SHA_384 : sAlgorithmName = "sha384" ; break ; case SHA_512 : sAlgorithmName = "sha512" ; break ; defau...
public class ExpressionUtil { /** * Create a value expression . * @ param pageContext the context in which the expression will be parsed * @ param expression the expression * @ param expectedType the expected type of result * @ return a parsed expression */ public static ValueExpression createValueExpression ( ...
ExpressionFactory factory = getExpressionFactory ( pageContext ) ; return factory . createValueExpression ( pageContext . getELContext ( ) , expression , expectedType ) ;
public class Chart { /** * Sets the theme for this chart by specifying a reference to a javascript * file containing the theme . The javascript file must contain the following * code : < pre > < code > * Highcharts . setOptions ( myOptions ) ; * < / code > < / pre > where < code > myOptions < / code > is a JSON...
if ( this . theme != null || this . themeUrl != null ) { throw new IllegalStateException ( "A theme can only be defined once. Calling different setTheme methods is not allowed!" ) ; } this . themeReference = theme ;
public class Strman { /** * Verifies that one or more of needles are contained in value . * @ param value input * @ param needles needles to search * @ param caseSensitive true or false * @ return boolean true if any needle is found else false */ public static boolean containsAny ( final String value , final St...
validate ( value , NULL_STRING_PREDICATE , NULL_STRING_MSG_SUPPLIER ) ; return Arrays . stream ( needles ) . anyMatch ( needle -> contains ( value , needle , caseSensitive ) ) ;
public class ServiceWrapper { /** * newFromPushedData - creating new SW for next dispatch / Runnable . * Xferred context data and classloaders to new SW . */ static ServiceWrapper newFromPushedData ( AsyncContextImpl asynContext ) { } }
// PM90834 : added method ServiceWrapper orginalServiceWrapper = asynContext . serviceWrapper ; ServiceWrapper sw = new ServiceWrapper ( asynContext ) ; sw . setContextData ( orginalServiceWrapper . getContextData ( ) ) ; sw . originalCL = orginalServiceWrapper . originalCL ; sw . newCL = orginalServiceWrapper . newCL ...
public class BitConverter { /** * Initialize this converter . * @ param converter The field to set the bit in ( Should be a NumberField ) . * @ param iBitNumber The bit number to set with this converter ( 0 = L . O . bit ) . * @ param trueIfMatch Return true if this bit is on ( if this variable is true ) . */ pub...
super . init ( converter ) ; m_iBitNumber = iBitNumber ; m_bTrueIfMatch = trueIfMatch ; m_bTrueIfNull = bTrueIfNull ;
public class Primitives { /** * Creates a new stream of { @ link Byte } type that contains all items of a given array . * @ param bytes an array to get items from . * @ return a new stream of { @ link Byte } type that contains all items of a given array . */ public static Stream < Byte > box ( final byte [ ] bytes ...
return new FixedSizeStream < > ( bytes . length , new Func1 < Integer , Byte > ( ) { @ Override public Byte call ( Integer index ) { return bytes [ index ] ; } } ) ;
public class CsvFiles { /** * Writes the CSV data located in { @ code csvData } to the file located at * { @ code fileName } . * @ param csvData the CSV data including the header * @ param fileName the file to write the CSV data to * @ throws IOException if there was an error writing to the file * @ throws Nu...
Preconditions . checkNotNull ( csvData , "Null CSV data" ) ; Preconditions . checkNotNull ( fileName , "Null file name" ) ; CSVWriter writer = null ; try { writer = new CSVWriter ( Files . newWriter ( new File ( fileName ) , StandardCharsets . UTF_8 ) ) ; for ( String [ ] line : csvData ) { writer . writeNext ( line ) ...
public class CommerceNotificationTemplateUserSegmentRelUtil { /** * Returns the first commerce notification template user segment rel in the ordered set where commerceUserSegmentEntryId = & # 63 ; . * @ param commerceUserSegmentEntryId the commerce user segment entry ID * @ param orderByComparator the comparator to...
return getPersistence ( ) . findByCommerceUserSegmentEntryId_First ( commerceUserSegmentEntryId , orderByComparator ) ;
public class PippoSettings { /** * Recursively read " include " properties files . * " Include " properties are the base properties which are overwritten by * the provided properties . * @ param baseDir * @ param properties * @ return the merged properties * @ throws IOException */ private Properties loadIn...
return loadProperties ( baseDir , properties , "include" , false ) ;
public class AbstractIoSession { /** * TODO Add method documentation */ public final void decreaseReadBufferSize ( ) { } }
if ( deferDecreaseReadBuffer ) { deferDecreaseReadBuffer = false ; return ; } if ( getConfig ( ) . getReadBufferSize ( ) > getConfig ( ) . getMinReadBufferSize ( ) ) { getConfig ( ) . setReadBufferSize ( getConfig ( ) . getReadBufferSize ( ) >>> 1 ) ; } deferDecreaseReadBuffer = true ;
public class ConcurrencyMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Concurrency concurrency , ProtocolMarshaller protocolMarshaller ) { } }
if ( concurrency == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( concurrency . getReservedConcurrentExecutions ( ) , RESERVEDCONCURRENTEXECUTIONS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall req...
public class ShrinkWrap { /** * Creates a new archive of the specified type . The archive will be be backed by the default { @ link Configuration } . * specific to this { @ link ArchiveFactory } . Generates a random name for the archive and adds proper extension based * on the service descriptor properties file if ...
// Precondition checks if ( type == null ) { throw new IllegalArgumentException ( "Type must be specified" ) ; } // Delegate to the default domain ' s archive factory for creation return ShrinkWrap . getDefaultDomain ( ) . getArchiveFactory ( ) . create ( type ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcPolygonalBoundedHalfSpace ( ) { } }
if ( ifcPolygonalBoundedHalfSpaceEClass == null ) { ifcPolygonalBoundedHalfSpaceEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 435 ) ; } return ifcPolygonalBoundedHalfSpaceEClass ;
public class DetectCircleHexagonalGrid { /** * Puts the grid into a canonical orientation */ @ Override protected void putGridIntoCanonical ( Grid g ) { } }
// first put it into a plausible solution if ( g . columns != numCols ) { rotateGridCCW ( g ) ; } if ( g . get ( 0 , 0 ) == null ) { reverse ( g ) ; } // select the best corner for canonical if ( g . columns % 2 == 1 && g . rows % 2 == 1 ) { // first make sure orientation constraint is maintained if ( isClockWise ( g )...
public class TrainingsImpl { /** * Get images by id for a given project iteration . * This API will return a set of Images for the specified tags and optionally iteration . If no iteration is specified the * current workspace is used . * @ param projectId The project id * @ param getImagesByIdsOptionalParameter...
return getImagesByIdsWithServiceResponseAsync ( projectId , getImagesByIdsOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class KerasEmbedding { /** * Get Keras input dimension from Keras layer configuration . * @ param layerConfig dictionary containing Keras layer configuration * @ return input dim as int */ private int getInputDimFromConfig ( Map < String , Object > layerConfig ) throws InvalidKerasConfigurationException { } ...
Map < String , Object > innerConfig = KerasLayerUtils . getInnerLayerConfigFromConfig ( layerConfig , conf ) ; if ( ! innerConfig . containsKey ( conf . getLAYER_FIELD_INPUT_DIM ( ) ) ) throw new InvalidKerasConfigurationException ( "Keras Embedding layer config missing " + conf . getLAYER_FIELD_INPUT_DIM ( ) + " field...
public class NetworkCache { /** * Writes an InputStream from a network response to a temporary file . If the file successfully parses * to an composition , { @ link # renameTempFile ( FileExtension ) } should be called to move the file * to its final location for future cache hits . */ File writeTempCacheFile ( Inp...
String fileName = filenameForUrl ( url , extension , true ) ; File file = new File ( appContext . getCacheDir ( ) , fileName ) ; try { OutputStream output = new FileOutputStream ( file ) ; // noinspection TryFinallyCanBeTryWithResources try { byte [ ] buffer = new byte [ 1024 ] ; int read ; while ( ( read = stream . re...
public class JFrmMain { /** * Exit the Application */ private void exitForm ( java . awt . event . WindowEvent evt ) { } }
// GEN - FIRST : event _ exitForm Main . getProperties ( ) . setProperty ( Main . PROPERTY_MAINFRAME_HEIGHT , "" + this . getHeight ( ) ) ; Main . getProperties ( ) . setProperty ( Main . PROPERTY_MAINFRAME_WIDTH , "" + this . getWidth ( ) ) ; Main . getProperties ( ) . setProperty ( Main . PROPERTY_MAINFRAME_POSX , ""...
public class AccumulatorManager { /** * Cleanup data for the oldest jobs if the maximum number of entries is * reached . */ private void cleanup ( JobID jobId ) { } }
if ( ! lru . contains ( jobId ) ) { lru . addFirst ( jobId ) ; } if ( lru . size ( ) > this . maxEntries ) { JobID toRemove = lru . removeLast ( ) ; this . jobAccumulators . remove ( toRemove ) ; }
public class ProcessKqueue { private void checkStdinCloses ( ) { } }
List < OsxProcess > processes = new ArrayList < > ( ) ; // drainTo ( ) is known to be atomic for ArrayBlockingQueue closeQueue . drainTo ( processes ) ; for ( OsxProcess process : processes ) { process . getStdin ( ) . close ( ) ; }
public class CacheSimpleConfig { /** * Set classname of a class to be used as { @ link javax . cache . integration . CacheLoader } . * @ param cacheLoader classname to be used as { @ link javax . cache . integration . CacheLoader } * @ return the current cache config instance */ public CacheSimpleConfig setCacheLoa...
if ( cacheLoader != null && cacheLoaderFactory != null ) { throw new IllegalStateException ( "Cannot set cacheLoader to '" + cacheLoader + "', because cacheLoaderFactory is already set to '" + cacheLoaderFactory + "'." ) ; } this . cacheLoader = cacheLoader ; return this ;
public class OutputPanel { /** * Appends the given { @ code message } to the panel , asynchronously in the EDT . * @ param message the message to append to the output panel * @ since 2.5.0 * @ see EventQueue # invokeLater ( Runnable ) */ public void appendAsync ( final String message ) { } }
EventQueue . invokeLater ( new Runnable ( ) { @ Override public void run ( ) { doAppend ( message ) ; } } ) ;