signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DialogRootView { /** * Creates and returns a listener , which allows to observe when the scroll view , which is * contained by the dialog , is scrolled . * @ return The listener , which has been created , as an instance of the type { @ link * OnScrollChangedListener } . The listener may not be null *...
return new ScrollListener ( ) { @ Override public void onScrolled ( final boolean scrolledToTop , final boolean scrolledToBottom ) { adaptDividerVisibilities ( scrolledToTop , scrolledToBottom , true ) ; } } ;
public class AntlrProgramBuilder { /** * 通过Antlr的ParseTree生成Beetl的ProgramMetaData * @ param tree * @ return */ public ProgramMetaData build ( ParseTree tree ) { } }
int size = tree . getChildCount ( ) - 1 ; List < Statement > ls = new ArrayList < Statement > ( size ) ; for ( int i = 0 ; i < size ; i ++ ) { Statement st = parseStatment ( ( ParserRuleContext ) tree . getChild ( i ) ) ; if ( st != null ) { ls . add ( st ) ; } } if ( pbCtx . current . gotoValue == IGoto . RETURN || pb...
public class ReportingApi { /** * Delete a subscription * Delete the specified subscription by closing all its statistics . * @ param subscriptionId The unique ID of the subscription . ( required ) * @ return ApiResponse & lt ; ApiSuccessResponse & gt ; * @ throws ApiException If fail to call the API , e . g . ...
com . squareup . okhttp . Call call = unsubscribeValidateBeforeCall ( subscriptionId , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class ASMifier { /** * Prints the ASM source code to generate the given class to the standard * output . * Usage : ASMifier [ - debug ] & lt ; binary class name or class file name & gt ; * @ param args * the command line arguments . * @ throws Exception * if the class cannot be found , or if an IO ex...
int i = 0 ; int flags = ClassReader . SKIP_DEBUG ; boolean ok = true ; if ( args . length < 1 || args . length > 2 ) { ok = false ; } if ( ok && "-debug" . equals ( args [ 0 ] ) ) { i = 1 ; flags = 0 ; if ( args . length != 2 ) { ok = false ; } } if ( ! ok ) { System . err . println ( "Prints the ASM code to generate t...
public class HsqlDbms { /** * Returns the { @ link HsqlDatabaseDescriptor } with the given name . */ @ Override public HsqlDatabaseDescriptor dbByName ( final String dbName ) { } }
Collection < HsqlDatabaseDescriptor > select = CollectionUtils . select ( dbs , new Predicate < HsqlDatabaseDescriptor > ( ) { @ Override public boolean evaluate ( HsqlDatabaseDescriptor db ) { return dbName . equals ( db . getDbName ( ) ) ; } } ) ; if ( CollectionUtils . size ( select ) == 0 ) { throw new IllegalArgum...
public class appfwjsoncontenttype { /** * Use this API to delete appfwjsoncontenttype of given name . */ public static base_response delete ( nitro_service client , String jsoncontenttypevalue ) throws Exception { } }
appfwjsoncontenttype deleteresource = new appfwjsoncontenttype ( ) ; deleteresource . jsoncontenttypevalue = jsoncontenttypevalue ; return deleteresource . delete_resource ( client ) ;
public class AnnotationDetector { /** * Scan as list . * @ param clas the clas * @ param basePackage the base package * @ return the list */ public static List < String > scanAsList ( final Class < ? extends Annotation > clas , final String ... basePackage ) { } }
final List < String > classes = new ArrayList < > ( ) ; scan ( clas , basePackage , new AnnotationHandler ( ) { @ Override public void handleAnnotationFound ( String className ) { classes . add ( className ) ; } } ) ; return classes ;
public class EntityScannerBuilder { /** * Add an Equality Filter to the Scanner , Will Filter Results Not Equal to the * Filter Value * @ param fieldName * The name of the column you want to apply the filter on * @ param filterValue * The value for comparison * @ return EntityScannerBuilder */ public Entity...
SingleFieldEntityFilter singleFieldEntityFilter = new SingleFieldEntityFilter ( entityMapper . getEntitySchema ( ) , entityMapper . getEntitySerDe ( ) , fieldName , filterValue , CompareFilter . CompareOp . EQUAL ) ; filterList . add ( singleFieldEntityFilter . getFilter ( ) ) ; return this ;
public class IOUtils { /** * read file * @ param file file * @ param charset The name of a supported { @ link Charset < / code > charset < code > } * @ return if file not exist , return null , else return content of file * @ throws IOException if an error occurs while operator BufferedReader */ public static St...
if ( file == null || ! file . isFile ( ) ) { return null ; } StringBuilder fileContent = new StringBuilder ( ) ; BufferedReader reader = null ; try { InputStreamReader is = new InputStreamReader ( new FileInputStream ( file ) , charset ) ; reader = new BufferedReader ( is ) ; String line = null ; while ( ( line = reade...
public class ConfigFactory { /** * Like { @ link # load ( ) } but allows specifying parse options and resolve * options . * @ param parseOptions * Options for parsing resources * @ param resolveOptions * options for resolving the assembled config stack * @ return configuration for an application * @ since...
final ConfigParseOptions withLoader = ensureClassLoader ( parseOptions , "load" ) ; return load ( defaultApplication ( withLoader ) , resolveOptions ) ;
public class Pool { /** * Gets the next free object from the pool . If the pool doesn ' t contain any objects , * a new object will be created and given to the caller of this method back . * @ return T borrowed object */ public T borrowObject ( ) { } }
T object ; if ( ( object = pool . poll ( ) ) == null ) { object = createObject ( ) ; } return object ;
public class ParetoStochasticLaw { /** * Replies a random value that respect * the current stochastic law . * @ param k represents the shape of the distribution * @ param xmin is the minimum value of the distribution * @ return a value depending of the stochastic law parameters * @ throws MathException when e...
return StochasticGenerator . generateRandomValue ( new ParetoStochasticLaw ( k , xmin ) ) ;
public class TagProjectRequest { /** * The tags you want to add to the project . * @ param tags * The tags you want to add to the project . * @ return Returns a reference to this object so that method calls can be chained together . */ public TagProjectRequest withTags ( java . util . Map < String , String > tags...
setTags ( tags ) ; return this ;
public class BDTImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . BDT__DOC_NAME : return DOC_NAME_EDEFAULT == null ? docName != null : ! DOC_NAME_EDEFAULT . equals ( docName ) ; case AfplibPackage . BDT__RESERVED : return RESERVED_EDEFAULT == null ? reserved != null : ! RESERVED_EDEFAULT . equals ( reserved ) ; case AfplibPackage . BDT__TRI...
public class P4 { /** * Executes the proc . * @ param a * @ param b * @ param c * @ param d * @ return result * @ throws Throwable */ protected Object run ( A a , B b , C c , D d ) throws Throwable { } }
throw notImplemented ( "run(A, B, C, D)" ) ;
public class MetaGraphDef { /** * < pre > * collection _ def : Map from collection name to collections . * See CollectionDef section for details . * < / pre > * < code > map & lt ; string , . tensorflow . CollectionDef & gt ; collection _ def = 4 ; < / code > */ public boolean containsCollectionDef ( java . lan...
if ( key == null ) { throw new java . lang . NullPointerException ( ) ; } return internalGetCollectionDef ( ) . getMap ( ) . containsKey ( key ) ;
public class LoggingPanel { /** * Reads the configuration parameters described in the panel from the * ConfigSettings and and sets the contained values . * @ param config * Reference to the ConfigSettings object */ @ Override public void applyConfig ( final ConfigSettings config ) { } }
Object o = config . getConfigParameter ( ConfigurationKeys . LOGGING_PATH_DIFFTOOL ) ; if ( o != null ) { this . diffToolField . setText ( ( String ) o ) ; } else { this . diffToolField . setText ( "" ) ; } o = config . getConfigParameter ( ConfigurationKeys . LOGGING_LOGLEVEL_DIFFTOOL ) ; if ( o != null ) { this . dif...
public class BipartiteGraph { /** * Runs a breadth - first - search starting at the root node . */ public IntArrayList bfs ( int root , boolean isRootT1 ) { } }
boolean [ ] marked1 = new boolean [ nodes1 . size ( ) ] ; boolean [ ] marked2 = new boolean [ nodes2 . size ( ) ] ; return bfs ( root , isRootT1 , marked1 , marked2 ) ;
public class BeanMap { /** * This method reinitializes the bean map to have default values for the * bean ' s properties . This is accomplished by constructing a new instance * of the bean which the map uses as its underlying data source . This * behavior for { @ link Map # clear ( ) clear ( ) } differs from the ...
if ( bean == null ) { return ; } Class < ? > beanClass = null ; try { beanClass = bean . getClass ( ) ; bean = beanClass . newInstance ( ) ; } catch ( Exception e ) { throw new UnsupportedOperationException ( "Could not create new instance of class: " + beanClass ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcChiller ( ) { } }
if ( ifcChillerEClass == null ) { ifcChillerEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 87 ) ; } return ifcChillerEClass ;
public class NodeHealthCheckerService { /** * Method used to terminate the node health monitoring service . */ void stop ( ) { } }
if ( ! shouldRun ( conf ) ) { return ; } nodeHealthScriptScheduler . cancel ( ) ; if ( shexec != null ) { Process p = shexec . getProcess ( ) ; if ( p != null ) { p . destroy ( ) ; } }
public class BaseMessageRecordDesc { /** * This utility sets this param to the field ' s raw data . * @ param record The record to get the data from . */ public int putRawFieldData ( Convert field ) { } }
String strKey = this . getFullKey ( field . getFieldName ( ) ) ; Class < ? > classData = String . class ; if ( field . getField ( ) != null ) classData = this . getMessage ( ) . getNativeClassType ( field . getField ( ) . getDataClass ( ) ) ; Object objValue = field . getData ( ) ; try { objValue = DataConverters . con...
public class NOPImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . NOP__UNDF_DATA : return UNDF_DATA_EDEFAULT == null ? undfData != null : ! UNDF_DATA_EDEFAULT . equals ( undfData ) ; } return super . eIsSet ( featureID ) ;
public class BccClient { /** * Creating a newly SecurityGroup with specified rules . * @ param request The request containing all options for creating a new SecurityGroup . * @ return The response with the id of SecurityGroup that was created newly . */ public CreateSecurityGroupResponse createSecurityGroup ( Creat...
checkNotNull ( request , "request should not be null." ) ; if ( Strings . isNullOrEmpty ( request . getClientToken ( ) ) ) { request . setClientToken ( this . generateClientToken ( ) ) ; } checkStringNotEmpty ( request . getName ( ) , "request name should not be empty." ) ; if ( null == request . getRules ( ) || reques...
public class AmazonSNSClient { /** * Returns a list of the requester ' s topics . Each call returns a limited list of topics , up to 100 . If there are * more topics , a < code > NextToken < / code > is also returned . Use the < code > NextToken < / code > parameter in a new * < code > ListTopics < / code > call to...
request = beforeClientExecution ( request ) ; return executeListTopics ( request ) ;
public class EnvironmentConverter { /** * Converts the given { @ code environment } to the given { @ link StandardEnvironment } * type . If the environment is already of the same type , no conversion is performed * and it is returned unchanged . * @ param environment the Environment to convert * @ param type th...
if ( type . equals ( environment . getClass ( ) ) ) { return ( StandardEnvironment ) environment ; } return convertEnvironment ( environment , type ) ;
public class XsdAsmUtils { /** * Changes the first char of the received { @ link String } to uppercase . * @ param name The received { @ link String } . * @ return The received { @ link String } with the first char in uppercase . */ static String firstToUpper ( String name ) { } }
if ( name . length ( ) == 1 ) { return name . toUpperCase ( ) ; } String firstLetter = name . substring ( 0 , 1 ) . toUpperCase ( ) ; return firstLetter + name . substring ( 1 ) ;
public class AccountsImpl { /** * Lists all node agent SKUs supported by the Azure Batch service . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ param accountListNodeAgentSkusNextOptions Additional parameters for the operation * @ param serviceFuture the ServiceFutu...
return AzureServiceFuture . fromHeaderPageResponse ( listNodeAgentSkusNextSinglePageAsync ( nextPageLink , accountListNodeAgentSkusNextOptions ) , new Func1 < String , Observable < ServiceResponseWithHeaders < Page < NodeAgentSku > , AccountListNodeAgentSkusHeaders > > > ( ) { @ Override public Observable < ServiceResp...
public class ThreadSafeJOptionPane { /** * Brings up an information - message dialog titled " Message " . * @ param parentComponent * determines the < code > Frame < / code > in which the dialog is * displayed ; if < code > null < / code > , or if the * < code > parentComponent < / code > has no < code > Frame ...
execute ( new VoidOptionPane ( ) { public void show ( ) { JOptionPane . showMessageDialog ( parentComponent , message ) ; } } ) ;
public class EmojiParser { /** * Detects all unicode emojis in input string and replaces them with the * return value of transformer . transform ( ) * @ param input the string to process * @ param transformer emoji transformer to apply to each emoji * @ return input string with all emojis transformed */ public ...
int prev = 0 ; StringBuilder sb = new StringBuilder ( ) ; List < UnicodeCandidate > replacements = getUnicodeCandidates ( input ) ; for ( UnicodeCandidate candidate : replacements ) { sb . append ( input . substring ( prev , candidate . getEmojiStartIndex ( ) ) ) ; sb . append ( transformer . transform ( candidate ) ) ...
public class MessageBody { /** * Creates a message body from a list of Data sections . Each Data section is a byte array . * Please note that this version of the SDK supports only one Data section in a message . It means only a list of exactly one byte array in it is accepted as message body . * @ param binaryData ...
if ( binaryData == null || binaryData . size ( ) == 0 || binaryData . size ( ) > 1 ) { throw new IllegalArgumentException ( "Binary data is null or has more than one byte array in it." ) ; } MessageBody body = new MessageBody ( ) ; body . bodyType = MessageBodyType . BINARY ; body . valueData = null ; body . sequenceDa...
public class ActionConverter { /** * Just create the JSONObject and set the consume and the end attribute . * @ param a the action to convert * @ return a skeleton JSONObject */ private JSONObject makeActionSkeleton ( Action a ) { } }
JSONObject o = new JSONObject ( ) ; o . put ( START_LABEL , a . getStart ( ) ) ; o . put ( END_LABEL , a . getEnd ( ) ) ; JSONObject hooks = new JSONObject ( ) ; for ( Action . Hook k : Action . Hook . values ( ) ) { JSONArray arr = new JSONArray ( ) ; for ( Event e : a . getEvents ( k ) ) { arr . add ( toJSON ( e ) ) ...
public class JettyService { /** * Creates a new { @ link JettyService } from an existing Jetty { @ link Server } . * @ param jettyServer the Jetty { @ link Server } */ public static JettyService forServer ( Server jettyServer ) { } }
requireNonNull ( jettyServer , "jettyServer" ) ; return new JettyService ( null , blockingTaskExecutor -> jettyServer ) ;
public class DateIntervalFormat { /** * Construct a DateIntervalFormat from skeleton and a given locale . * In this factory method , * the date interval pattern information is load from resource files . * Users are encouraged to created date interval formatter this way and * to use the pre - defined skeleton ma...
DateTimePatternGenerator generator = DateTimePatternGenerator . getInstance ( locale ) ; return new DateIntervalFormat ( skeleton , locale , new SimpleDateFormat ( generator . getBestPattern ( skeleton ) , locale ) ) ;
public class BeanValidator { /** * This method creates ValidatorFactory instances or retrieves them from the container . * Once created , ValidatorFactory instances are stored in the container under the key * VALIDATOR _ FACTORY _ KEY for performance . * @ param context The FacesContext . * @ return The Validat...
Map < String , Object > applicationMap = context . getExternalContext ( ) . getApplicationMap ( ) ; Object attr = applicationMap . get ( VALIDATOR_FACTORY_KEY ) ; if ( attr instanceof ValidatorFactory ) { return ( ValidatorFactory ) attr ; } else { synchronized ( this ) { if ( _ExternalSpecifications . isBeanValidation...
public class LoggerWrapper { /** * Delegate to the appropriate method of the underlying logger . */ public void error ( Marker marker , String format , Object arg1 , Object arg2 ) { } }
if ( ! logger . isErrorEnabled ( marker ) ) return ; if ( instanceofLAL ) { String formattedMessage = MessageFormatter . format ( format , arg1 , arg2 ) . getMessage ( ) ; ( ( LocationAwareLogger ) logger ) . log ( marker , fqcn , LocationAwareLogger . ERROR_INT , formattedMessage , new Object [ ] { arg1 , arg2 } , nul...
public class GLU { /** * This code comes directly from GLU except that it is for float */ static int glhInvertMatrixf2 ( float [ ] m , float [ ] out ) { } }
float [ ] [ ] wtmp = new float [ 4 ] [ 8 ] ; float m0 , m1 , m2 , m3 , s ; float [ ] r0 , r1 , r2 , r3 ; r0 = wtmp [ 0 ] ; r1 = wtmp [ 1 ] ; r2 = wtmp [ 2 ] ; r3 = wtmp [ 3 ] ; r0 [ 0 ] = MAT ( m , 0 , 0 ) ; r0 [ 1 ] = MAT ( m , 0 , 1 ) ; r0 [ 2 ] = MAT ( m , 0 , 2 ) ; r0 [ 3 ] = MAT ( m , 0 , 3 ) ; r0 [ 4 ] = 1.0f ; r...
public class BeanContextServicesSupport { /** * Release all services requested by the given child . * @ param bcssChild * a child * @ param delegatedServices * only release services that are delegated to parent context */ private void releaseServicesForChild ( BCSSChild bcssChild , boolean delegatedServices ) {...
if ( bcssChild . serviceRecords == null || bcssChild . serviceRecords . isEmpty ( ) ) { return ; } synchronized ( bcssChild . child ) { Object records [ ] = bcssChild . serviceRecords . toArray ( ) ; for ( int i = 0 ; i < records . length ; i ++ ) { ServiceRecord rec = ( ServiceRecord ) records [ i ] ; if ( delegatedSe...
public class GridNode { /** * Get a neighbor node at a certain direction . * @ param direction the direction to get the node at . * @ return the node . */ public GridNode getNodeAt ( Direction direction ) { } }
int newCol = col + direction . col ; int newRow = row + direction . row ; GridNode node = new GridNode ( gridIter , cols , rows , xRes , yRes , newCol , newRow ) ; return node ;
public class DefaultObjectMapperFactory { /** * configures given object mapper instance . * @ param mapper the object to configure * @ return mapper instance for chaining */ protected ObjectMapper configure ( ObjectMapper mapper ) { } }
mapper . configure ( JsonParser . Feature . ALLOW_SINGLE_QUOTES , true ) ; mapper . configure ( JsonParser . Feature . ALLOW_UNQUOTED_FIELD_NAMES , true ) ; return mapper ;
public class PdfContentByte { /** * Gets a < CODE > Graphics2D < / CODE > to write on . The graphics * are translated to PDF commands . * @ param width the width of the panel * @ param height the height of the panel * @ param fontMapper the mapping from awt fonts to < CODE > BaseFont < / CODE > * @ return a <...
return new PdfGraphics2D ( this , width , height , fontMapper , false , false , 0 ) ;
public class CommerceDiscountUserSegmentRelPersistenceImpl { /** * Returns a range of all the commerce discount user segment rels where commerceDiscountId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / cod...
return findByCommerceDiscountId ( commerceDiscountId , start , end , null ) ;
public class SoapAddressRewriteHelper { /** * Rewrite the provided address according to the current server * configuration and always using the specified uriScheme . * @ param sarm The deployment SOAPAddressRewriteMetadata * @ param origAddress The source address * @ param newAddress The new ( candidate ) addre...
try { URL url = new URL ( newAddress ) ; String path = url . getPath ( ) ; String host = sarm . getWebServiceHost ( ) ; String port = getDotPortNumber ( uriScheme , sarm ) ; StringBuilder sb = new StringBuilder ( uriScheme ) ; sb . append ( "://" ) ; sb . append ( host ) ; sb . append ( port ) ; if ( isPathRewriteRequi...
public class JobExecutionsInner { /** * Lists all executions in a job agent . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; JobExecutionInner &...
return listByAgentNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < JobExecutionInner > > , Page < JobExecutionInner > > ( ) { @ Override public Page < JobExecutionInner > call ( ServiceResponse < Page < JobExecutionInner > > response ) { return response . body ( ) ; } } ) ;
public class OkRequest { /** * Write the map to url params * @ param values map * @ return this request */ public OkRequest < T > params ( final Map < String , String > values ) { } }
if ( ! values . isEmpty ( ) ) { for ( Map . Entry < String , String > entry : values . entrySet ( ) ) { param ( entry ) ; } } return this ;
public class Configuration { /** * Get the value of the < code > name < / code > property . If no such property * exists , then < code > defaultValue < / code > is returned . * @ param name property name . * @ param defaultValue default value . * @ return property value , or < code > defaultValue < / code > if ...
return substituteVars ( getProps ( ) . getProperty ( name , defaultValue ) ) ;
public class BinarySparseDatasetParser { /** * Parse a binary sparse dataset from given URI . * @ param uri the URI of data source . * @ throws java . io . IOException */ public BinarySparseDataset parse ( String name , URI uri ) throws IOException , ParseException { } }
return parse ( name , new File ( uri ) ) ;
public class ExtensionsDao { /** * { @ inheritDoc } * Delete using the unique columns */ @ Override public int delete ( Extensions extensions ) throws SQLException { } }
DeleteBuilder < Extensions , Void > db = deleteBuilder ( ) ; setUniqueWhere ( db . where ( ) , extensions . getExtensionName ( ) , true , extensions . getTableName ( ) , true , extensions . getColumnName ( ) ) ; int deleted = db . delete ( ) ; return deleted ;
public class MetadataStore { /** * Same as { @ link # getOrAssignSegmentId ( String , Duration , Function ) ) except that this simply returns a CompletableFuture * with the SegmentId . * @ param streamSegmentName The case - sensitive StreamSegment Name . * @ param timeout The timeout for the operation . * @ ret...
return getOrAssignSegmentId ( streamSegmentName , timeout , CompletableFuture :: completedFuture ) ;
public class XSynchronizedExpressionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case XbasePackage . XSYNCHRONIZED_EXPRESSION__PARAM : return param != null ; case XbasePackage . XSYNCHRONIZED_EXPRESSION__EXPRESSION : return expression != null ; } return super . eIsSet ( featureID ) ;
public class AppConfigHandler { /** * Init the Handler . Can only be executed once . * @ param _ values values for the init */ public static void init ( final Map < String , String > _values ) { } }
if ( AppConfigHandler . HANDLER == null ) { AppConfigHandler . HANDLER = new AppConfigHandler ( _values ) ; }
public class DefaultTerminalFactory { /** * Creates a new TelnetTerminal * Note : a telnetPort should have been set with setTelnetPort ( ) , * otherwise creation of TelnetTerminal will most likely fail . * @ return New terminal emulator exposed as a { @ link Terminal } interface */ public TelnetTerminal createTel...
try { System . err . print ( "Waiting for incoming telnet connection on port " + telnetPort + " ... " ) ; System . err . flush ( ) ; TelnetTerminalServer tts = new TelnetTerminalServer ( telnetPort ) ; TelnetTerminal rawTerminal = tts . acceptConnection ( ) ; tts . close ( ) ; // Just for single - shot : free up the po...
public class ParameterResolverImpl { /** * Get default value for parameter - from OSGi configuration property or parameter definition itself . * @ param parameter Parameter definition * @ return Default value or null */ private < T > T getParameterDefaultValue ( Parameter < T > parameter ) { } }
String defaultOsgiConfigProperty = parameter . getDefaultOsgiConfigProperty ( ) ; if ( StringUtils . isNotBlank ( defaultOsgiConfigProperty ) ) { String [ ] parts = StringUtils . split ( defaultOsgiConfigProperty , ":" ) ; String className = parts [ 0 ] ; String propertyName = parts [ 1 ] ; ServiceReference ref = bundl...
public class StringUtils { /** * 检查指定的字符串列表是否不为空 。 */ public static boolean areNotEmpty ( String ... values ) { } }
boolean result = true ; if ( values == null || values . length == 0 ) { result = false ; } else { for ( String value : values ) { result &= ! isEmpty ( value ) ; } } return result ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcSimpleProperty ( ) { } }
if ( ifcSimplePropertyEClass == null ) { ifcSimplePropertyEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 514 ) ; } return ifcSimplePropertyEClass ;
public class Matrix4d { /** * Pre - multiply a rotation around the Z axis to this matrix by rotating the given amount of radians * about the Z axis and store the result in < code > dest < / code > . * When used with a right - handed coordinate system , the produced rotation will rotate a vector * counter - clockw...
double sin = Math . sin ( ang ) ; double cos = Math . cosFromSin ( sin , ang ) ; double nm00 = cos * m00 - sin * m01 ; double nm01 = sin * m00 + cos * m01 ; double nm10 = cos * m10 - sin * m11 ; double nm11 = sin * m10 + cos * m11 ; double nm20 = cos * m20 - sin * m21 ; double nm21 = sin * m20 + cos * m21 ; double nm30...
public class Condition { /** * 获取所有的 AND 子条件 * @ return */ public List < Condition > getAndConditions ( ) { } }
if ( null == subConditions ) { return null ; } List < Condition > ret = new ArrayList < Condition > ( ) ; for ( Condition subContion : subConditions ) { if ( AND . equals ( subContion . joinType ) ) { ret . add ( subContion ) ; } } return ret ;
public class IoUtils { /** * Reads in the values from a particular column of { @ code filename } , as * delimited by { @ code delimiter } . * @ param filename * @ param columnNumber * @ param delimiter * @ return */ public static List < String > readColumnFromDelimitedFile ( String filename , int columnNumber...
List < String > columnValues = Lists . newArrayList ( ) ; try { BufferedReader in = new BufferedReader ( new FileReader ( filename ) ) ; String line ; while ( ( line = in . readLine ( ) ) != null ) { String [ ] parts = line . split ( delimiter ) ; columnValues . add ( parts [ columnNumber ] ) ; } in . close ( ) ; } cat...
public class TPCHQuery10 { public static void main ( String [ ] args ) throws Exception { } }
final ParameterTool params = ParameterTool . fromArgs ( args ) ; final ExecutionEnvironment env = ExecutionEnvironment . getExecutionEnvironment ( ) ; if ( ! params . has ( "customer" ) && ! params . has ( "orders" ) && ! params . has ( "lineitem" ) && ! params . has ( "nation" ) ) { System . err . println ( " This pr...
public class JsDocInfoParser { /** * Extracts the top - level block comment from the JsDoc comment , if any . * This method differs from the extractMultilineTextualBlock in that it * terminates under different conditions ( it doesn ' t have the same * prechecks ) , it does not first read in the remaining of the c...
return extractMultilineComment ( token , getWhitespaceOption ( WhitespaceOption . TRIM ) , false , false ) ;
public class UserProfileHandlerImpl { /** * Notifying listeners after profile deletion . * @ param userProfile * the user profile which is used in delete operation * @ throws Exception * if any listener failed to handle the event */ private void postDelete ( UserProfile userProfile ) throws Exception { } }
for ( UserProfileEventListener listener : listeners ) { listener . postDelete ( userProfile ) ; }
public class CharBuffer { /** * Method to append a string to char buffer * @ param str String to append */ public void append ( String str ) { } }
if ( str == null ) return ; int restLength = buffer . length - pos ; if ( str . length ( ) < restLength ) { str . getChars ( 0 , str . length ( ) , buffer , pos ) ; pos += str . length ( ) ; } else { str . getChars ( 0 , restLength , buffer , pos ) ; curr . next = new Entity ( buffer ) ; curr = curr . next ; length += ...
public class GlobalExceptionHandler { /** * 构造系统业务错误 * @ param mvc mvc * @ param paramErrors 错误参数 * @ return mvc */ private ModelAndView buildBizError ( ModelAndView mvc , Map < String , Object > paramErrors ) { } }
Map < String , Object > error = new HashMap < String , Object > ( ) ; error . put ( "field" , paramErrors ) ; mvc . addObject ( "status" , GlobalResponseStatusMsg . BIZ_ERROR . getCode ( ) ) ; mvc . addObject ( "statusInfo" , error ) ; return mvc ;
public class CollidableConfig { /** * Create the collidable data from node . * @ param configurer The configurer reference ( must not be < code > null < / code > ) . * @ return The associated group , { @ link # DEFAULT _ GROUP } if not defined . * @ throws LionEngineException If unable to read node . */ public st...
Check . notNull ( configurer ) ; if ( configurer . hasNode ( NODE_GROUP ) ) { final String group = configurer . getText ( NODE_GROUP ) ; try { return Integer . valueOf ( group ) ; } catch ( final NumberFormatException exception ) { throw new LionEngineException ( exception , ERROR_INVALID_GROUP + group ) ; } } return D...
public class InternalXbaseWithAnnotationsParser { /** * InternalXbaseWithAnnotations . g : 1710:1 : ruleXMultiplicativeExpression returns [ EObject current = null ] : ( this _ XUnaryOperation _ 0 = ruleXUnaryOperation ( ( ( ( ( ) ( ( ruleOpMulti ) ) ) ) = > ( ( ) ( ( ruleOpMulti ) ) ) ) ( ( lv _ rightOperand _ 3_0 = ru...
EObject current = null ; EObject this_XUnaryOperation_0 = null ; EObject lv_rightOperand_3_0 = null ; enterRule ( ) ; try { // InternalXbaseWithAnnotations . g : 1716:2 : ( ( this _ XUnaryOperation _ 0 = ruleXUnaryOperation ( ( ( ( ( ) ( ( ruleOpMulti ) ) ) ) = > ( ( ) ( ( ruleOpMulti ) ) ) ) ( ( lv _ rightOperand _ 3_...
public class Tuple3ifx { /** * Replies the z property . * @ return the z property . */ @ Pure public IntegerProperty zProperty ( ) { } }
if ( this . z == null ) { this . z = new SimpleIntegerProperty ( this , MathFXAttributeNames . Z ) ; } return this . z ;
public class DBInitializer { /** * Init root node parent record . */ protected void postInit ( Connection connection ) throws SQLException { } }
String select = "select * from " + DBInitializerHelper . getItemTableName ( containerConfig ) + " where ID='" + Constants . ROOT_PARENT_UUID + "' and PARENT_ID='" + Constants . ROOT_PARENT_UUID + "'" ; if ( ! connection . createStatement ( ) . executeQuery ( select ) . next ( ) ) { String insert = DBInitializerHelper ....
public class CodecUtil { /** * Checks if is single position prefix . * @ param fieldInfo * the field info * @ param prefix * the prefix * @ return true , if is single position prefix * @ throws IOException * Signals that an I / O exception has occurred . */ public static boolean isSinglePositionPrefix ( F...
if ( fieldInfo == null ) { throw new IOException ( "no fieldInfo" ) ; } else { String info = fieldInfo . getAttribute ( MtasCodecPostingsFormat . MTAS_FIELDINFO_ATTRIBUTE_PREFIX_SINGLE_POSITION ) ; if ( info == null ) { throw new IOException ( "no " + MtasCodecPostingsFormat . MTAS_FIELDINFO_ATTRIBUTE_PREFIX_SINGLE_POS...
public class CmsJspNavBuilder { /** * Returns a navigation element for the named resource . < p > * @ param sitePath the resource name to get the navigation information for , * must be a full path name , e . g . " / docs / index . html " * @ return a navigation element for the given resource */ public CmsJspNavEl...
CmsJspNavElement result = getNavigationForResource ( sitePath , CmsResourceFilter . DEFAULT , false ) ; if ( ( result != null ) && ( result . getNavContext ( ) == null ) ) { result . setNavContext ( new NavContext ( this , Visibility . navigation , CmsResourceFilter . DEFAULT ) ) ; } return result ;
public class Execution { /** * NOTE : This method only throws exceptions if it is in an illegal state to be scheduled , or if the tasks needs * to be scheduled immediately and no resource is available . If the task is accepted by the schedule , any * error sets the vertex state to failed and triggers the recovery l...
assertRunningInJobMasterMainThread ( ) ; final ExecutionGraph executionGraph = vertex . getExecutionGraph ( ) ; final Time allocationTimeout = executionGraph . getAllocationTimeout ( ) ; try { final CompletableFuture < Execution > allocationFuture = allocateAndAssignSlotForExecution ( slotProvider , queued , locationPr...
public class FileInfo { /** * < code > optional . alluxio . grpc . file . PAcl acl = 27 ; < / code > */ public alluxio . grpc . PAcl getAcl ( ) { } }
return acl_ == null ? alluxio . grpc . PAcl . getDefaultInstance ( ) : acl_ ;
public class nspbr { /** * Use this API to fetch all the nspbr resources that are configured on netscaler . */ public static nspbr [ ] get ( nitro_service service ) throws Exception { } }
nspbr obj = new nspbr ( ) ; nspbr [ ] response = ( nspbr [ ] ) obj . get_resources ( service ) ; return response ;
public class DescribeFleetsResult { /** * Information about the fleets . * @ param fleets * Information about the fleets . */ public void setFleets ( java . util . Collection < Fleet > fleets ) { } }
if ( fleets == null ) { this . fleets = null ; return ; } this . fleets = new java . util . ArrayList < Fleet > ( fleets ) ;
public class ExportQueue { /** * Registers an observer that will export queued data . Use this method in conjunction with * { @ link ExportQueue # configure ( String ) } . * @ since 1.1.0 */ public void registerObserver ( ObserverProvider . Registry obsRegistry , org . apache . fluo . recipes . core . export . func...
Preconditions . checkState ( opts . exporterType == null , "Expected exporter type not be set, it was set to %s. Cannot not use the old and new way of configuring " + "exporters at the same time." , opts . exporterType ) ; Observer obs ; try { obs = new ExportObserverImpl < K , V > ( queueId , opts , serializer , expo...
public class RetentionSet { /** * Get a list of all retention reference stream cut records on or before ( inclusive ) the given record . * @ param record reference record * @ return list of reference records before given reference record . */ public List < StreamCutReferenceRecord > retentionRecordsBefore ( StreamC...
Preconditions . checkNotNull ( record ) ; int beforeIndex = getGreatestLowerBound ( this , record . getRecordingTime ( ) , StreamCutReferenceRecord :: getRecordingTime ) ; return retentionRecords . subList ( 0 , beforeIndex + 1 ) ;
public class NodeManager { /** * Remove the references to the session * @ param session the session to be deleted */ public void deleteSession ( String session ) { } }
for ( Set < String > sessions : hostsToSessions . values ( ) ) { sessions . remove ( session ) ; }
public class HOSECodeGenerator { /** * Produces a HOSE code for Atom < code > root < / code > in the { @ link IAtomContainer } < code > ac < / code > . The HOSE * code is produced for the number of spheres given by < code > noOfSpheres < / code > . * IMPORTANT : if you want aromaticity to be included in the code , ...
ensureIsotopeFactory ( ) ; CanonicalLabeler canLabler = new CanonicalLabeler ( ) ; canLabler . canonLabel ( ac ) ; centerCode = "" ; this . atomContainer = ac ; maxSphere = noOfSpheres ; spheres = new List [ noOfSpheres + 1 ] ; for ( int i = 0 ; i < ac . getAtomCount ( ) ; i ++ ) { ac . getAtom ( i ) . setFlag ( CDKCon...
public class Context { /** * Resolves an instance , be it into the application or defined by a previous command instruction . * This method should be used as it simulates some modifications made to the application by command * instructions . When validating instructions , it will always be more reliable than direct...
Instance instance = null ; String componentName = this . instancePathToComponentName . get ( instancePath ) ; if ( componentName != null ) { String instanceName = InstanceHelpers . findInstanceName ( instancePath ) ; Component component ; if ( DefineVariableCommandInstruction . FAKE_COMPONENT_NAME . equals ( componentN...
public class FileExecutor { /** * 合并文件 * @ param files 文件数组 * @ param destinationFile 目标文件 * @ param filterRegex 过滤规则数组 ( 正则表达式 , 与文件数组一一对应 , 即第个文件使用一个过滤规则 , 为空时不过滤 ) * @ throws IOException 异常 */ public static void mergeFiles ( File [ ] files , File destinationFile , String [ ] filterRegex ) throws IOException ...
if ( filterRegex . length < files . length ) { filterRegex = ArrayUtils . concatArrays ( filterRegex , new String [ files . length - filterRegex . length ] ) ; } createNewFile ( destinationFile ) ; int i = 0 ; for ( File file : files ) { mergeFiles ( file , destinationFile , filterRegex [ i ++ ] ) ; }
public class PartitionStateManager { /** * Returns a copy of the current partition table . */ public InternalPartition [ ] getPartitionsCopy ( ) { } }
NopPartitionListener listener = new NopPartitionListener ( ) ; InternalPartition [ ] result = new InternalPartition [ partitions . length ] ; for ( int i = 0 ; i < partitionCount ; i ++ ) { result [ i ] = partitions [ i ] . copy ( listener ) ; } return result ;
public class MockWebServer { /** * Transfer bytes from { @ code source } to { @ code sink } until either { @ code byteCount } bytes have * been transferred or { @ code source } is exhausted . The transfer is throttled according to { @ code * policy } . */ private void throttledTransfer ( MockResponse policy , Socke...
if ( byteCount == 0 ) return ; Buffer buffer = new Buffer ( ) ; long bytesPerPeriod = policy . getThrottleBytesPerPeriod ( ) ; long periodDelayMs = policy . getThrottlePeriod ( TimeUnit . MILLISECONDS ) ; long halfByteCount = byteCount / 2 ; boolean disconnectHalfway = isRequest ? policy . getSocketPolicy ( ) == DISCON...
public class DynamoDBProgrammaticKeyValue { /** * A high - resolution alarm is one that is configured to fire on threshold breaches of high - resolution metrics . See * this [ announcement ] ( https : / / aws . amazon . com / about - aws / whats - new / 2017/07 / amazon - cloudwatch - introduces - high - resolution -...
putMetricAlarm . apply ( new PutMetricAlarmRequest ( ) . withNamespace ( CUSTOM_TABLE_METRICS_NAMESPACE ) . withDimensions ( tableDimension ) . withMetricName ( metricName ) . withAlarmName ( alarmName ) . withStatistic ( Statistic . Sum ) . withUnit ( StandardUnit . Count ) . withComparisonOperator ( ComparisonOperato...
public class JdbcCpoXaAdapter { /** * Persists a collection of Objects into the datasource . The CpoAdapter will check to see if this object exists in the * datasource . If it exists , the object is updated in the datasource If the object does not exist , then it is created * in the datasource . This method stores ...
return getCurrentResource ( ) . persistObjects ( coll ) ;
public class DRUMS { /** * Adds or merges the given data . If all memory buckets are full , this method is blocking the calling thread . < br > * < br > * A merge calls the method { @ link Data # merge ( AbstractKVStorable ) } . * @ param toPersist * data to insert or update * @ throws DRUMSException * if a...
try { bucketContainer . addToCache ( toPersist ) ; } catch ( BucketContainerException ex ) { // This exception should never be thrown because the hash function should map all keys to a bucket . throw new DRUMSException ( ex ) ; }
public class Morphia { /** * Creates an entity and populates its state based on the dbObject given . This method is primarily an internal method . Reliance on * this method may break your application in future releases . * @ param < T > type of the entity * @ param datastore the Datastore to use when fetching thi...
return fromDBObject ( datastore , entityClass , dbObject , mapper . createEntityCache ( ) ) ;
public class SimpleExpression { /** * Create a { @ code this < > right } expression * @ param right rhs of the comparison * @ return this ! = right */ public BooleanExpression ne ( Expression < ? super T > right ) { } }
return Expressions . booleanOperation ( Ops . NE , mixin , right ) ;
public class CacheImpl { /** * Checks if the given { @ link CacheItem } has expired or needs to be refreshed . * @ param item * @ param itemsToRefresh the list of items where to put the specified item if it needs to be refreshed */ protected void doChecks ( CacheItem item , List < CacheItem > itemsToRefresh ) { } }
boolean expired ; boolean willBeRefreshed ; try { expired = checkForExpiration ( item ) ; if ( expired ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( item + " was removed because it expired" ) ; } } else { willBeRefreshed = checkForRefresh ( item , itemsToRefresh ) ; if ( willBeRefreshed ) { if ( logger . is...
public class ObjectMapperProvider { /** * checks if the member is to be filtered out or no if filter itself is * null , writes out that member * @ param member * @ param includeFilter * @ param jsonGenerator * @ throws JsonGenerationException * @ throws IOException */ public static void filteredCounterWrite...
if ( includeFilter != null && includeCounterFilter == null ) { if ( includeFilter . apply ( member ) ) { jsonGenerator . writeFieldName ( member ) ; jsonGenerator . writeObject ( counterMap ) ; } } else { if ( includeCounterFilter != null ) { // get group name , counter name , // check if it is wanted // if yes print i...
public class SCM { /** * Compares the current state of the remote repository against the given baseline { @ link SCMRevisionState } . * Conceptually , the act of polling is to take two states of the repository and to compare them to see * if there ' s any difference . In practice , however , comparing two arbitrary...
if ( project instanceof AbstractProject && Util . isOverridden ( SCM . class , getClass ( ) , "compareRemoteRevisionWith" , AbstractProject . class , Launcher . class , FilePath . class , TaskListener . class , SCMRevisionState . class ) ) { return compareRemoteRevisionWith ( ( AbstractProject ) project , launcher , wo...
public class MethodNode { /** * Makes the given class visitor visit this method . * @ param cv * a class visitor . */ public void accept ( final ClassVisitor cv ) { } }
String [ ] exceptions = new String [ this . exceptions . size ( ) ] ; this . exceptions . toArray ( exceptions ) ; MethodVisitor mv = cv . visitMethod ( access , name , desc , signature , exceptions ) ; if ( mv != null ) { accept ( mv ) ; }
public class JodaBeanSimpleMapReader { /** * parse object , event passed in */ @ SuppressWarnings ( "unchecked" ) private Object parseObject ( Object input , Class < ? > declaredType , MetaProperty < ? > metaProp , Class < ? > beanType , SerIterable parentIterable ) throws Exception { } }
// parse based on type if ( Bean . class . isAssignableFrom ( declaredType ) ) { if ( input instanceof Map ) { return parseBean ( ( Map < String , Object > ) input , declaredType ) ; } else { return parseSimple ( input , declaredType ) ; } } else { if ( input instanceof List || input instanceof Map ) { SerIterable chil...
public class Reflection { /** * Find the best method on the target class that matches the signature specified with the specified name and the list of * argument classes . This method first attempts to find the method with the specified argument classes ; if no such method is * found , a NoSuchMethodException is thr...
return findBestMethodWithSignature ( methodName , true , argumentsClasses ) ;
public class PESection { /** * Returns the section bytes . The file is read if the bytes aren ' t * already loaded . * @ return bytes of the section * @ throws IOException * if file can not be read * @ throws IllegalStateException * if section is too large to fit into a byte array . This * happens if the ...
if ( sectionbytes . isPresent ( ) ) { return sectionbytes . get ( ) . clone ( ) ; } loadSectionBytes ( ) ; byte [ ] result = sectionbytes . get ( ) ; assert result != null ; return result ;
public class MethodBuilder { /** * Add proxy method for equals */ private void addEquals ( TypeSpec . Builder classBuilder ) { } }
MethodSpec . Builder methodBuilder = MethodSpec . methodBuilder ( "equals" ) . addModifiers ( Modifier . PUBLIC ) . addParameter ( ClassName . get ( Object . class ) , "obj" ) . returns ( boolean . class ) . addAnnotation ( Override . class ) . addStatement ( "return (obj instanceof " + getRemoterInterfaceClassName ( )...
public class MetaStore { /** * Note : used in backward compatibility code with pre 1.2.6 release . This can be removed in later releases . */ private FileBuffer deleteConfigurationFromMetadataBuffer ( File metaFile , FileBuffer buffer ) { } }
long term = buffer . readLong ( 0 ) ; int vote = buffer . readInt ( 8 ) ; buffer . close ( ) ; try { Files . delete ( metaFile . toPath ( ) ) ; } catch ( IOException ex ) { throw new RuntimeException ( String . format ( "Failed to delete [%s]." , metaFile ) , ex ) ; } FileBuffer truncatedBuffer = FileBuffer . allocate ...
public class ActionUtil { /** * Adds / removes an action to / from a component . * @ param component Component to be associated with the action . * @ param action Action to invoke when listener event is triggered . If null , dissociates the * event listener from the component . * @ param eventName The name of t...
ActionListener listener ; if ( action == null ) { listener = removeAction ( component , eventName ) ; } else { listener = getListener ( component , eventName ) ; if ( listener == null ) { listener = new ActionListener ( component , action , eventName ) ; } else { listener . setAction ( action ) ; } } return listener ;
public class JobInformationRecorder { /** * Sets the key value pair to the job information . This would be persisted along with the other job * information like start time , end time etc * @ param key key of the key value pair * @ param value value of the key value pair * @ return this object for chaining */ pu...
if ( sourceBatcher . isStarted ( ) ) throw new IllegalStateException ( "Configuration cannot be changed after startJob has been called" ) ; properties . put ( key , value ) ; return this ;
public class HttpHelper { /** * Create COPY method * @ param sourcePath Source path , relative to repository baseURL * @ param destinationPath Destination path , relative to repository baseURL * @ return COPY method */ public HttpCopy createCopyMethod ( final String sourcePath , final String destinationPath ) { }...
return new HttpCopy ( repositoryURL + sourcePath , repositoryURL + destinationPath ) ;
public class MojoHelper { /** * Check that we have a valid set of platforms . * If no platforms are configured we create 1 default platform . * @ param platforms the list of BuildPlatform ' s to validate * @ return the passed in list or a new list with a default platform added * @ throws MojoExecutionException ...
if ( platforms == null ) { platforms = new ArrayList < BuildPlatform > ( ) ; platforms . add ( new BuildPlatform ( ) ) ; } else { Set < String > platformNames = new HashSet < String > ( ) ; for ( BuildPlatform platform : platforms ) { if ( platformNames . contains ( platform . getName ( ) ) ) { throw new MojoExecutionE...
public class FileSystem { /** * Creates a new empty directory in the specified directory , using the * given prefix and suffix strings to generate its name . If this method * returns successfully then it is guaranteed that : * < ol > * < li > The directory denoted by the returned abstract pathname did not exist...
if ( prefix == null ) { throw new NullPointerException ( ) ; } if ( prefix . length ( ) < 3 ) { throw new IllegalArgumentException ( Locale . getString ( "E4" , 3 , prefix ) ) ; // $ NON - NLS - 1 $ } final String string = ( suffix == null ) ? ".tmp" : suffix ; // $ NON - NLS - 1 $ final File targetDirectory ; if ( dir...