signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class GetMetricStatisticsResult { /** * The data points for the specified metric . * @ param datapoints * The data points for the specified metric . */ public void setDatapoints ( java . util . Collection < Datapoint > datapoints ) { } }
if ( datapoints == null ) { this . datapoints = null ; return ; } this . datapoints = new com . amazonaws . internal . SdkInternalList < Datapoint > ( datapoints ) ;
public class ContextRuleAssistant { /** * Sets the assistant local . * @ param newAssistantLocal the new assistant local */ private void setAssistantLocal ( AssistantLocal newAssistantLocal ) { } }
this . assistantLocal = newAssistantLocal ; scheduleRuleRegistry . setAssistantLocal ( newAssistantLocal ) ; transletRuleRegistry . setAssistantLocal ( newAssistantLocal ) ; templateRuleRegistry . setAssistantLocal ( newAssistantLocal ) ;
public class RulesApi { /** * Update Rule * Update an existing Rule * @ param ruleId Rule ID . ( required ) * @ param ruleInfo Rule object that needs to be updated ( required ) * @ return ApiResponse & lt ; RuleEnvelope & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot de...
com . squareup . okhttp . Call call = updateRuleValidateBeforeCall ( ruleId , ruleInfo , null , null ) ; Type localVarReturnType = new TypeToken < RuleEnvelope > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class StylesheetPIHandler { /** * Handle the xml - stylesheet processing instruction . * @ param target The processing instruction target . * @ param data The processing instruction data , or null if * none is supplied . * @ throws org . xml . sax . SAXException Any SAX exception , possibly * wrapping ...
if ( target . equals ( "xml-stylesheet" ) ) { String href = null ; // CDATA # REQUIRED String type = null ; // CDATA # REQUIRED String title = null ; // CDATA # IMPLIED String media = null ; // CDATA # IMPLIED String charset = null ; // CDATA # IMPLIED boolean alternate = false ; // ( yes | no ) " no " StringTokenizer ...
public class TracezZPageHandler { /** * Constructs a new { @ code TracezZPageHandler } . * @ param runningSpanStore the instance of the { @ code RunningSpanStore } to be used . * @ param sampledSpanStore the instance of the { @ code SampledSpanStore } to be used . * @ return a new { @ code TracezZPageHandler } . ...
return new TracezZPageHandler ( runningSpanStore , sampledSpanStore ) ;
public class ServiceContext { /** * Returns the object id , corresponding to the ? id = of the URL . */ public static String getContextObjectId ( ) { } }
ServiceContext context = ( ServiceContext ) _localContext . get ( ) ; if ( context != null ) return context . _objectId ; else return null ;
public class Context { /** * For current thread a new context object must be created . * @ param _ user name or UIID of current user to set * @ param _ locale locale instance ( which language settings has the user ) * @ param _ sessionAttributes attributes for this session * @ param _ parameters map with parame...
if ( Inheritance . Inheritable . equals ( _inheritance ) && Context . INHERITTHREADCONTEXT . get ( ) != null || Inheritance . Local . equals ( _inheritance ) && Context . THREADCONTEXT . get ( ) != null ) { throw new EFapsException ( Context . class , "begin.Context4ThreadAlreadSet" ) ; } try { // the timeout set is re...
public class ODataEntityProvider { /** * ( non - Javadoc ) * @ see javax . ws . rs . ext . MessageBodyWriter # writeTo ( java . lang . Object , * java . lang . Class , java . lang . reflect . Type , * java . lang . annotation . Annotation [ ] , javax . ws . rs . core . MediaType , * javax . ws . rs . core . Mul...
throw new UnsupportedOperationException ( ) ;
public class EventLog { /** * Adds an event to the log . * @ param event the event to add */ public void addEvent ( E event ) { } }
CompletableFuture < E > future = futures . poll ( ) ; if ( future != null ) { future . complete ( event ) ; } else { events . add ( event ) ; if ( events . size ( ) > 100 ) { events . remove ( ) ; } }
public class FacebookRestClient { /** * Sets the FBML for the profile box and profile actions for the user or page profile with ID < code > profileId < / code > . * Refer to the FBML documentation for a description of the markup and its role in various contexts . * @ param profileFbmlMarkup the FBML for the profile...
return profile_setFBML ( profileFbmlMarkup , profileActionFbmlMarkup , /* mobileFbmlMarkup */ null , profileId ) ;
public class LocalWeightedHistogramRotRect { /** * Computes the histogram quickly inside the image */ protected void computeHistogramInside ( RectangleRotate_F32 region ) { } }
for ( int i = 0 ; i < samplePts . size ( ) ; i ++ ) { Point2D_F32 p = samplePts . get ( i ) ; squareToImageSample ( p . x , p . y , region ) ; interpolate . get_fast ( imageX , imageY , value ) ; int indexHistogram = computeHistogramBin ( value ) ; sampleHistIndex [ i ] = indexHistogram ; histogram [ indexHistogram ] +...
public class SqlHelper { /** * select xxx , xxx . . . * @ param entityClass * @ return */ public static String selectAllColumns ( Class < ? > entityClass ) { } }
StringBuilder sql = new StringBuilder ( ) ; sql . append ( "SELECT " ) ; sql . append ( getAllColumns ( entityClass ) ) ; sql . append ( " " ) ; return sql . toString ( ) ;
public class Policy { /** * removePolicy removes a policy rule from the model . * @ param sec the section , " p " or " g " . * @ param ptype the policy type , " p " , " p2 " , . . or " g " , " g2 " , . . * @ param rule the policy rule . * @ return succeeds or not . */ public boolean removePolicy ( String sec , ...
for ( int i = 0 ; i < model . get ( sec ) . get ( ptype ) . policy . size ( ) ; i ++ ) { List < String > r = model . get ( sec ) . get ( ptype ) . policy . get ( i ) ; if ( Util . arrayEquals ( rule , r ) ) { model . get ( sec ) . get ( ptype ) . policy . remove ( i ) ; return true ; } } return false ;
public class AbnormalFinallyBlockReturn { /** * overrides the visitor to collect finally block info . * @ param obj * the code object to scan for finally blocks */ @ Override public void visitCode ( Code obj ) { } }
fbInfo . clear ( ) ; loadedReg = - 1 ; CodeException [ ] exc = obj . getExceptionTable ( ) ; if ( exc != null ) { for ( CodeException ce : exc ) { if ( ( ce . getCatchType ( ) == 0 ) && ( ce . getStartPC ( ) == ce . getHandlerPC ( ) ) ) { fbInfo . add ( new FinallyBlockInfo ( ce . getStartPC ( ) ) ) ; } } } if ( ! fbIn...
public class IslamicCalendar { /** * sets the calculation type for this calendar . */ public void setCalculationType ( CalculationType type ) { } }
cType = type ; // ensure civil property is up - to - date if ( cType == CalculationType . ISLAMIC_CIVIL ) civil = true ; else civil = false ;
public class OtpConnection { /** * Send a pre - encoded message to a process on a remote node . * @ param dest * the Erlang PID of the remote process . * @ param payload * the encoded message to send . * @ exception java . io . IOException * if the connection is not active or a communication error * occur...
super . sendBuf ( self . pid ( ) , dest , payload ) ;
public class S { /** * Generalize format parameter for the sake of dynamic evaluation * @ param o * @ param pattern * @ return a formatted string representation of the object */ public static String format ( ITemplate template , Object o , String pattern , Locale locale , String timezone ) { } }
if ( null == o ) return "" ; if ( o instanceof Date ) return format ( template , ( Date ) o , pattern , locale , timezone ) ; if ( o instanceof Number ) return format ( template , ( Number ) o , pattern , locale ) ; if ( null == locale ) { locale = I18N . locale ( template ) ; } RythmEngine engine = null == template ? ...
public class DynamoDBExecutor { /** * Only the dirty properties will be set to the result Map if the specified entity is a dirty marker entity . * @ param entity * @ return */ public static Map < String , AttributeValueUpdate > toUpdateItem ( final Object entity ) { } }
return toUpdateItem ( entity , NamingPolicy . LOWER_CAMEL_CASE ) ;
public class SibTr { /** * Register a named component in the specified group with trace manager . * A component must register with the trace manager before it can use the * services provided by the convenience methods of this class . Components may * register multiple times with the same name , but the trace mana...
return Tr . register ( aClass , group , resourceBundleName ) ;
public class ListMemberAccountsResult { /** * An array of account IDs . * @ param memberAccounts * An array of account IDs . */ public void setMemberAccounts ( java . util . Collection < String > memberAccounts ) { } }
if ( memberAccounts == null ) { this . memberAccounts = null ; return ; } this . memberAccounts = new java . util . ArrayList < String > ( memberAccounts ) ;
public class SimpleMessageFormatter { /** * Visible for testing */ static void appendHex ( StringBuilder out , Number number , FormatOptions options ) { } }
// We know there are no unexpected formatting flags ( currently only upper casing is supported ) . boolean isUpper = options . shouldUpperCase ( ) ; // We cannot just call Long . toHexString ( ) as that would get negative values wrong . long n = number . longValue ( ) ; // Roughly in order of expected usage . if ( numb...
public class Expressive { /** * Wait until a polled sample of the variable satisfies the criteria . * Uses a default ticker . */ public < V > void waitUntil ( Sampler < V > variable , Matcher < ? super V > criteria ) { } }
waitUntil ( variable , eventually ( ) , criteria ) ;
public class CellUtil { /** * 合并单元格 , 可以根据设置的值来合并行和列 * @ param sheet 表对象 * @ param firstRow 起始行 , 0开始 * @ param lastRow 结束行 , 0开始 * @ param firstColumn 起始列 , 0开始 * @ param lastColumn 结束列 , 0开始 * @ param cellStyle 单元格样式 , 只提取边框样式 * @ return 合并后的单元格号 */ public static int mergingCells ( Sheet sheet , int fir...
final CellRangeAddress cellRangeAddress = new CellRangeAddress ( firstRow , // first row ( 0 - based ) lastRow , // last row ( 0 - based ) firstColumn , // first column ( 0 - based ) lastColumn // last column ( 0 - based ) ) ; if ( null != cellStyle ) { RegionUtil . setBorderTop ( cellStyle . getBorderTopEnum ( ) , cel...
public class SwaggerAutoConfiguration { /** * 获取返回消息体列表 * @ param globalResponseMessageBodyList 全局Code消息返回集合 * @ return */ private List < ResponseMessage > getResponseMessageList ( List < SwaggerProperties . GlobalResponseMessageBody > globalResponseMessageBodyList ) { } }
List < ResponseMessage > responseMessages = new ArrayList < > ( ) ; for ( SwaggerProperties . GlobalResponseMessageBody globalResponseMessageBody : globalResponseMessageBodyList ) { ResponseMessageBuilder responseMessageBuilder = new ResponseMessageBuilder ( ) ; responseMessageBuilder . code ( globalResponseMessageBody...
public class VectorMath { /** * Multiply the values in { @ code left } and { @ code right } and store the * product in { @ code left } . This is an element by element multiplication . * @ param left The left { @ code Vector } to multiply , and contain the result * values . * @ param right The right { @ code Vec...
if ( left . length ( ) != right . length ( ) ) throw new IllegalArgumentException ( "Vectors of different sizes cannot be multiplied" ) ; int length = left . length ( ) ; for ( int i = 0 ; i < length ; ++ i ) left . set ( i , left . get ( i ) * right . get ( i ) ) ; return left ;
public class JsGeometryEditService { /** * Register a { @ link GeometryEditResumeHandler } that catches events that signal the editing process was resumed . * @ param handler * The { @ link GeometryEditResumeHandler } to add as listener . * @ return The registration of the handler . */ public JsHandlerRegistratio...
org . geomajas . plugin . editing . client . event . GeometryEditResumeHandler h ; h = new org . geomajas . plugin . editing . client . event . GeometryEditResumeHandler ( ) { public void onGeometryEditResume ( GeometryEditResumeEvent event ) { handler . onGeometryEditResume ( new org . geomajas . plugin . editing . js...
public class AmazonEC2Client { /** * Detaches an internet gateway from a VPC , disabling connectivity between the internet and the VPC . The VPC must * not contain any running instances with Elastic IP addresses or public IPv4 addresses . * @ param detachInternetGatewayRequest * @ return Result of the DetachInter...
request = beforeClientExecution ( request ) ; return executeDetachInternetGateway ( request ) ;
public class CallableStatementHandle { /** * # ifdef JDK > 6 */ public Reader getCharacterStream ( int parameterIndex ) throws SQLException { } }
checkClosed ( ) ; try { return this . internalCallableStatement . getCharacterStream ( parameterIndex ) ; } catch ( SQLException e ) { throw this . connectionHandle . markPossiblyBroken ( e ) ; }
public class ByteBuffer { /** * Deletes the first N bytes of the buffer . Avoids allocating any memory * since there is no return value for this method . If you want to delete * and also see the deleted data as a return value , please use the remove ( ) * methods . */ public void delete ( int count ) throws Buffe...
if ( ( count < 0 ) || ( count > capacity ( ) ) ) { throw new IllegalArgumentException ( "Can only delete between 0 and " + capacity ( ) + " bytes from buffer, you passed in=" + count ) ; } if ( count > size ( ) ) { throw new BufferSizeException ( "Buffer size (" + size ( ) + ") not large enough to delete (" + count + "...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcSurfaceFeature ( ) { } }
if ( ifcSurfaceFeatureEClass == null ) { ifcSurfaceFeatureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 674 ) ; } return ifcSurfaceFeatureEClass ;
public class GenericStorableCodec { /** * Returns a data decoder for the given generation . * @ throws FetchNoneException if generation is unknown * @ deprecated use direct decode method */ @ Deprecated public Decoder < S > getDecoder ( int generation ) throws FetchNoneException , FetchException { } }
try { synchronized ( mLayout ) { IntHashMap decoders = mDecoders ; if ( decoders == null ) { mDecoders = decoders = new IntHashMap ( ) ; } Decoder < S > decoder = ( Decoder < S > ) decoders . get ( generation ) ; if ( decoder == null ) { synchronized ( cCodecDecoders ) { Object altLayoutKey = new LayoutKey ( mLayout . ...
public class MFSFeatureGenerator { /** * Process the options of which kind of features are to be generated . * @ param properties * the properties map */ private void processRangeOptions ( final Map < String , String > properties ) { } }
final String featuresRange = properties . get ( "range" ) ; final String [ ] rangeArray = Flags . processMFSFeaturesRange ( featuresRange ) ; // options if ( rangeArray [ 0 ] . equalsIgnoreCase ( "pos" ) ) { this . isPos = true ; } if ( rangeArray [ 1 ] . equalsIgnoreCase ( "posclass" ) ) { this . isPosClass = true ; }...
public class AbstractRequestContext { /** * Set the frozen status of all EntityProxies owned by this context . */ private void freezeEntities ( final boolean frozen ) { } }
for ( final AutoBean < ? > bean : this . state . editedProxies . values ( ) ) { bean . setFrozen ( frozen ) ; }
public class MilestonesApi { /** * Get the specified milestone . * @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance * @ param milestoneId the ID of the milestone tp get * @ return a Milestone instance for the specified IDs * @ throws GitLabApiException...
Response response = get ( Response . Status . OK , getDefaultPerPageParam ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "milestones" , milestoneId ) ; return ( response . readEntity ( Milestone . class ) ) ;
public class JawrRequestHandler { /** * Returns the request path * @ param request * the request * @ return the request path */ private String getRequestPath ( HttpServletRequest request ) { } }
String finalUrl = null ; String servletPath = request . getServletPath ( ) ; if ( "" . equals ( jawrConfig . getServletMapping ( ) ) ) { finalUrl = PathNormalizer . asPath ( servletPath ) ; } else { finalUrl = PathNormalizer . asPath ( servletPath + request . getPathInfo ( ) ) ; } return finalUrl ;
public class Equals { /** * This method should be called before beginning any equals methods . In order * to return true the method : * < ol > * < li > The two given objects are the same instance using = = . This also means * if both Objects are null then this method will return true ( well * technically they...
return one == two || ! ( one == null || two == null ) && one . getClass ( ) == two . getClass ( ) ;
public class ConstantsSummaryBuilder { /** * Build the header for the given package . * @ param node the XML element that specifies which components to document * @ param summariesTree the tree to which the package header will be added */ public void buildPackageHeader ( XMLNode node , Content summariesTree ) { } }
String parsedPackageName = parsePackageName ( currentPackage . name ( ) ) ; if ( ! printedPackageHeaders . contains ( parsedPackageName ) ) { writer . addPackageName ( currentPackage , parsePackageName ( currentPackage . name ( ) ) , summariesTree ) ; printedPackageHeaders . add ( parsedPackageName ) ; }
public class FragmentBundlerCompat { /** * Inserts a Boolean value into the mapping of the underlying Bundle , replacing any existing * value * for the given key . Either key or value may be null . * @ param key a String , or null * @ param value a Boolean , or null * @ return this bundler instance to chain m...
bundler . put ( key , value ) ; return this ;
public class MusicService { /** * Forces a change of current theme . Assumes a theme was already played - there are no smooth fade ins of any * kind . */ protected void changeTheme ( ) { } }
currentTheme = getNextTheme ( currentTheme ) ; if ( currentTheme != null ) { currentTheme . setLooping ( false ) ; currentTheme . setOnCompletionListener ( listener ) ; currentTheme . setVolume ( musicVolume . getPercent ( ) ) ; currentTheme . play ( ) ; }
public class AWSLambdaClient { /** * Updates the configuration of a Lambda function < a * href = " https : / / docs . aws . amazon . com / lambda / latest / dg / versioning - aliases . html " > alias < / a > . * @ param updateAliasRequest * @ return Result of the UpdateAlias operation returned by the service . ...
request = beforeClientExecution ( request ) ; return executeUpdateAlias ( request ) ;
public class ProjectCalendar { /** * Retrieve a calendar exception which applies to this date . * @ param date target date * @ return calendar exception , or null if none match this date */ public ProjectCalendarException getException ( Date date ) { } }
ProjectCalendarException exception = null ; // We ' re working with expanded exceptions , which includes any recurring exceptions // expanded into individual entries . populateExpandedExceptions ( ) ; if ( ! m_expandedExceptions . isEmpty ( ) ) { sortExceptions ( ) ; int low = 0 ; int high = m_expandedExceptions . size...
public class ConfigExpressionEvaluator { /** * Evaluates the count expression function . If the value is null , then 0 is * returned . If the value is an array , the length is returned . If the value * is a vector , the size is returned . Otherwise , 1 is returned . * @ param value the value to evaluate * @ ret...
if ( value == null ) { return 0 ; } if ( value . getClass ( ) . isArray ( ) ) { return Array . getLength ( value ) ; } if ( value instanceof Vector < ? > ) { return ( ( Vector < ? > ) value ) . size ( ) ; } return 1 ;
public class AbstractXmlMojo { /** * Returns the plugins catalog files . */ protected void setCatalogs ( List < File > pCatalogFiles , List < URL > pCatalogUrls ) throws MojoExecutionException { } }
if ( catalogs == null || catalogs . length == 0 ) { return ; } for ( int i = 0 ; i < catalogs . length ; i ++ ) { try { URL url = new URL ( catalogs [ i ] ) ; pCatalogUrls . add ( url ) ; } catch ( MalformedURLException e ) { File absoluteCatalog = asAbsoluteFile ( new File ( catalogs [ i ] ) ) ; if ( ! absoluteCatalog...
public class SchemaManager { /** * Returns the specified user - defined table or view visible within the * context of the specified Session , or any system table of the given * name . It excludes any temp tables created in other Sessions . * Throws if the table does not exist in the context . */ public Table getT...
Table t = null ; if ( schema == null ) { t = findSessionTable ( session , name , schema ) ; } if ( t == null ) { schema = session . getSchemaName ( schema ) ; t = findUserTable ( session , name , schema ) ; } if ( t == null ) { if ( SqlInvariants . INFORMATION_SCHEMA . equals ( schema ) && database . dbInfo != null ) {...
public class ChronoLocalDate { /** * Compares this date to another date , including the chronology . * The comparison is based first on the underlying time - line date , then * on the chronology . * It is " consistent with equals " , as defined by { @ link Comparable } . * For example , the following is the com...
int cmp = Jdk8Methods . compareLongs ( toEpochDay ( ) , other . toEpochDay ( ) ) ; if ( cmp == 0 ) { cmp = getChronology ( ) . compareTo ( other . getChronology ( ) ) ; } return cmp ;
public class AT_Row { /** * Creates a new row with content with given cell context and a normal row style . * @ param content the content for the row , each member of the array represents the content for a cell in the row , must not be null but can contain null members * @ return a new row with content * @ throws...
Validate . notNull ( content ) ; Validate . notNull ( style ) ; Validate . validState ( style != TableRowStyle . UNKNOWN ) ; LinkedList < AT_Cell > cells = new LinkedList < AT_Cell > ( ) ; for ( Object o : content ) { cells . add ( new AT_Cell ( o ) ) ; } return new AT_Row ( ) { @ Override public TableRowType getType (...
public class ApplicationPolicyStatementMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ApplicationPolicyStatement applicationPolicyStatement , ProtocolMarshaller protocolMarshaller ) { } }
if ( applicationPolicyStatement == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( applicationPolicyStatement . getActions ( ) , ACTIONS_BINDING ) ; protocolMarshaller . marshall ( applicationPolicyStatement . getPrincipals ( ) , PRINCIPALS_...
public class MMapDataAccess { /** * Cleans up MappedByteBuffers . Be sure you bring the segments list in a consistent state * afterwards . * @ param from inclusive * @ param to exclusive */ private void clean ( int from , int to ) { } }
for ( int i = from ; i < to ; i ++ ) { ByteBuffer bb = segments . get ( i ) ; cleanMappedByteBuffer ( bb ) ; segments . set ( i , null ) ; }
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CoordinateReferenceSystemRefType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link CoordinateRefer...
return new JAXBElement < CoordinateReferenceSystemRefType > ( _BaseCRS_QNAME , CoordinateReferenceSystemRefType . class , null , value ) ;
public class MavenCoordHelper { /** * Find class given class name . * @ param className class name , may not be null . * @ return class , will not be null . * @ throws ClassNotFoundException thrown if class can not be found . */ protected static Class findClass ( final String className ) throws ClassNotFoundExcep...
try { return Thread . currentThread ( ) . getContextClassLoader ( ) . loadClass ( className ) ; } catch ( ClassNotFoundException e ) { try { return Class . forName ( className ) ; } catch ( ClassNotFoundException e1 ) { return MavenCoordHelper . class . getClassLoader ( ) . loadClass ( className ) ; } }
public class Weight { /** * Gets the larger of the two given weights . * @ param w1 * a weight . Cannot be < code > null < / code > . * @ param w2 * a weight . Cannot be < code > null < / code > . * @ return a weight . */ public static Weight max ( Weight w1 , Weight w2 ) { } }
if ( w1 == null ) { throw new IllegalArgumentException ( "Argument w1 cannot be null" ) ; } if ( w2 == null ) { throw new IllegalArgumentException ( "Argument w2 cannot be null" ) ; } if ( ( w1 . isInfinity && w1 . posOrNeg ) || ( w2 . isInfinity && ! w2 . posOrNeg ) ) { return w1 ; } else if ( ( w2 . isInfinity && w2 ...
public class Utils { /** * Construct a port resource . */ public static Protos . Resource ports ( Protos . Value . Range ... ranges ) { } }
return ports ( UNRESERVED_ROLE , ranges ) ;
public class PoStagger { /** * Initializes the current instance with the given context . * Note : Do all initialization in this method , do not use the constructor . */ @ Override public void initialize ( UimaContext context ) throws ResourceInitializationException { } }
super . initialize ( context ) ; this . context = context ; this . logger = context . getLogger ( ) ; if ( this . logger . isLoggable ( Level . INFO ) ) { this . logger . log ( Level . INFO , "Initializing the OpenNLP " + "Part of Speech annotator." ) ; } POSModel model ; try { POSModelResource modelResource = ( POSMod...
public class AutomaticStopClustering { /** * { @ inheritDoc } * Iteratively computes the k - means clustering of the dataset { @ code m } * using a specified method for determineing when to automaticaly stop * clustering . */ public Assignments cluster ( Matrix matrix , Properties props ) { } }
int endSize = Integer . parseInt ( props . getProperty ( NUM_CLUSTERS_END , DEFAULT_NUM_CLUSTERS_END ) ) ; return cluster ( matrix , endSize , props ) ;
public class ControlCreateDurableImpl { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . mfp . control . ControlCreateDurable # isCloned ( ) */ public final boolean isCloned ( ) { } }
boolean result = false ; // if the value is unset then it has come from an environment with back level schema if ( jmo . getChoiceField ( ControlAccess . BODY_CREATEDURABLE_CLONED ) != ControlAccess . IS_BODY_CREATEDURABLE_CLONED_UNSET ) { result = jmo . getBooleanField ( ControlAccess . BODY_CREATEDURABLE_CLONED_VALUE...
public class MetadataFinder { /** * Send a track metadata update announcement to all registered listeners . */ private void deliverTrackMetadataUpdate ( int player , TrackMetadata metadata ) { } }
if ( ! getTrackMetadataListeners ( ) . isEmpty ( ) ) { final TrackMetadataUpdate update = new TrackMetadataUpdate ( player , metadata ) ; for ( final TrackMetadataListener listener : getTrackMetadataListeners ( ) ) { try { listener . metadataChanged ( update ) ; } catch ( Throwable t ) { logger . warn ( "Problem delive...
public class RestletUtilSesameRealm { /** * Returns an unmodifiable list of users . * @ return An unmodifiable list of users . */ public List < RestletUtilUser > getUsers ( ) { } }
List < RestletUtilUser > result = new ArrayList < RestletUtilUser > ( ) ; RepositoryConnection conn = null ; try { conn = this . repository . getConnection ( ) ; final String query = this . buildSparqlQueryToFindUser ( null , true ) ; this . log . debug ( "findUser: query={}" , query ) ; final TupleQuery tupleQuery = c...
public class XlsWorkbook { /** * Returns the worksheet with the given name in the workbook . * @ param name The name of the worksheet * @ return The worksheet with the given name in the workbook */ @ Override public XlsWorksheet getSheet ( String name ) { } }
XlsWorksheet ret = null ; if ( workbook != null ) { Sheet sheet = workbook . getSheet ( name ) ; if ( sheet != null ) ret = new XlsWorksheet ( sheet ) ; } else if ( writableWorkbook != null ) { Sheet sheet = writableWorkbook . getSheet ( name ) ; if ( sheet != null ) ret = new XlsWorksheet ( sheet ) ; } return ret ;
public class AbstractEditor { /** * Returns the view specific menu bar constructed from * the command group given by the menuBarCommandGroupName or * its default * @ return */ public JComponent getEditorMenuBar ( ) { } }
CommandGroup commandGroup = getCommandGroup ( getMenuBarCommandGroupName ( ) ) ; if ( commandGroup == null ) { return null ; } return commandGroup . createMenuBar ( ) ;
public class GrammarConverter { /** * This method converts a production group ( bind together by the vertical * bar ' | ' ) into a set of productions . * @ param productionDefinition * @ throws GrammarException * @ throws TreeException */ private void convertProductionGroup ( ParseTreeNode productionDefinition ...
String productionName = productionDefinition . getChild ( "IDENTIFIER" ) . getText ( ) ; ParseTreeNode productionConstructions = productionDefinition . getChild ( "ProductionConstructions" ) ; convertSingleProductions ( productionName , productionConstructions ) ;
public class SocketStream { /** * Skips bytes in the file . * @ param n the number of bytes to skip * @ return the actual bytes skipped . */ @ Override public long skip ( long n ) throws IOException { } }
if ( _is == null ) { if ( _s == null ) return - 1 ; _is = _s . getInputStream ( ) ; } return _is . skip ( n ) ;
public class CollectionUtils { /** * Null - safe method returning the given { @ link Collection } if not { @ literal null } or an empty { @ link Collection } * if { @ literal null } . * @ param < T > { @ link Class } type of the elements in the { @ link Collection } . * @ param collection { @ link Collection } to...
return collection != null ? collection : Collections . emptyList ( ) ;
public class Wikipedia { /** * Get the hibernate ID to a given pageID of a page . * We need different methods for pages and categories here , as a page and a category can have the same ID . * @ param pageID A pageID that should be mapped to the corresponding hibernate ID . * @ return The hibernateID of the page w...
long hibernateID = - 1 ; // first look in the id mapping cache if ( idMapPages . containsKey ( pageID ) ) { return idMapPages . get ( pageID ) ; } // The id was not found in the id mapping cache . // It may not be in the cahe or may not exist at all . Session session = this . __getHibernateSession ( ) ; session . begin...
public class ASN1Dump { /** * dump out a DER object as a formatted string * @ param obj the DERObject to be dumped out . */ public static String dumpAsString ( Object obj ) { } }
if ( obj instanceof DERObject ) { return _dumpAsString ( "" , ( DERObject ) obj ) ; } else if ( obj instanceof DEREncodable ) { return _dumpAsString ( "" , ( ( DEREncodable ) obj ) . getDERObject ( ) ) ; } return "unknown object type " + obj . toString ( ) ;
public class ConstantsSummaryWriterImpl { /** * Get the table caption and header for the constant summary table * @ param typeElement the TypeElement to be documented * @ return constant members header content */ public Content getConstantMembersHeader ( TypeElement typeElement ) { } }
// generate links backward only to public classes . Content classlink = ( utils . isPublic ( typeElement ) || utils . isProtected ( typeElement ) ) ? getLink ( new LinkInfoImpl ( configuration , LinkInfoImpl . Kind . CONSTANT_SUMMARY , typeElement ) ) : new StringContent ( utils . getFullyQualifiedName ( typeElement ) ...
public class I2CFactory { /** * Fetch all available I2C bus numbers from sysfs . * Returns null , if nothing was found . * @ return Return found I2C bus numbers or null * @ throws IOException If fetching from sysfs interface fails */ public static int [ ] getBusIds ( ) throws IOException { } }
Set < Integer > set = null ; for ( Path device : Files . newDirectoryStream ( Paths . get ( "/sys/bus/i2c/devices" ) , "*" ) ) { String [ ] tokens = device . toString ( ) . split ( "-" ) ; if ( tokens . length == 2 ) { if ( set == null ) { set = new HashSet < Integer > ( ) ; } set . add ( Integer . valueOf ( tokens [ 1...
public class HTMLOutputOperator { /** * Formats the complete box tree to an output stream . * @ param tree the area tree to be printed * @ param out a writer to be used for output */ public void dumpTo ( Page page , PrintWriter out ) { } }
if ( produceHeader ) { out . println ( "<!DOCTYPE html>" ) ; out . println ( "<html>" ) ; out . println ( "<head>" ) ; out . println ( "<title>" + page . getTitle ( ) + "</title>" ) ; out . println ( "<meta charset=\"utf-8\">" ) ; out . println ( "<meta name=\"generator\" content=\"FITLayout - box tree dump\">" ) ; out...
public class Conditional { /** * When the predicate of an { @ code else if } clause is representable as a single expression , format * it directly as an { @ code else if } clause . */ private static void formatElseIfClauseWithNoDependencies ( IfThenPair < ? > condition , FormattingContext ctx ) { } }
ctx . append ( " else if (" ) . appendOutputExpression ( condition . predicate ) . append ( ") " ) ; try ( FormattingContext ignored = ctx . enterBlock ( ) ) { ctx . appendAll ( condition . consequent ) ; }
public class TypedIsomorphicGraphIndexer { /** * { @ inheritDoc } */ public int find ( G g ) { } }
for ( Map . Entry < G , Integer > e : graphIndices . entrySet ( ) ) { if ( isoTest . areIsomorphic ( g , e . getKey ( ) ) ) return e . getValue ( ) ; } return - 1 ;
public class BufferedByteInputStream { /** * Check if the read thread died , if so , throw an exception . */ private int checkOutput ( int readBytes ) throws IOException { } }
if ( readBytes > - 1 ) { return readBytes ; } if ( closed ) { throw new IOException ( "The stream has been closed" ) ; } if ( readThread . error != null ) { throw new IOException ( readThread . error . getMessage ( ) ) ; } return readBytes ;
public class CommonHelper { /** * Checks a { @ link SNode } if it is member of a specific { @ link SLayer } . * @ param layerName Specifies the layername to check . * @ param node Specifies the node to check . * @ return true - it is true when the name of layername corresponds to the * name of any label of the ...
// robustness if ( layerName == null || node == null ) { return false ; } Set < SLayer > sLayers = node . getLayers ( ) ; if ( sLayers != null ) { for ( SLayer l : sLayers ) { Collection < Label > labels = l . getLabels ( ) ; if ( labels != null ) { for ( Label label : labels ) { if ( layerName . equals ( label . getVa...
public class Engine { /** * if exists this resource . * @ param resourceName resource name * @ return if exists * @ since 1.4.1 */ public boolean exists ( final String resourceName ) { } }
final Loader myLoader = this . loader ; final String normalizedName = myLoader . normalize ( resourceName ) ; if ( normalizedName == null ) { return false ; } return myLoader . get ( normalizedName ) . exists ( ) ;
public class GetMaintenanceWindowExecutionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetMaintenanceWindowExecutionRequest getMaintenanceWindowExecutionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getMaintenanceWindowExecutionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getMaintenanceWindowExecutionRequest . getWindowExecutionId ( ) , WINDOWEXECUTIONID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientExcepti...
public class LinearClassifier { /** * Returns list of top features with weight above a certain threshold * ( list is descending and across all labels ) * @ param threshold Threshold above which we will count the feature * @ param useMagnitude Whether the notion of " large " should ignore * the sign of the featu...
return getTopFeatures ( null , threshold , useMagnitude , numFeatures , true ) ;
public class LineSegment { /** * LineSegment that starts at offset from start and runs for length towards end point * @ param offset offset applied at begin of line * @ param length length of the new segment * @ return new LineSegment computed */ public LineSegment subSegment ( double offset , double length ) { }...
Point subSegmentStart = pointAlongLineSegment ( offset ) ; Point subSegmentEnd = pointAlongLineSegment ( offset + length ) ; return new LineSegment ( subSegmentStart , subSegmentEnd ) ;
public class UtilValidate { /** * Returns true if all characters are numbers ; * first character is allowed to be + or - as well . * Does not accept floating point , exponential notation , etc . */ public static boolean isSignedLong ( String s ) { } }
if ( isEmpty ( s ) ) return defaultEmptyOK ; try { Long . parseLong ( s ) ; return true ; } catch ( Exception e ) { return false ; }
public class Cache { /** * 返回多个集合的并集 , 多个集合由 keys 指定 * 不存在的 key 被视为空集 。 */ @ SuppressWarnings ( "rawtypes" ) public Set sunion ( Object ... keys ) { } }
Jedis jedis = getJedis ( ) ; try { Set < byte [ ] > data = jedis . sunion ( keysToBytesArray ( keys ) ) ; Set < Object > result = new HashSet < Object > ( ) ; valueSetFromBytesSet ( data , result ) ; return result ; } finally { close ( jedis ) ; }
public class HMacUtils { /** * Hash - based message authentication code with SHA1 digest as defined in : * < a href = " http : / / www . ietf . org / rfc / rfc2104 . txt " > RFC 2104 < / a > . * @ param data * @ param key * @ return */ public static byte [ ] hmacSHA1 ( byte [ ] data , byte [ ] key ) { } }
checkNotNull ( data ) ; checkNotNull ( key ) ; HMac hMac = new HMac ( new SHA1Digest ( ) ) ; KeyParameter keyParameter = new KeyParameter ( key ) ; hMac . init ( keyParameter ) ; hMac . update ( data , 0 , data . length ) ; byte [ ] result = new byte [ hMac . getMacSize ( ) ] ; hMac . doFinal ( result , 0 ) ; return re...
public class BatchAttachToIndexMarshaller { /** * Marshall the given parameter object . */ public void marshall ( BatchAttachToIndex batchAttachToIndex , ProtocolMarshaller protocolMarshaller ) { } }
if ( batchAttachToIndex == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( batchAttachToIndex . getIndexReference ( ) , INDEXREFERENCE_BINDING ) ; protocolMarshaller . marshall ( batchAttachToIndex . getTargetReference ( ) , TARGETREFERENCE_...
public class HSQLInterface { /** * Get an serialized XML representation of the current schema / catalog . * @ return The XML representing the catalog . * @ throws HSQLParseException */ public VoltXMLElement getXMLFromCatalog ( ) throws HSQLParseException { } }
VoltXMLElement xml = emptySchema . duplicate ( ) ; // load all the tables HashMappedList hsqlTables = getHSQLTables ( ) ; for ( int i = 0 ; i < hsqlTables . size ( ) ; i ++ ) { Table table = ( Table ) hsqlTables . get ( i ) ; VoltXMLElement vxmle = table . voltGetTableXML ( sessionProxy ) ; assert ( vxmle != null ) ; x...
public class RepositoryVerifierHandler { /** * returns the XmlCapable id associated with the literal . * OJB maintains a RepositoryTags table that provides * a mapping from xml - tags to XmlCapable ids . * @ param literal the literal to lookup * @ return the int value representing the XmlCapable * @ throws Me...
// / / logger . debug ( " lookup : " + literal ) ; try { return tags . getIdByTag ( literal ) ; } catch ( NullPointerException t ) { throw new MetadataException ( "unknown literal: '" + literal + "'" , t ) ; }
public class AccessSet { /** * Returns for given universal unique identifier in < i > _ uuid < / i > the cached * instance of class AccessSet . * @ param _ uuid UUID the AccessSet is wanted for * @ return instance of class AccessSet * @ throws CacheReloadException on error */ public static AccessSet get ( final...
final Cache < UUID , AccessSet > cache = InfinispanCache . get ( ) . < UUID , AccessSet > getCache ( AccessSet . UUIDCACHE ) ; if ( ! cache . containsKey ( _uuid ) ) { AccessSet . getAccessSetFromDB ( AccessSet . SQL_UUID , String . valueOf ( _uuid ) ) ; } return cache . get ( _uuid ) ;
public class AmazonElasticLoadBalancingClient { /** * Adds one or more subnets to the set of configured subnets for the specified load balancer . * The load balancer evenly distributes requests across all registered subnets . For more information , see < a * href = " http : / / docs . aws . amazon . com / elasticlo...
request = beforeClientExecution ( request ) ; return executeAttachLoadBalancerToSubnets ( request ) ;
public class CodeAnalysing { /** * Examines a class by using the reflection API an retrieves all the * direct dependencies with other classes ( fields declarations , method * declarations and inner classes ) . Don ' t retrieve inheritance dependencies * nor recursively . * @ param c The class to examine * @ r...
HashSet < Class > result = new HashSet < Class > ( ) ; result . add ( c ) ; // add the own class // declared subclasses Class [ ] declaredClasses = c . getDeclaredClasses ( ) ; for ( Class cl : declaredClasses ) { result . add ( cl ) ; } // fields Field [ ] declaredFields = c . getDeclaredFields ( ) ; for ( Field f : d...
public class SendInvitationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( SendInvitationRequest sendInvitationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( sendInvitationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sendInvitationRequest . getUserArn ( ) , USERARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . ...
public class JsonLdUtils { /** * Returns true if the given value is a JSON - LD value * @ param v * the value to check . * @ return */ static Boolean isValue ( Object v ) { } }
return ( v instanceof Map && ( ( Map < String , Object > ) v ) . containsKey ( "@value" ) ) ;
public class BitstampTradeService { /** * Required parameter types : { @ link TradeHistoryParamPaging # getPageLength ( ) } */ @ Override public UserTrades getTradeHistory ( TradeHistoryParams params ) throws IOException { } }
Long limit = null ; CurrencyPair currencyPair = null ; Long offset = null ; TradeHistoryParamsSorted . Order sort = null ; Long sinceTimestamp = null ; if ( params instanceof TradeHistoryParamPaging ) { limit = Long . valueOf ( ( ( TradeHistoryParamPaging ) params ) . getPageLength ( ) ) ; } if ( params instanceof Trad...
public class ConcurrentBlockingIntQueue { /** * Returns < tt > true < / tt > if this queue contains the specified element . More formally , returns * < tt > true < / tt > if and only if this queue contains at least one element < tt > e < / tt > such that * < tt > o . equals ( e ) < / tt > . The behavior of this ope...
int readLocation = this . readLocation ; int writeLocation = this . writeLocation ; for ( ; ; ) { if ( readLocation == writeLocation ) return false ; if ( o == data [ readLocation ] ) return true ; // sets the readLocation my moving it on by 1 , this may cause it it wrap back to the start . readLocation = ( readLocatio...
public class GitlabAPI { /** * Delete project badge * @ param projectId The id of the project for which the badge should be deleted * @ param badgeId The id of the badge that should be deleted * @ throws IOException on GitLab API call error */ public void deleteProjectBadge ( Serializable projectId , Integer badg...
String tailUrl = GitlabProject . URL + "/" + sanitizeProjectId ( projectId ) + GitlabBadge . URL + "/" + badgeId ; retrieve ( ) . method ( DELETE ) . to ( tailUrl , Void . class ) ;
public class ValidatingCallbackHandler { /** * / * ( non - Javadoc ) * @ see org . jboss . as . cli . operation . OperationParser . CallbackHandler # nodeType ( java . lang . String ) */ @ Override public void nodeType ( int index , String nodeType ) throws OperationFormatException { } }
assertValidType ( nodeType ) ; validatedNodeType ( index , nodeType ) ;
public class JobFlowDetailMarshaller { /** * Marshall the given parameter object . */ public void marshall ( JobFlowDetail jobFlowDetail , ProtocolMarshaller protocolMarshaller ) { } }
if ( jobFlowDetail == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( jobFlowDetail . getJobFlowId ( ) , JOBFLOWID_BINDING ) ; protocolMarshaller . marshall ( jobFlowDetail . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( job...
public class Timezones { /** * Get the default timezone id for this thread . * @ return String id * @ throws TimezonesException on error */ public static String getThreadDefaultTzid ( ) throws TimezonesException { } }
final String id = threadTzid . get ( ) ; if ( id != null ) { return id ; } return getSystemDefaultTzid ( ) ;
public class FileSystemContext { /** * Write the contents of the given file data to the file at the given path . * This will replace any existing data . * @ param filePath The path to the file to write to * @ param fileData The data to write to the given file * @ throws IOException if an error occurs writing th...
writeToFile ( filePath , fileData , false ) ;
public class MPXWriter { /** * This method is called when double quotes are found as part of * a value . The quotes are escaped by adding a second quote character * and the entire value is quoted . * @ param value text containing quote characters * @ return escaped and quoted text */ private String escapeQuotes...
StringBuilder sb = new StringBuilder ( ) ; int length = value . length ( ) ; char c ; sb . append ( '"' ) ; for ( int index = 0 ; index < length ; index ++ ) { c = value . charAt ( index ) ; sb . append ( c ) ; if ( c == '"' ) { sb . append ( '"' ) ; } } sb . append ( '"' ) ; return ( sb . toString ( ) ) ;
public class IntArrayList { /** * Remove at a given index . * @ param index of the element to be removed . * @ return the existing value at this index . */ public Integer remove ( @ DoNotSub final int index ) { } }
checkIndex ( index ) ; final int value = elements [ index ] ; @ DoNotSub final int moveCount = size - index - 1 ; if ( moveCount > 0 ) { System . arraycopy ( elements , index + 1 , elements , index , moveCount ) ; } size -- ; return value ;
public class TextField { /** * Do the undo of the paste , overrideable for custom behaviour * @ param oldCursorPos before the paste * @ param oldText The text before the last paste */ protected void doUndo ( int oldCursorPos , String oldText ) { } }
if ( oldText != null ) { setText ( oldText ) ; setCursorPos ( oldCursorPos ) ; }
public class EPSProjectWBSSpreadType { /** * Gets the value of the period property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there is not a < CODE > set < / ...
if ( period == null ) { period = new ArrayList < EPSProjectWBSSpreadType . Period > ( ) ; } return this . period ;
public class InferenceEngine { /** * Infer an end context for the given template and , if requested , choose escaping directives for * any < code > { print } < / code > . * @ param templateNode A template that is visited in { @ code startContext } and no other . If a * template can be reached from multiple contex...
InferenceEngine inferenceEngine = new InferenceEngine ( inferences , errorReporter ) ; // Context started off as startContext and we have propagated context through all of // template ' s children , so now return the template ' s end context . return inferenceEngine . infer ( templateNode , startContext ) ;
public class YamlPropertyManager { /** * Only returns cached ( previously - read ) properties . * For other values , refer to yaml / property files . * Or execute CLI command < code > mdw config [ name ] < / code > . */ @ Override public Properties getAllProperties ( ) { } }
Properties props = new Properties ( ) ; for ( String name : cachedValues . keySet ( ) ) { props . put ( name , String . valueOf ( cachedValues . get ( name ) ) ) ; } return props ;
public class SREsPreferencePage { /** * Refresh the UI list of SRE . */ protected void refreshSREListUI ( ) { } }
// Refreshes the SRE listing after a SRE install notification , might not // happen on the UI thread . final Display display = Display . getDefault ( ) ; if ( display . getThread ( ) . equals ( Thread . currentThread ( ) ) ) { if ( ! this . sresList . isBusy ( ) ) { this . sresList . refresh ( ) ; } } else { display . ...