signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ParameterImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setKpi ( boolean newKpi ) { } }
boolean oldKpi = kpi ; kpi = newKpi ; boolean oldKpiESet = kpiESet ; kpiESet = true ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , BpsimPackage . PARAMETER__KPI , oldKpi , kpi , ! oldKpiESet ) ) ;
public class FormdefScanner { /** * Scans the input for medium maps and adds to the * formdef . * This scanner will modify the AfpInputStreams position . * If you need to keep position , please provide a new * AfpInputStream . * @ param in formdef or afp file to read medium maps from * @ return formdef in m...
Formdef formdef = new FormdefImpl ( ) ; SF sf ; LinkedList < SF > sfbuffer = null ; while ( ( sf = in . readStructuredField ( ) ) != null ) { log . trace ( "{}" , sf ) ; switch ( sf . eClass ( ) . getClassifierID ( ) ) { case AfplibPackage . ERG : case AfplibPackage . BDT : return null ; case AfplibPackage . EFM : retu...
public class PactDslJsonArray { /** * Matches a URL that is composed of a base path and a sequence of path expressions * @ param basePath The base path for the URL ( like " http : / / localhost : 8080 / " ) which will be excluded from the matching * @ param pathFragments Series of path fragments to match on . These...
UrlMatcherSupport urlMatcher = new UrlMatcherSupport ( basePath , Arrays . asList ( pathFragments ) ) ; body . put ( urlMatcher . getExampleValue ( ) ) ; matchers . addRule ( rootPath + appendArrayIndex ( 0 ) , regexp ( urlMatcher . getRegexExpression ( ) ) ) ; return this ;
public class EscapedFunctions2 { /** * ifnull translation * @ param buf The buffer to append into * @ param parsedArgs arguments * @ throws SQLException if something wrong happens */ public static void sqlifnull ( StringBuilder buf , List < ? extends CharSequence > parsedArgs ) throws SQLException { } }
twoArgumentsFunctionCall ( buf , "coalesce(" , "ifnull" , parsedArgs ) ;
public class CreateHITWithHITTypeRequest { /** * If the HITLayoutId is provided , any placeholder values must be filled in with values using the HITLayoutParameter * structure . For more information , see HITLayout . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @...
if ( this . hITLayoutParameters == null ) { setHITLayoutParameters ( new java . util . ArrayList < HITLayoutParameter > ( hITLayoutParameters . length ) ) ; } for ( HITLayoutParameter ele : hITLayoutParameters ) { this . hITLayoutParameters . add ( ele ) ; } return this ;
public class AbstractConsumerKey { /** * Is this consumer set suspended because it has breached its concurrency limit ? * @ return */ public boolean isConsumerSetSuspended ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "isConsumerSetSuspended" ) ; boolean consumerSetSuspended = false ; if ( classifyingMessages ) consumerSetSuspended = consumerSet . isConsumerSetSuspended ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEn...
public class DTMDocumentImpl { /** * Given a node handle , return an ID that represents the node ' s expanded name . * @ param nodeHandle The handle to the node in question . * @ return the expanded - name id of the node . */ public int getExpandedTypeID ( int nodeHandle ) { } }
nodes . readSlot ( nodeHandle , gotslot ) ; String qName = m_localNames . indexToString ( gotslot [ 3 ] ) ; // Remove prefix from qName // % TBD % jjk This is assuming the elementName is the qName . int colonpos = qName . indexOf ( ":" ) ; String localName = qName . substring ( colonpos + 1 ) ; // Get NS String namespa...
public class BandwidthSchedulesInner { /** * Creates or updates a bandwidth schedule . * @ param deviceName The device name . * @ param name The bandwidth schedule name which needs to be added / updated . * @ param resourceGroupName The resource group name . * @ param parameters The bandwidth schedule to be add...
return createOrUpdateWithServiceResponseAsync ( deviceName , name , resourceGroupName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class StringParser { /** * Parse the given { @ link String } as float . * @ param sStr * The string to parse . May be < code > null < / code > . * @ param fDefault * The default value to be returned if the passed object could not be * converted to a valid value . * @ return The default value if the s...
// parseDouble throws a NPE if parameter is null if ( sStr != null && sStr . length ( ) > 0 ) try { // Single point where we replace " , " with " . " for parsing ! return Float . parseFloat ( _getUnifiedDecimal ( sStr ) ) ; } catch ( final NumberFormatException ex ) { // Fall through } return fDefault ;
public class Transaction { /** * Same as { @ link # addSignedInput ( TransactionOutPoint , Script , ECKey , Transaction . SigHash , boolean ) } * but defaults to { @ link SigHash # ALL } and " false " for the anyoneCanPay flag . This is normally what you want . */ public TransactionInput addSignedInput ( TransactionO...
return addSignedInput ( prevOut , scriptPubKey , sigKey , SigHash . ALL , false ) ;
public class C4BlobStore { /** * Reads the entire contents of a blob into memory . Caller is responsible for freeing it . */ public FLSliceResult getContents ( C4BlobKey blobKey ) throws LiteCoreException { } }
return new FLSliceResult ( getContents ( handle , blobKey . getHandle ( ) ) ) ;
public class CustomFunctions { /** * Splits a string into equally sized chunks * @ param text the text to split * @ param size the chunk size * @ return the list of chunks */ private static List < String > chunk ( String text , int size ) { } }
List < String > chunks = new ArrayList < > ( ) ; for ( int i = 0 ; i < text . length ( ) ; i += size ) { chunks . add ( StringUtils . substring ( text , i , i + size ) ) ; } return chunks ;
public class EntityManagerImpl { /** * ( non - Javadoc ) * @ see javax . persistence . EntityManager # createNativeQuery ( java . lang . String , * java . lang . Class ) */ @ Override public final Query createNativeQuery ( String sqlString , Class resultClass ) { } }
checkClosed ( ) ; checkTransactionNeeded ( ) ; return getPersistenceDelegator ( ) . createNativeQuery ( sqlString , resultClass ) ;
public class FeatureGenerators { /** * Gets a feature generator that first converts the data , * then applies a given feature generator . * @ param generator * @ param converter * @ return */ public static < A , B , C > FeatureGenerator < A , C > convertingFeatureGenerator ( FeatureGenerator < B , C > generator...
return new ConvertingFeatureGenerator < A , B , C > ( generator , converter ) ;
public class TaskGroup { /** * Handles successful completion of a task . * If the task is not root ( terminal ) task then this kickoff execution of next set of ready tasks * @ param completedEntry the entry holding completed task * @ param context the context object shared across all the task entries in this grou...
reportCompletion ( completedEntry ) ; if ( isRootEntry ( completedEntry ) ) { return Observable . empty ( ) ; } else { return invokeReadyTasksAsync ( context ) ; }
public class ModelsImpl { /** * Gets information about the composite entity model . * @ param appId The application ID . * @ param versionId The version ID . * @ param cEntityId The composite entity extractor ID . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the obse...
return getCompositeEntityWithServiceResponseAsync ( appId , versionId , cEntityId ) . map ( new Func1 < ServiceResponse < CompositeEntityExtractor > , CompositeEntityExtractor > ( ) { @ Override public CompositeEntityExtractor call ( ServiceResponse < CompositeEntityExtractor > response ) { return response . body ( ) ;...
public class Configuration { /** * Updates the stored settings of a connection with these values from the response of the iSCSI Target . * @ param targetName The name of the iSCSI Target . * @ param connectionID The ID of the connection within this iSCSI Target . * @ param response The response settings . * @ t...
final SessionConfiguration sc ; synchronized ( sessionConfigs ) { sc = sessionConfigs . get ( targetName ) ; synchronized ( sc ) { if ( sc == null ) { throw new NoSuchSessionException ( "A session with the ID '" + targetName + "' does not exist." ) ; } synchronized ( response ) { SettingEntry se ; for ( Map . Entry < O...
public class MessagesApi { /** * Get Normalized Actions * Get the actions normalized * @ param uid User ID . If not specified , assume that of the current authenticated user . If specified , it must be that of a user for which the current authenticated user has read access to . ( optional ) * @ param ddid Destina...
com . squareup . okhttp . Call call = getNormalizedActionsValidateBeforeCall ( uid , ddid , mid , offset , count , startDate , endDate , order , null , null ) ; Type localVarReturnType = new TypeToken < NormalizedActionsEnvelope > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class CBADao { /** * We expect a clean up to date invoice , with all the items except the cba , that we will compute in that method */ public InvoiceItemModelDao computeCBAComplexity ( final InvoiceModelDao invoice , @ Nullable final BigDecimal accountCBAOrNull , @ Nullable final EntitySqlDaoWrapperFactory entit...
final BigDecimal balance = getInvoiceBalance ( invoice ) ; if ( balance . compareTo ( BigDecimal . ZERO ) < 0 ) { // Current balance is negative , we need to generate a credit ( positive CBA amount ) return buildCBAItem ( invoice , balance , context ) ; } else if ( balance . compareTo ( BigDecimal . ZERO ) > 0 && invoi...
public class RequestContext { /** * Pretty renders . * @ return this context */ public RequestContext renderPretty ( ) { } }
if ( renderer instanceof JsonRenderer ) { final JsonRenderer r = ( JsonRenderer ) renderer ; r . setPretty ( true ) ; } return this ;
public class ApiOvhTelephony { /** * Get this object properties * REST : GET / telephony / { billingAccount } / easyHunting / { serviceName } / screenListConditions / conditions / { conditionId } * @ param billingAccount [ required ] The name of your billingAccount * @ param serviceName [ required ] * @ param c...
String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/screenListConditions/conditions/{conditionId}" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , conditionId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhEasyHuntingScreenListsCon...
public class MoleculePropertyCalculator { /** * method to get the molecular weight for the whole HELM * @ param helm2notation input HELM2Notation * @ return MolecularWeight of the whole HELM * @ throws BuilderMoleculeException if the whole molecule can not be built * @ throws CTKException general ChemToolKit ex...
/* First build one big molecule ; List of molecules ? */ List < AbstractMolecule > molecules = buildMolecule ( helm2notation ) ; return calculateMolecularWeight ( molecules ) ;
public class DuCommand { /** * Prints the size messages . * @ param sizeMessage the total size message to print * @ param inAlluxioMessage the in Alluxio size message to print * @ param inMemMessage the in memory size message to print * @ param path the path to print */ private void printInfo ( String sizeMessa...
System . out . println ( inMemMessage . isEmpty ( ) ? String . format ( SHORT_INFO_FORMAT , sizeMessage , inAlluxioMessage , path ) : String . format ( LONG_INFO_FORMAT , sizeMessage , inAlluxioMessage , inMemMessage , path ) ) ;
public class Allure { /** * Syntax sugar for { @ link # step ( ThrowableContextRunnable ) } . * @ param runnable the step ' s body . */ public static void step ( final ThrowableContextRunnableVoid < StepContext > runnable ) { } }
step ( step -> { runnable . run ( step ) ; return null ; } ) ;
public class SearchIndex { /** * Clone the default Index directory manager * @ return an initialized { @ link DirectoryManager } . * @ throws IOException * if the directory manager cannot be instantiated or an * exception occurs while initializing the manager . */ protected DirectoryManager cloneDirectoryManage...
try { DirectoryManager df = directoryManager . getClass ( ) . newInstance ( ) ; df . init ( this . path + suffix ) ; return df ; } catch ( IOException e ) { throw e ; } catch ( Exception e ) { IOException ex = new IOException ( ) ; ex . initCause ( e ) ; throw ex ; }
public class ServerFactory { /** * 初始化Server实例 * @ param serverConfig 服务端配置 * @ return Server */ public synchronized static Server getServer ( ServerConfig serverConfig ) { } }
try { Server server = SERVER_MAP . get ( Integer . toString ( serverConfig . getPort ( ) ) ) ; if ( server == null ) { // 算下网卡和端口 resolveServerConfig ( serverConfig ) ; ExtensionClass < Server > ext = ExtensionLoaderFactory . getExtensionLoader ( Server . class ) . getExtensionClass ( serverConfig . getProtocol ( ) ) ;...
public class ResolverSystemFactory { /** * Creates a new { @ link ResolverSystem } instance of the specified user view type using the { @ link Thread } Context * { @ link ClassLoader } . Will consult a configuration file visible to the { @ link Thread } Context { @ link ClassLoader } named * " META - INF / services...
return createFromUserView ( userViewClass , SecurityActions . getThreadContextClassLoader ( ) ) ;
public class MongoDBSchemaManager { /** * initiate client method initiates the client . * @ return boolean value ie client started or not . */ protected boolean initiateClient ( ) { } }
for ( String host : hosts ) { if ( host == null || ! StringUtils . isNumeric ( port ) || port . isEmpty ( ) ) { logger . error ( "Host or port should not be null / port should be numeric" ) ; throw new IllegalArgumentException ( "Host or port should not be null / port should be numeric" ) ; } List < MongoCredential > c...
public class Internal { /** * Returns a corrected value if this is a floating point value to fix . * OpenTSDB used to encode all floating point values as ` float ' ( 4 bytes ) * but actually store them on 8 bytes , with 4 leading 0 bytes , and flags * correctly stating the value was on 4 bytes . * This function...
if ( floatingPointValueToFix ( flags , value ) ) { // The first 4 bytes should really be zeros . if ( value [ 0 ] == 0 && value [ 1 ] == 0 && value [ 2 ] == 0 && value [ 3 ] == 0 ) { // Just keep the last 4 bytes . return new byte [ ] { value [ 4 ] , value [ 5 ] , value [ 6 ] , value [ 7 ] } ; } else { // Very unlikely...
public class JsonSliceUtil { /** * Encodes the given list of { @ link JsonSlice } s to valid JSON . * @ param slices List of { @ link JsonSlice } s to encode * @ return Valid JSON - formatted string * @ throws JsonFormatException * @ throws IOException * @ author vvakame */ public static String slicesToString...
if ( slices == null || slices . size ( ) == 0 ) { throw new JsonFormatException ( "slices is null or empty." ) ; } StringWriter writer = new StringWriter ( ) ; int cnt = slices . size ( ) ; for ( int i = 0 ; i < cnt ; i ++ ) { JsonSlice slice = slices . get ( i ) ; if ( slice == null ) { throw new JsonFormatException (...
public class ClientFactory { /** * Asynchronously creates a new message receiver to the entity on the messagingFactory . * @ param messagingFactory messaging factory ( which represents a connection ) on which receiver needs to be created . * @ param entityPath path of entity * @ param receiveMode PeekLock or Rece...
return createMessageReceiverFromEntityPathAsync ( messagingFactory , entityPath , null , receiveMode ) ;
public class WorldMapProcessor { /** * Counts the coordinates stored in a single statement for the relevant * property , if they are actually given and valid . * @ param statement * @ param itemDocument */ private void countCoordinateStatement ( Statement statement , ItemDocument itemDocument ) { } }
Value value = statement . getValue ( ) ; if ( ! ( value instanceof GlobeCoordinatesValue ) ) { return ; } GlobeCoordinatesValue coordsValue = ( GlobeCoordinatesValue ) value ; if ( ! this . globe . equals ( ( coordsValue . getGlobe ( ) ) ) ) { return ; } int xCoord = ( int ) ( ( ( coordsValue . getLongitude ( ) + 180.0...
import java . util . regex . Matcher ; import java . util . regex . Pattern ; public class IdentifyAdverbs { /** * Fetches all adverbs and their locations in a given sentence utilizing regular expression . * > > > identify _ adverbs ( ' Undoubtedly , she has no reason for such behavior . ' ) * ' 0-11 : Undoubtedly ...
Pattern p = Pattern . compile ( "\\b\\w+ly\\b" ) ; Matcher m = p . matcher ( sentence ) ; if ( m . find ( ) ) { return m . start ( ) + "-" + m . end ( ) + ": " + m . group ( ) ; } return null ;
public class ViolationThresholdComparator { /** * Returns true if solutions s1 and / or s2 have an overall constraint * violation with value less than 0 */ public boolean needToCompare ( S solution1 , S solution2 ) { } }
boolean needToCompare ; double overall1 , overall2 ; overall1 = Math . abs ( numberOfViolatedConstraints . getAttribute ( solution1 ) * overallConstraintViolation . getAttribute ( solution1 ) ) ; overall2 = Math . abs ( numberOfViolatedConstraints . getAttribute ( solution2 ) * overallConstraintViolation . getAttribute...
public class AttachStaticIpRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AttachStaticIpRequest attachStaticIpRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( attachStaticIpRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( attachStaticIpRequest . getStaticIpName ( ) , STATICIPNAME_BINDING ) ; protocolMarshaller . marshall ( attachStaticIpRequest . getInstanceName ( ) , INSTANCENAME_B...
public class TextAnalyticsManager { /** * Initializes an instance of Text Analytics API client . * @ param region Supported Azure regions for Cognitive Services endpoints . * @ param credentials the management credentials for Azure * @ return the Text Analytics API client */ public static TextAnalyticsAPI authent...
return authenticate ( "https://{AzureRegion}.api.cognitive.microsoft.com/text/analytics/" , credentials ) . withAzureRegion ( region ) ;
public class LogPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getRemoteServiceCalled ( ) { } }
if ( remoteServiceCalledEClass == null ) { remoteServiceCalledEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( LogPackage . eNS_URI ) . getEClassifiers ( ) . get ( 31 ) ; } return remoteServiceCalledEClass ;
public class WAudioExample { /** * Build the UI for this example . */ private void buildUI ( ) { } }
// build the configuration options UI . WFieldLayout layout = new WFieldLayout ( WFieldLayout . LAYOUT_STACKED ) ; layout . setMargin ( new Margin ( null , null , Size . LARGE , null ) ) ; add ( layout ) ; layout . addField ( "Autoplay" , cbAutoPlay ) ; layout . addField ( "Loop" , cbLoop ) ; layout . addField ( "Disab...
public class DoubleMaps { /** * Returns a linearly interpolated value from the given map . < br > * < br > * For the given key , the next larger and next smaller key * will be determined . The values associated with these keys * will be interpolated , based on the location of the given * key between the next ...
if ( map . isEmpty ( ) ) { throw new IllegalArgumentException ( "Empty map" ) ; } Entry < Double , ? extends Number > c = map . ceilingEntry ( key ) ; Entry < Double , ? extends Number > f = map . floorEntry ( key ) ; if ( c == null ) { return f . getValue ( ) . doubleValue ( ) ; } if ( f == null ) { return c . getValu...
public class AccountSettings { /** * Returns the unmetered devices you have purchased or want to purchase . * @ param unmeteredDevices * Returns the unmetered devices you have purchased or want to purchase . * @ return Returns a reference to this object so that method calls can be chained together . */ public Acc...
setUnmeteredDevices ( unmeteredDevices ) ; return this ;
public class DefaultParameterEquivalencer { /** * { @ inheritDoc } */ @ Override public List < Parameter > findEquivalences ( Parameter sourceParameter ) throws ResourceDownloadError , IndexingFailure , IOException { } }
openAllEquivalences ( ) ; final List < Parameter > equivalentParameters = new ArrayList < Parameter > ( ) ; Set < Entry < String , JDBMEquivalenceLookup > > equivalenceEntries = openEquivalences . entrySet ( ) ; for ( Entry < String , JDBMEquivalenceLookup > equivalenceEntry : equivalenceEntries ) { final String equiva...
public class CLDRBase { /** * Convert the Java locale to a CLDR locale object . */ public CLDR . Locale fromJavaLocale ( java . util . Locale javaLocale ) { } }
return MetaLocale . fromJavaLocale ( javaLocale ) ;
public class ReplicationInstance { /** * The VPC security group for the instance . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setVpcSecurityGroups ( java . util . Collection ) } or { @ link # withVpcSecurityGroups ( java . util . Collection ) } if * yo...
if ( this . vpcSecurityGroups == null ) { setVpcSecurityGroups ( new java . util . ArrayList < VpcSecurityGroupMembership > ( vpcSecurityGroups . length ) ) ; } for ( VpcSecurityGroupMembership ele : vpcSecurityGroups ) { this . vpcSecurityGroups . add ( ele ) ; } return this ;
public class JMExceptionManager { /** * Log runtime exception . * @ param log the log * @ param exceptionMessage the exception message * @ param method the method * @ param params the params */ public static void logRuntimeException ( Logger log , String exceptionMessage , String method , Object ... params ) { ...
handleException ( log , newRunTimeException ( exceptionMessage ) , method , params ) ;
public class AbstractComponent { /** * { @ inheritDoc } */ @ Override public final void listen ( final WaveChecker waveChecker , final Method method , final WaveType ... waveTypes ) { } }
// Check API compliance if ( ! this . processUncaughtWave ) { CheckerUtility . checkWaveTypeContract ( this . getClass ( ) , waveTypes ) ; } final Component < ? > waveReady = this ; LOGGER . trace ( LinkMessages . LISTEN_WAVE_TYPE , getWaveTypesString ( waveTypes ) , waveReady . getClass ( ) . getSimpleName ( ) ) ; // ...
public class FindNullDeref { /** * Determine whether or not given instruction is a goto . * @ param instruction * the instruction * @ return true if the instruction is a goto , false otherwise */ private boolean isGoto ( Instruction instruction ) { } }
return instruction . getOpcode ( ) == Const . GOTO || instruction . getOpcode ( ) == Const . GOTO_W ;
public class Tile { /** * Defines the color that will be used to colorize the bar of * the gauge ( if it has a bar ) . * @ param COLOR */ public void setBarColor ( final Color COLOR ) { } }
if ( null == barColor ) { _barColor = COLOR ; fireTileEvent ( REDRAW_EVENT ) ; } else { barColor . set ( COLOR ) ; }
public class Miscellaneous { /** * Counts how many times the substring appears in the larger String . < / p > * A < code > null < / code > or empty ( " " ) String input returns * < code > 0 < / code > . < / p > * < pre > * StringUtils . countMatches ( null , * ) = 0 * StringUtils . countMatches ( " " , * ) = ...
if ( isEmpty ( str ) || isEmpty ( subStrRegExp ) ) { return 0 ; } Pattern p = Pattern . compile ( subStrRegExp ) ; Matcher m = p . matcher ( str ) ; int count = 0 ; while ( m . find ( ) ) { count += 1 ; } return count ;
public class TaskInProgress { /** * Return the dispatch time */ public long getDispatchTime ( TaskAttemptID taskid ) { } }
Long l = dispatchTimeMap . get ( taskid ) ; if ( l != null ) { return l . longValue ( ) ; } return 0 ;
public class StringParser { /** * Parse the given { @ link String } as int with the specified radix . * @ param sStr * The String to parse . May be < code > null < / code > . * @ param nRadix * The radix to use . Must be & ge ; { @ link Character # MIN _ RADIX } and & le ; * { @ link Character # MAX _ RADIX }...
if ( sStr != null && sStr . length ( ) > 0 ) try { return Integer . parseInt ( sStr , nRadix ) ; } catch ( final NumberFormatException ex ) { // Fall through } return nDefault ;
public class MvtUtil { /** * Return whether the MVT geometry type should be closed with a { @ link GeomCmd # ClosePath } . * @ param geomType the type of MVT geometry * @ return true if the geometry should be closed , false if it should not be closed */ public static boolean shouldClosePath ( VectorTile . Tile . Ge...
final boolean closeReq ; switch ( geomType ) { case POLYGON : closeReq = true ; break ; default : closeReq = false ; break ; } return closeReq ;
public class FibonacciHeap { /** * Inserts a new entry into the heap and returns the entry if heap is not full . Returns absent otherwise . * No heap consolidation is performed . * Runtime : O ( 1) */ public Entry add ( V value , P priority ) { } }
Preconditions . checkNotNull ( value ) ; Preconditions . checkNotNull ( priority ) ; if ( size >= MAX_CAPACITY ) return null ; final Entry result = new Entry ( value , priority ) ; // add as a root oMinEntry = mergeLists ( result , oMinEntry ) ; size ++ ; return result ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcAssemblyPlaceEnum ( ) { } }
if ( ifcAssemblyPlaceEnumEEnum == null ) { ifcAssemblyPlaceEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 782 ) ; } return ifcAssemblyPlaceEnumEEnum ;
public class Context2 { /** * Process a raw XML 1.0 name in this context . * @ param qName The raw XML 1.0 name . * @ param isAttribute true if this is an attribute name . * @ return An array of three strings containing the * URI part ( or empty string ) , the local part , * and the raw name , all internalize...
String name [ ] ; Hashtable table ; // Select the appropriate table . if ( isAttribute ) { if ( elementNameTable == null ) elementNameTable = new Hashtable ( ) ; table = elementNameTable ; } else { if ( attributeNameTable == null ) attributeNameTable = new Hashtable ( ) ; table = attributeNameTable ; } // Start by look...
public class Strings { /** * Convert the first letter of each words of target * to uppercase ( title - case , in fact ) * for all the elements in the target set . * The default delimiter characters between the words are * the whitespace characters * ( see Characters . IsWhiteSpace method in the Java documenta...
if ( target == null ) { return null ; } final Set < String > result = new LinkedHashSet < String > ( target . size ( ) + 2 ) ; for ( final Object element : target ) { result . add ( capitalizeWords ( element ) ) ; } return result ;
public class PersistentExecutorImpl { /** * { @ inheritDoc } */ @ Override public void startPolling ( ) { } }
Config config = configRef . get ( ) ; if ( config . initialPollDelay != - 1 ) throw new IllegalStateException ( "initialPollDelay: " + config . initialPollDelay ) ; if ( ! deactivated && ! pollingStartSignalReceived . getAndSet ( true ) && readyForPollingTask . addAndCheckIfReady ( PollingManager . SIGNAL_RECEIVED ) ) ...
public class IIRFilterBase { /** * Call this to initialize . Will set the memory to 0 * @ since 09.01.2012 */ public void initialize ( final int sampleRate , final int channels , final int frequency , final float parameter ) { } }
this . frequency = frequency ; this . sampleRate = sampleRate ; inArray = new float [ channels ] [ HISTORYSIZE ] ; outArray = new float [ channels ] [ HISTORYSIZE ] ; clearHistory ( ) ;
public class CommerceDiscountPersistenceImpl { /** * Returns the first commerce discount in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code...
CommerceDiscount commerceDiscount = fetchByUuid_C_First ( uuid , companyId , orderByComparator ) ; if ( commerceDiscount != null ) { return commerceDiscount ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . append ( ", ...
public class RequestUtil { /** * 从cookie获取用户通行证 . * @ param request * @ return */ public static String getCookieUsername ( HttpServletRequest request ) { } }
String username = CookieUtil . getCookie ( "username" , request ) ; try { username = URLDecoder . decode ( username , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e . getMessage ( ) , e ) ; } return username ;
public class TopicsInner { /** * Update a topic . * Asynchronously updates a topic with the specified parameters . * @ param resourceGroupName The name of the resource group within the user ' s subscription . * @ param topicName Name of the topic * @ param tags Tags of the resource * @ param serviceCallback t...
return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , topicName , tags ) , serviceCallback ) ;
public class BandwidthClient { /** * Validate if the credentials are set and has access to catapult */ private static void validateCredentials ( ) { } }
try { Account . get ( ) . getAccountInfo ( ) ; } catch ( Exception e ) { if ( e instanceof AppPlatformException ) { AppPlatformException appEx = ( AppPlatformException ) e ; if ( appEx . getStatus ( ) == 401 ) { throw new InvalidCredentialsException ( ) ; } } else { throw new RuntimeException ( e ) ; } }
public class Network { /** * This registers objects that are going to be sent over the network . */ static public void register ( EndPoint endPoint ) { } }
Kryo kryo = endPoint . getKryo ( ) ; // This must be called in order to use ObjectSpaces . ObjectSpace . registerClasses ( kryo ) ; // The interfaces that will be used as remote objects must be registered . kryo . register ( IPlayer . class ) ; kryo . register ( IChatFrame . class ) ; // The classes of all method param...
public class QueryController { /** * Returns whether query belongs to given panel * @ param query query * @ param panel panel * @ return whether query belongs to given panel */ public boolean isPanelsQuery ( Query query , Panel panel ) { } }
Panel queryPanel = resourceController . getResourcePanel ( query ) ; if ( queryPanel == null || panel == null ) { return false ; } return queryPanel . getId ( ) . equals ( panel . getId ( ) ) ;
public class MailUtil { /** * 将多个联系人转为列表 , 分隔符为逗号或者分号 * @ param addresses 多个联系人 , 如果为空返回null * @ return 联系人列表 */ private static List < String > splitAddress ( String addresses ) { } }
if ( StrUtil . isBlank ( addresses ) ) { return null ; } List < String > result ; if ( StrUtil . contains ( addresses , ',' ) ) { result = StrUtil . splitTrim ( addresses , ',' ) ; } else if ( StrUtil . contains ( addresses , ';' ) ) { result = StrUtil . splitTrim ( addresses , ';' ) ; } else { result = CollUtil . newA...
public class JavaMod { /** * parses through the parameter - params ( starting with ' - ' ) are not * allowed here - we filter them out * @ since 31.12.2010 * @ param args * @ return the given filename */ private static String getFileName ( String [ ] args ) { } }
String fileName = null ; for ( int i = 0 ; i < args . length ; i ++ ) { if ( ! args [ i ] . startsWith ( "-" ) ) { fileName = args [ i ] ; break ; } } return fileName ;
public class BaseNarrativeGenerator { /** * Trims the superfluous whitespace out of an HTML block */ public static String cleanWhitespace ( String theResult ) { } }
StringBuilder b = new StringBuilder ( ) ; boolean inWhitespace = false ; boolean betweenTags = false ; boolean lastNonWhitespaceCharWasTagEnd = false ; boolean inPre = false ; for ( int i = 0 ; i < theResult . length ( ) ; i ++ ) { char nextChar = theResult . charAt ( i ) ; if ( inPre ) { b . append ( nextChar ) ; cont...
public class IOUtils { /** * Read column as set * @ param infile - filename * @ param field index of field to read * @ return a set of the entries in column field * @ throws IOException */ public static Set < String > readColumnSet ( String infile , int field ) throws IOException { } }
BufferedReader br = IOUtils . getBufferedFileReader ( infile ) ; String line ; Set < String > set = new HashSet < String > ( ) ; while ( ( line = br . readLine ( ) ) != null ) { line = line . trim ( ) ; if ( line . length ( ) > 0 ) { if ( field < 0 ) { set . add ( line ) ; } else { String [ ] fields = tab . split ( lin...
public class StartContinuousExportRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( StartContinuousExportRequest startContinuousExportRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( startContinuousExportRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ParseIntRanges { /** * Parse integer ranges , in different syntaxes . * < code > * 1,2,3 , . . . , 10 * 1,3 , , 10 * 1,3 , . . , 10 * 1,3 , . . . , 10 * 1 , + = 2,10 * 1 , * = 2,16 * 1,2,3,4 , . . , 10,100 * 100,1,3 , . . , 10 * 1,2 , . . , 10,20 , . . , 100,200 , . . , 1000 * < / cod...
ArrayList < IntGenerator > generators = new ArrayList < > ( ) ; IntegerArray ints = new IntegerArray ( ) ; int last = Integer . MAX_VALUE ; // Last seen integer for ( int pos = 0 , next = - 1 ; pos < str . length ( ) ; pos = next + 1 ) { // Find next comma : next = nextSep ( str , pos ) ; // Syntaxes involving " , , " ...
public class MemoryMapArchiveBase { /** * Used to retrieve a { @ link Node } from the content of the { @ link Archive } . If the { @ link Node } doesn � t exists in * the specified location , it is created and added to the { @ link Archive } . The same happens to all its non - existing * parents . However , if the ...
if ( path == null ) { return null ; } NodeImpl node = content . get ( path ) ; // If the node exists , just return it if ( node != null ) { // if the node is an asset , throw an exception if ( node . getAsset ( ) != null ) { throw new IllegalArchivePathException ( "Could not create node under " + path . getParent ( ) +...
public class ThreadedEventProviderIT { /** * Parameterizes the test instances . * @ return Collection of parameters for the constructor of * { @ link EventProviderTestBase } . */ @ Parameters public static final Collection < Object [ ] > getParameters ( ) { } }
return Arrays . asList ( new Object [ ] { ( Function < ListenerStore , ? extends EventProvider > ) ParallelEventProvider :: new , ( Supplier < ListenerStore > ) ( ) -> DefaultListenerStore . create ( ) . synchronizedView ( ) } , new Object [ ] { ( Function < ListenerStore , ? extends EventProvider > ) AsynchronousEvent...
public class BuildMojo { /** * check for a run - java . sh dependency an extract the script to target / if found */ private void executeBuildPlugins ( ) { } }
try { Enumeration < URL > dmpPlugins = Thread . currentThread ( ) . getContextClassLoader ( ) . getResources ( DMP_PLUGIN_DESCRIPTOR ) ; while ( dmpPlugins . hasMoreElements ( ) ) { URL dmpPlugin = dmpPlugins . nextElement ( ) ; File outputDir = getAndEnsureOutputDirectory ( ) ; processDmpPluginDescription ( dmpPlugin ...
public class TypicalFaihyApiFailureHook { @ Override public ApiResponse handleApplicationException ( ApiFailureResource resource , RuntimeException cause ) { } }
final FaihyUnifiedFailureType failureType = FaihyUnifiedFailureType . BUSINESS_ERROR ; final FaihyUnifiedFailureResult result = createFailureResult ( failureType , resource , cause ) ; return asJson ( result ) . httpStatus ( prepareBusinessFailureStatus ( ) ) ;
public class TaskGroupInformation { /** * Creates a new builder of convert type with the specified parameters . * @ param input the input format * @ param output the output format * @ return returns a new builder */ public static Builder newConvertBuilder ( String input , String output ) { } }
return new Builder ( input , output , TaskGroupActivity . CONVERT ) ;
public class ChunkMapReader { /** * Read processing metadata from processing instructions . */ private void readProcessingInstructions ( final Document doc ) { } }
final NodeList docNodes = doc . getChildNodes ( ) ; for ( int i = 0 ; i < docNodes . getLength ( ) ; i ++ ) { final Node node = docNodes . item ( i ) ; if ( node . getNodeType ( ) == Node . PROCESSING_INSTRUCTION_NODE ) { final ProcessingInstruction pi = ( ProcessingInstruction ) node ; switch ( pi . getNodeName ( ) ) ...
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcBlock ( ) { } }
if ( ifcBlockEClass == null ) { ifcBlockEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 41 ) ; } return ifcBlockEClass ;
public class MavenHelpers { /** * Returns true if the list has the given dependency */ public static boolean hasDependency ( List < org . apache . maven . model . Dependency > dependencies , String groupId , String artifactId ) { } }
if ( dependencies != null ) { for ( org . apache . maven . model . Dependency dependency : dependencies ) { if ( Objects . equal ( groupId , dependency . getGroupId ( ) ) && Objects . equal ( artifactId , dependency . getArtifactId ( ) ) ) { return true ; } } } return false ;
public class AttachThingPrincipalRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AttachThingPrincipalRequest attachThingPrincipalRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( attachThingPrincipalRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( attachThingPrincipalRequest . getThingName ( ) , THINGNAME_BINDING ) ; protocolMarshaller . marshall ( attachThingPrincipalRequest . getPrincipal ( ) , PRINC...
public class MessageStoreImpl { /** * register new Item link . * @ param newLink * @ param item */ public final void registerLink ( final AbstractItemLink newLink , final AbstractItem item ) { } }
register ( newLink ) ; _setMembership ( newLink , item ) ;
public class AbstractFlatteningPersonAttributeDao { /** * / * ( non - Javadoc ) * @ see org . jasig . services . persondir . IPersonAttributeDao # getPeople ( java . util . Map ) */ @ Override public final Set < IPersonAttributes > getPeople ( final Map < String , Object > query , final IPersonAttributeDaoFilter filt...
final Map < String , List < Object > > multivaluedSeed = MultivaluedPersonAttributeUtils . toMultivaluedMap ( query ) ; return this . getPeopleWithMultivaluedAttributes ( multivaluedSeed , filter ) ;
public class TableFinishOperator { /** * Both the statistics and the row _ count + fragments are transferred over the same communication * link between the TableWriterOperator and the TableFinishOperator . Thus the multiplexing is needed . * The transferred page layout looks like : * [ [ row _ count _ channel ] ,...
return page . getBlock ( ROW_COUNT_CHANNEL ) . isNull ( position ) && page . getBlock ( FRAGMENT_CHANNEL ) . isNull ( position ) ;
public class CardAPI { /** * 更改卡券信息接口 ( 优惠券 ) * @ param accessToken accessToken * @ param updateGeneralCoupon updateGeneralCoupon * @ return result */ public static UpdateResult update ( String accessToken , UpdateGeneralCoupon updateGeneralCoupon ) { } }
return update ( accessToken , JsonUtil . toJSONString ( updateGeneralCoupon ) ) ;
public class vm_device { /** * < pre > * Converts API response of bulk operation into object and returns the object array in case of get request . * < / pre > */ protected base_resource [ ] get_nitro_bulk_response ( nitro_service service , String response ) throws Exception { } }
vm_device_responses result = ( vm_device_responses ) service . get_payload_formatter ( ) . string_to_resource ( vm_device_responses . class , response ) ; if ( result . errorcode != 0 ) { if ( result . errorcode == SESSION_NOT_EXISTS ) service . clear_session ( ) ; throw new nitro_exception ( result . message , result ...
public class InsertStmt { /** * Gets the . * @ param _ printStmt the print stmt * @ return the prints the stmt */ public static InsertStmt get ( final IInsertStatement _insertStmt ) { } }
final InsertStmt ret = new InsertStmt ( ) ; ret . setEQLStmt ( _insertStmt ) ; return ret ;
public class MongoDBBasicOperations { /** * Get the basic services from mongo template */ private synchronized void fetchMappingContextAndConversionService ( ) { } }
if ( mappingContext == null ) { MongoConverter mongoConverter = this . mongoTemplate . getConverter ( ) ; mappingContext = mongoConverter . getMappingContext ( ) ; conversionService = mongoConverter . getConversionService ( ) ; MongoPersistentEntity < ? > persistentEntity = mappingContext . getPersistentEntity ( entity...
public class CassandraEmbeddedStoreManager { /** * Raw type warnings are suppressed in this method because * { @ link StorageService # getLocalPrimaryRanges ( String ) } returns a raw * ( unparameterized ) type . */ public List < KeyRange > getLocalKeyPartition ( ) throws BackendException { } }
ensureKeyspaceExists ( keySpaceName ) ; @ SuppressWarnings ( "rawtypes" ) Collection < Range < Token > > ranges = StorageService . instance . getPrimaryRanges ( keySpaceName ) ; List < KeyRange > keyRanges = new ArrayList < KeyRange > ( ranges . size ( ) ) ; for ( @ SuppressWarnings ( "rawtypes" ) Range < Token > range...
public class DirectMetaProperty { /** * Factory to create a derived read - only meta - property avoiding duplicate generics . * @ param < P > the property type * @ param metaBean the meta - bean , not null * @ param propertyName the property name , not empty * @ param declaringType the type declaring the proper...
Field field = findField ( metaBean , propertyName ) ; return new DirectMetaProperty < > ( metaBean , propertyName , declaringType , propertyType , PropertyStyle . DERIVED , field ) ;
public class MetricValue { /** * Construct a metric value from a Number implementation . * @ param number A floating point or integral type . * @ return a MetricValue holding the specified number . * @ throws IllegalArgumentException if the derived type of Number is not recognized . */ public static MetricValue f...
if ( number == null ) { return EMPTY ; } else if ( number instanceof Float || number instanceof Double ) { return fromDblValue ( number . doubleValue ( ) ) ; } else if ( number instanceof Byte || number instanceof Short || number instanceof Integer || number instanceof Long ) { return fromIntValue ( number . longValue ...
public class BlockingInputStream { /** * Verifies that length doesn ' t exceed a buffer ' s length * @ param buf * @ param offset * @ param length */ protected static void sanityCheck ( byte [ ] buf , int offset , int length ) { } }
if ( buf == null ) throw new NullPointerException ( "buffer is null" ) ; if ( offset + length > buf . length ) throw new ArrayIndexOutOfBoundsException ( "length (" + length + ") + offset (" + offset + ") > buf.length (" + buf . length + ")" ) ;
public class SpringRegistrator { /** * - - - LOAD MOLECULER SERVICES - - - */ @ Override public void setApplicationContext ( ApplicationContext applicationContext ) throws BeansException { } }
try { HashSet < Class < ? > > registeredTypes = new HashSet < > ( ) ; // Get Service Broker ServiceBroker broker = applicationContext . getBean ( ServiceBroker . class ) ; // Find Services in Spring Application Context Map < String , Service > serviceMap = applicationContext . getBeansOfType ( Service . class ) ; if ( ...
public class XmlAssert { /** * Check if actual value is valid against schema provided by given sources * @ throws AssertionError if the actual value is { @ code null } . * @ throws AssertionError if the actual value is invalid */ public XmlAssert isValidAgainst ( Object ... schemaSources ) { } }
isNotNull ( ) ; ValidationAssert . create ( actual , schemaSources ) . isValid ( ) ; return this ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public OBPXoaOrent createOBPXoaOrentFromString ( EDataType eDataType , String initialValue ) { } }
OBPXoaOrent result = OBPXoaOrent . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class FeatureLinkHelper { /** * / * @ Nullable */ public LightweightTypeReference getExpectedReceiverType ( JvmIdentifiableElement linkedFeature , LightweightTypeReference receiverType ) { } }
if ( receiverType . isMultiType ( ) && linkedFeature instanceof JvmMember ) { LightweightTypeReference declaratorReference = receiverType . getOwner ( ) . newParameterizedTypeReference ( ( ( JvmMember ) linkedFeature ) . getDeclaringType ( ) ) ; if ( ! declaratorReference . isAssignableFrom ( receiverType . toJavaType ...
public class ZNeedle { /** * Get a string from the frame */ public String getShortString ( ) { } }
String value = Wire . getShortString ( needle , needle . position ( ) ) ; forward ( value . length ( ) + 1 ) ; return value ;
public class MethodAttribUtils { /** * Check BMT beans for unneeded Tran Attributes in XML ( ie . WCCM ) */ public static final void chkBMTFromXML ( List < ContainerTransaction > tranAttrList , EnterpriseBean enterpriseBean , J2EEName j2eeName ) { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "chkBMTFromXML" ) ; if ( tranAttrList != null && enterpriseBean != null ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "tranAttrList non-null" ) ; // Elements of highestS...
public class Javalin { /** * Adds a PUT request handler with the given roles for the specified path to the instance . * Requires an access manager to be set on the instance . * @ see AccessManager * @ see < a href = " https : / / javalin . io / documentation # handlers " > Handlers in docs < / a > */ public Javal...
return addHandler ( HandlerType . PUT , path , handler , permittedRoles ) ;
public class A_CmsGroupEditor { /** * Enables or disables the save button . < p > * @ param enabled < code > true < / code > to enable the save button * @ param disabledMessage the message to display when the button is disabled */ protected void setSaveEnabled ( boolean enabled , String disabledMessage ) { } }
if ( m_saveButton != null ) { if ( enabled ) { m_saveButton . enable ( ) ; } else { m_saveButton . disable ( disabledMessage ) ; } }
public class ApiOvhDedicatedCloud { /** * Add a new Datacenter in your Private Cloud * REST : POST / dedicatedCloud / { serviceName } / datacenter * @ param vrackName [ required ] Name of the Vrack link to the new datacenter . * @ param commercialRangeName [ required ] The commercial range of this new datacenter ...
String qPath = "/dedicatedCloud/{serviceName}/datacenter" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "commercialRangeName" , commercialRangeName ) ; addBody ( o , "vrackName" , vrackName ) ; String resp = exec ( qPath , "POST" ...
public class ByteBufferOutputStream { public void ensureCapacity ( int n ) throws IOException { } }
// Do we have space ? if ( n > capacity ( ) ) { // Make a bigger buffer if we are allowed . if ( _fixed ) throw new IllegalStateException ( "Fixed" ) ; int new_size = ( ( n + _preReserve + _postReserve + 4095 ) / 4096 ) * 4096 ; byte [ ] old = _buf ; _buf = new byte [ new_size ] ; if ( _pos > _start ) System . arraycop...
public class PlingStemmer { /** * Test routine */ public static void main ( String [ ] argv ) throws Exception { } }
System . out . println ( "Enter an English word in plural form and press ENTER" ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; while ( true ) { String w = in . readLine ( ) ; if ( w . length ( ) == 0 ) break ; if ( isPlural ( w ) ) System . out . println ( "This word is plural" )...