signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ExcelFunctions { /** * Returns the first characters in a text string */ public static String left ( EvaluationContext ctx , Object text , Object numChars ) { } }
int _numChars = Conversions . toInteger ( numChars , ctx ) ; if ( _numChars < 0 ) { throw new RuntimeException ( "Number of chars can't be negative" ) ; } return StringUtils . left ( Conversions . toString ( text , ctx ) , _numChars ) ;
public class Movie { /** * Gets the width of this movie ' s display area * @ return int */ public int getWidth ( ) { } }
if ( getAttributes ( ) . isDefined ( Attribute . WIDTH ) ) { final int wide = ( int ) ( getAttributes ( ) . getWidth ( ) + 0.5 ) ; if ( wide > 0 ) { return wide ; } } if ( null != m_video ) { return m_video . getVideoWidth ( ) ; } return 0 ;
public class BitcoinBlockReader { /** * Parse an AUXPowBranch * @ param rawByteBuffer ByteBuffer from which the AuxPOWBranch should be parsed * @ return AuxPOWBranch */ public BitcoinAuxPOWBranch parseAuxPOWBranch ( ByteBuffer rawByteBuffer ) { } }
byte [ ] noOfLinksVarInt = BitcoinUtil . convertVarIntByteBufferToByteArray ( rawByteBuffer ) ; long currentNoOfLinks = BitcoinUtil . getVarInt ( noOfLinksVarInt ) ; ArrayList < byte [ ] > links = new ArrayList ( ( int ) currentNoOfLinks ) ; for ( int i = 0 ; i < currentNoOfLinks ; i ++ ) { byte [ ] currentLink = new b...
public class Math { /** * Returns the sample correlation matrix . * @ param mu the known mean of data . */ public static double [ ] [ ] cor ( double [ ] [ ] data , double [ ] mu ) { } }
double [ ] [ ] sigma = cov ( data , mu ) ; int n = data [ 0 ] . length ; double [ ] sd = new double [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { sd [ i ] = sqrt ( sigma [ i ] [ i ] ) ; } for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j <= i ; j ++ ) { sigma [ i ] [ j ] /= sd [ i ] * sd [ j ] ; sigma [ j ] [ i ] = s...
public class sdcard { /** * Check if file exists on SDCard or not * @ param filePath - its the path of the file after SDCardDirectory ( no need for * getExternalStorageDirectory ( ) ) * @ return boolean - if file exist on SDCard or not */ public static boolean checkIfFileExists ( String filePath ) { } }
File file = new File ( filePath ) ; // getSDCardPath ( ) , filePath ) ; return ( file . exists ( ) ? true : false ) ;
public class ServerJFapCommunicator { /** * Sets the CommsConnection associated with this Conversation * @ param cc */ @ Override protected void setCommsConnection ( CommsConnection cc ) { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setCommsConnection" ) ; // Retrieve Client Conversation State if necessary validateConversationState ( ) ; sConState . setCommsConnection ( cc ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setCommsConnection" ) ;
public class AbstractDomainQuery { /** * Create a match from a DomainObjectMatch specified in the context of another query * @ param domainObjectMatch a match specified in the context of another query * @ return a DomainObjectMatch */ @ SuppressWarnings ( "unchecked" ) public < T > DomainObjectMatch < T > createMat...
DomainObjectMatch < T > ret ; FromPreviousQueryExpression pqe ; DomainObjectMatch < ? > match ; DomainObjectMatch < ? > delegate = APIAccess . getDelegate ( domainObjectMatch ) ; if ( delegate != null ) { // generic model DomainObjectMatch < ? > newDelegate = APIAccess . createDomainObjectMatch ( delegate , this . quer...
public class ClosureSignatureHint { /** * A helper method which will extract the n - th generic type from a class node . * @ param type the class node from which to pick a generic type * @ param gtIndex the index of the generic type to extract * @ return the n - th generic type , or { @ link org . codehaus . groo...
final GenericsType [ ] genericsTypes = type . getGenericsTypes ( ) ; if ( genericsTypes == null || genericsTypes . length < gtIndex ) { return ClassHelper . OBJECT_TYPE ; } return genericsTypes [ gtIndex ] . getType ( ) ;
public class GetInstanceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetInstanceRequest getInstanceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getInstanceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getInstanceRequest . getInstanceName ( ) , INSTANCENAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + ...
public class ItemHandlerImpl { /** * Updates the existing node with the properties ( and optionally children ) as described by { @ code jsonNode } . * @ param node the node to be updated * @ param jsonNode the JSON - encoded representation of the node or nodes to be updated . * @ param changes the versionable cha...
// If the JSON object has a properties holder , then this is likely a subgraph . . . JsonNode properties = jsonNode ; if ( jsonNode . has ( PROPERTIES_HOLDER ) ) { properties = jsonNode . get ( PROPERTIES_HOLDER ) ; } changes . checkout ( node ) ; // Change the primary type first . . . if ( properties . has ( PRIMARY_T...
public class URLRewritingPolicy { /** * Finds all matching instances of the regular expression and replaces them with * the replacement value . * @ param headerValue * @ param fromRegex * @ param toReplacement */ private String doHeaderReplaceAll ( String headerValue , String fromRegex , String toReplacement ) ...
return headerValue . replaceAll ( fromRegex , toReplacement ) ;
public class MemcachedClient { /** * Get the values for multiple keys from the cache . * @ param keyIter Iterator that produces the keys * @ return a map of the values ( for each value that exists ) * @ throws OperationTimeoutException if the global operation timeout is * exceeded * @ throws IllegalStateExcep...
return getBulk ( keyIter , transcoder ) ;
public class PropertiesTableModel { /** * { @ inheritDoc } */ @ Override public Object getValueAt ( final int rowIndex , final int columnIndex ) { } }
final String key = ( String ) data . get ( rowIndex ) ; final PropertiesColumns column = PropertiesColumns . values ( ) [ columnIndex ] ; switch ( column ) { case KEY : return key ; case VALUE : return data . get ( key ) ; } return null ;
public class MutableBigInteger { /** * A primitive used for division by long . * Specialized version of the method divadd . * dh is a high part of the divisor , dl is a low part */ private int divaddLong ( int dh , int dl , int [ ] result , int offset ) { } }
long carry = 0 ; long sum = ( dl & LONG_MASK ) + ( result [ 1 + offset ] & LONG_MASK ) ; result [ 1 + offset ] = ( int ) sum ; sum = ( dh & LONG_MASK ) + ( result [ offset ] & LONG_MASK ) + carry ; result [ offset ] = ( int ) sum ; carry = sum >>> 32 ; return ( int ) carry ;
public class PutVoiceConnectorOriginationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PutVoiceConnectorOriginationRequest putVoiceConnectorOriginationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( putVoiceConnectorOriginationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( putVoiceConnectorOriginationRequest . getVoiceConnectorId ( ) , VOICECONNECTORID_BINDING ) ; protocolMarshaller . marshall ( putVoiceConnectorOrigina...
public class vrid { /** * Use this API to fetch all the vrid resources that are configured on netscaler . */ public static vrid [ ] get ( nitro_service service ) throws Exception { } }
vrid obj = new vrid ( ) ; vrid [ ] response = ( vrid [ ] ) obj . get_resources ( service ) ; return response ;
public class DisconfItemCoreProcessorImpl { /** * 更新一个配置 */ private void updateOneConfItem ( String keyName , DisconfCenterItem disconfCenterItem ) throws Exception { } }
if ( disconfCenterItem == null ) { throw new Exception ( "cannot find disconfCenterItem " + keyName ) ; } String value = null ; // 开启disconf才需要远程下载 , 否则就用默认值 if ( DisClientConfig . getInstance ( ) . ENABLE_DISCONF ) { // 下载配置 try { String url = disconfCenterItem . getRemoteServerUrl ( ) ; value = fetcherMgr . getValueF...
public class TunnelConnection { /** * Closes the underlying ssh session causing all tunnels to be closed . */ public void close ( ) throws IOException { } }
if ( session != null && session . isConnected ( ) ) { session . disconnect ( ) ; } session = null ; // unnecessary , but seems right to undo what we did for ( Tunnel tunnel : tunnels ) { tunnel . setAssignedLocalPort ( 0 ) ; }
public class MoreMeters { /** * Returns a newly - created immutable { @ link Map } which contains all values of { @ link Meter } s in the * specified { @ link MeterRegistry } . The format of the key string is : * < ul > * < li > { @ code < name > # < statistic > { tagName = tagValue , . . . } } < / li > * < li ...
requireNonNull ( registry , "registry" ) ; final ImmutableMap . Builder < String , Double > builder = ImmutableMap . builder ( ) ; registry . forEachMeter ( meter -> Streams . stream ( meter . measure ( ) ) . forEach ( measurement -> { final String fullName = measurementName ( meter . getId ( ) , measurement ) ; final ...
public class AbstractSynchronizationFuture { /** * Start the internal synchronization task . */ protected void init ( ) { } }
// create a synchronisation task which makes sure that the change requested by // the internal future has at one time been synchronized to the remote synchronisationFuture = GlobalCachedExecutorService . submit ( ( ) -> { dataProvider . addDataObserver ( notifyChangeObserver ) ; try { dataProvider . waitForData ( ) ; T...
public class ShardingProperties { /** * Get property value . * @ param shardingPropertiesConstant sharding properties constant * @ param < T > class type of return value * @ return property value */ @ SuppressWarnings ( "unchecked" ) public < T > T getValue ( final ShardingPropertiesConstant shardingPropertiesCon...
if ( cachedProperties . containsKey ( shardingPropertiesConstant ) ) { return ( T ) cachedProperties . get ( shardingPropertiesConstant ) ; } String value = props . getProperty ( shardingPropertiesConstant . getKey ( ) ) ; if ( Strings . isNullOrEmpty ( value ) ) { Object obj = props . get ( shardingPropertiesConstant ...
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcSpatialZoneTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class CronMapper { /** * Creates a CronMapper that maps a cron4j expression to a quartz expression . * @ return a CronMapper for mapping from cron4j to quartz */ public static CronMapper fromCron4jToQuartz ( ) { } }
return new CronMapper ( CronDefinitionBuilder . instanceDefinitionFor ( CronType . CRON4J ) , CronDefinitionBuilder . instanceDefinitionFor ( CronType . QUARTZ ) , setQuestionMark ( ) ) ;
public class GetReservationCoverageRequest { /** * The measurement that you want your reservation coverage reported in . * Valid values are < code > Hour < / code > , < code > Unit < / code > , and < code > Cost < / code > . You can use multiple values in a * request . * @ param metrics * The measurement that y...
if ( metrics == null ) { this . metrics = null ; return ; } this . metrics = new java . util . ArrayList < String > ( metrics ) ;
public class HttpOutboundServiceContextImpl { /** * Once we know we are reconnected to the target server , reset the TCP * buffers and start the async resend . */ protected void nowReconnectedAsync ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Reconnected async for " + this ) ; } // reset the data buffers first if ( ! resetWriteBuffers ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Resetting buffers (async) ...
public class RippleEffectDrawer { /** * Performs the entire Ripple Effect drawing frame by frame animating the process * Calls the { @ link ActionButton # postInvalidate ( ) } after each { @ link # currentRadius } update * to draw the current frame animating the ripple effect drawing * @ param canvas canvas , whi...
updateRadius ( ) ; drawRipple ( canvas ) ; ViewInvalidator invalidator = getActionButton ( ) . getInvalidator ( ) ; if ( isDrawingInProgress ( ) ) { invalidator . requireInvalidation ( ) ; LOGGER . trace ( "Drawing Ripple Effect in progress, invalidating the Action Button" ) ; } else if ( isDrawingFinished ( ) && ! isP...
public class XDSConsumerAuditor { /** * Audits an ITI - 16 Registry Query event for XDS . a Document Consumer actors . * @ param eventOutcome The event outcome indicator * @ param registryEndpointUri The endpoint of the registry in this transaction * @ param adhocQueryRequestPayload The payload of the adhoc query...
if ( ! isAuditorEnabled ( ) ) { return ; } auditQueryEvent ( true , new IHETransactionEventTypeCodes . RegistrySQLQuery ( ) , eventOutcome , getAuditSourceId ( ) , getAuditEnterpriseSiteId ( ) , getSystemUserId ( ) , getSystemAltUserId ( ) , getSystemUserName ( ) , getSystemNetworkId ( ) , consumerUserName , consumerUs...
public class LoadBalancerProbesInner { /** * Gets load balancer probe . * @ param resourceGroupName The name of the resource group . * @ param loadBalancerName The name of the load balancer . * @ param probeName The name of the probe . * @ throws IllegalArgumentException thrown if parameters fail the validation...
return getWithServiceResponseAsync ( resourceGroupName , loadBalancerName , probeName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class WTree { /** * { @ inheritDoc } */ @ Override public Set < String > getRequestValue ( final Request request ) { } }
if ( isPresent ( request ) ) { return getNewSelections ( request ) ; } else { return getValue ( ) ; }
public class ModuleTypeLoader { /** * @ param name The name * @ return The result of stripping all trailing occurrences of array brackets ( " [ ] " ) * from < code > name < / code > . Examples : * < pre > * entity . Coverage = > entity . Coverage * entity . Coverage [ ] = > entity . Coverage * entity . Cove...
if ( name == null ) { return "" ; } int checkPos = name . length ( ) ; while ( checkPos > 2 && name . charAt ( checkPos - 2 ) == '[' && name . charAt ( checkPos - 1 ) == ']' ) { checkPos -= 2 ; } assert checkPos <= name . length ( ) ; return checkPos == name . length ( ) ? name : name . substring ( 0 , checkPos ) ;
public class MonitoringConfigurationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( MonitoringConfiguration monitoringConfiguration , ProtocolMarshaller protocolMarshaller ) { } }
if ( monitoringConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( monitoringConfiguration . getConfigurationType ( ) , CONFIGURATIONTYPE_BINDING ) ; protocolMarshaller . marshall ( monitoringConfiguration . getMetricsLevel ( ) ...
public class VocabularyHolder { /** * This method removes low - frequency words based on their frequency change between activations . * I . e . if word has appeared only once , and it ' s retained the same frequency over consequence activations , we can assume it can be removed freely */ protected synchronized void a...
int initialSize = vocabulary . size ( ) ; List < VocabularyWord > words = new ArrayList < > ( vocabulary . values ( ) ) ; for ( VocabularyWord word : words ) { // scavenging could be applied only to non - special tokens that are below minWordFrequency if ( word . isSpecial ( ) || word . getCount ( ) >= minWordFrequency...
public class RaftSessionInvoker { /** * Submits an operation attempt . * @ param attempt The attempt to submit . */ private < T extends OperationRequest , U extends OperationResponse > void invoke ( OperationAttempt < T , U > attempt ) { } }
if ( state . getState ( ) == PrimitiveState . CLOSED ) { attempt . fail ( new PrimitiveException . ClosedSession ( "session closed" ) ) ; } else { attempts . put ( attempt . sequence , attempt ) ; attempt . send ( ) ; attempt . future . whenComplete ( ( r , e ) -> attempts . remove ( attempt . sequence ) ) ; }
public class SibRaManagedConnectionFactory { /** * Creates a managed connection containing a core SPI connection . If the * request information already contains a core SPI connection , this will be * a clone of that connection . If a new core SPI connection is required then * the credentials will be those from th...
if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "createManagedConnection" , new Object [ ] { SibRaUtils . subjectToString ( subject ) , requestInfo } ) ; } if ( requestInfo == null ) { // This typically indicates that the connection mangaer is trying // to obtain an XAResource during transaction reco...
public class Crypto { /** * Generates Private Key from Base64 encoded string * @ param key Base64 encoded string which represents the key * @ return The PrivateKey * @ throws MangooEncryptionException if getting private key from string fails */ public PrivateKey getPrivateKeyFromString ( String key ) throws Mango...
Objects . requireNonNull ( key , Required . KEY . toString ( ) ) ; try { return KeyFactory . getInstance ( ALGORITHM ) . generatePrivate ( new PKCS8EncodedKeySpec ( decodeBase64 ( key ) ) ) ; } catch ( InvalidKeySpecException | NoSuchAlgorithmException e ) { throw new MangooEncryptionException ( "Failed to get private ...
public class PoolThreadCache { /** * Try to allocate a tiny buffer out of the cache . Returns { @ code true } if successful { @ code false } otherwise */ boolean allocateTiny ( PoolArena < ? > area , PooledByteBuf < ? > buf , int reqCapacity , int normCapacity ) { } }
return allocate ( cacheForTiny ( area , normCapacity ) , buf , reqCapacity ) ;
public class CollationKey { /** * Produces a bound for the sort order of a given collation key and a * strength level . This API does not attempt to find a bound for the * CollationKey String representation , hence null will be returned in its * place . * Resulting bounds can be used to produce a range of strin...
// Scan the string until we skip enough of the key OR reach the end of // the key int offset = 0 ; int keystrength = Collator . PRIMARY ; if ( noOfLevels > Collator . PRIMARY ) { while ( offset < m_key_ . length && m_key_ [ offset ] != 0 ) { if ( m_key_ [ offset ++ ] == Collation . LEVEL_SEPARATOR_BYTE ) { keystrength ...
public class InstanceAggregatedAssociationOverview { /** * The number of associations for the instance ( s ) . * @ param instanceAssociationStatusAggregatedCount * The number of associations for the instance ( s ) . * @ return Returns a reference to this object so that method calls can be chained together . */ pu...
setInstanceAssociationStatusAggregatedCount ( instanceAssociationStatusAggregatedCount ) ; return this ;
public class CrawlToCsv { /** * Get the options . * @ return the specific CrawlToCsv options */ @ Override protected Options getOptions ( ) { } }
final Options options = super . getOptions ( ) ; final Option filenameOption = new Option ( "f" , "the name of the csv output file, default name is " + DEFAULT_FILENAME + " [optional]" ) ; filenameOption . setArgName ( "FILENAME" ) ; filenameOption . setLongOpt ( "filename" ) ; filenameOption . setRequired ( false ) ; ...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcTopologicalRepresentationItem ( ) { } }
if ( ifcTopologicalRepresentationItemEClass == null ) { ifcTopologicalRepresentationItemEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 725 ) ; } return ifcTopologicalRepresentationItemEClass ;
public class InstanceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Instance instance , ProtocolMarshaller protocolMarshaller ) { } }
if ( instance == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( instance . getAgentVersion ( ) , AGENTVERSION_BINDING ) ; protocolMarshaller . marshall ( instance . getAmiId ( ) , AMIID_BINDING ) ; protocolMarshaller . marshall ( instance ....
public class PoolWaitFuture { /** * { @ inheritDoc } */ @ Override public T get ( ) throws InterruptedException , ExecutionException { } }
try { return get ( 0 , TimeUnit . MILLISECONDS ) ; } catch ( TimeoutException ex ) { throw new ExecutionException ( ex ) ; }
public class RBFInterpolation { /** * Interpolate the function at given point . */ public double interpolate ( double ... x ) { } }
if ( x . length != this . x [ 0 ] . length ) { throw new IllegalArgumentException ( String . format ( "Invalid input vector size: %d, expected: %d" , x . length , this . x [ 0 ] . length ) ) ; } double sum = 0.0 , sumw = 0.0 ; for ( int i = 0 ; i < this . x . length ; i ++ ) { double f = rbf . f ( Math . distance ( x ,...
public class DFSck { /** * Print fsck usage information */ static void printUsage ( ) { } }
System . err . println ( "Usage: DFSck <path> [-list-corruptfileblocks | " + "[-move | -delete | -openforwrite ] " + "[-files [-blocks [-locations | -racks]]]] " + "[-limit <limit>] [-service serviceName]" + "[-(zero/one)]" ) ; System . err . println ( "\t<path>\tstart checking from this path" ) ; System . err . printl...
public class UserZoneEventHandler { /** * ( non - Javadoc ) * @ see com . tvd12 . ezyfox . sfs2x . serverhandler . ServerUserEventHandler # init ( ) */ @ Override protected void init ( ) { } }
handlers = new ZoneEventHandlerCenter ( ) . addHandlers ( handlerClasses , context . getUserClass ( ) , context . getGameUserClasses ( ) ) ;
public class CdnClient { /** * Delete an existing domain acceleration * @ param request The request containing user - defined domain information . * @ return Result of the deleteDomain operation returned by the service . */ public DeleteDomainResponse deleteDomain ( DeleteDomainRequest request ) { } }
checkNotNull ( request , "The parameter request should NOT be null." ) ; InternalRequest internalRequest = createRequest ( request , HttpMethodName . DELETE , DOMAIN , request . getDomain ( ) ) ; return invokeHttpClient ( internalRequest , DeleteDomainResponse . class ) ;
public class WMultiSelectPairRenderer { /** * Renders the options in list order . * @ param multiSelectPair the WMultiSelectPair to paint . * @ param options the options to render * @ param startIndex the starting option index * @ param xml the XmlStringBuilder to paint to . * @ param renderSelectionsOnly tru...
List < ? > selections = multiSelectPair . getSelected ( ) ; int optionIndex = startIndex ; for ( Object option : options ) { if ( option instanceof OptionGroup ) { xml . appendTagOpen ( "ui:optgroup" ) ; xml . appendAttribute ( "label" , ( ( OptionGroup ) option ) . getDesc ( ) ) ; xml . appendClose ( ) ; // Recurse to...
public class BooleanUtils { /** * < p > Converts an Integer to a Boolean using the convention that { @ code zero } * is { @ code false } . < / p > * < p > { @ code null } will be converted to { @ code null } . < / p > * < p > NOTE : This returns null and will throw a NullPointerException if unboxed to a boolean ....
if ( value == null ) { return null ; } return value . intValue ( ) == 0 ? Boolean . FALSE : Boolean . TRUE ;
public class DbService { /** * Returns all model classes registered on this datasource * @ return model classes talk to this datasource */ public Set < Class > entityClasses ( ) { } }
EntityMetaInfoRepo repo = app ( ) . entityMetaInfoRepo ( ) . forDb ( id ) ; return null == repo ? C . < Class > set ( ) : repo . entityClasses ( ) ;
public class HttpClient { /** * Expects the Absolute URL for the Request * @ param uri * @ return * @ throws HibiscusException */ public HttpClient setURI ( final String uri ) throws HibiscusException { } }
try { setURI ( new URI ( uri ) ) ; } catch ( URISyntaxException e ) { throw new HibiscusException ( e ) ; } return this ;
public class af_config_info { /** * < pre > * Use this operation to delete a property . * < / pre > */ public static af_config_info delete ( nitro_service client , af_config_info resource ) throws Exception { } }
resource . validate ( "delete" ) ; return ( ( af_config_info [ ] ) resource . delete_resource ( client ) ) [ 0 ] ;
public class PrototypeMeasurementFilter { /** * Find the IncludeExcludePatterns for filtering a given metric . * The result is the union of all the individual pattern entries * where their specified metric name patterns matches the actual metric name . */ public IncludeExcludePatterns metricToPatterns ( String metr...
IncludeExcludePatterns foundPatterns = metricNameToPatterns . get ( metric ) ; if ( foundPatterns != null ) { return foundPatterns ; } // Since the keys in the prototype can be regular expressions , // need to look at all of them and can potentially match multiple , // each having a different set of rules . foundPatter...
public class ServiceBackedDataModel { /** * Calls the service to obtain data . Implementations should make a service call using the * callback provided . If needCount is set , the implementation should also request the total * number of items from the server ( this is normally done in the same call that requests a ...
callFetchService ( request . offset , request . count , request . needCount , callback ) ;
public class AWSIoTAnalyticsClient { /** * Sets or updates the AWS IoT Analytics logging options . * Note that if you update the value of any < code > loggingOptions < / code > field , it takes up to one minute for the * change to take effect . Also , if you change the policy attached to the role you specified in t...
request = beforeClientExecution ( request ) ; return executePutLoggingOptions ( request ) ;
public class AbstractDocumentSource { /** * Resolves all { @ link SwaggerExtension } instances configured to be added to the Swagger configuration . * @ return List of { @ link SwaggerExtension } which should be added to the swagger configuration * @ throws GenerateException if the swagger extensions could not be c...
List < String > clazzes = apiSource . getSwaggerExtensions ( ) ; List < SwaggerExtension > resolved = new ArrayList < SwaggerExtension > ( ) ; if ( clazzes != null ) { for ( String clazz : clazzes ) { SwaggerExtension extension = null ; // Try to get a parameterized constructor for extensions that are log - enabled . t...
public class AMIImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . AMI__DSPLCMNT : setDSPLCMNT ( DSPLCMNT_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class Vector4f { /** * Set this { @ link Vector4f } to the values of the given < code > v < / code > . * Note that due to the given vector < code > v < / code > storing the components in double - precision , * there is the possibility to lose precision . * @ param v * the vector whose values will be copi...
return set ( ( float ) v . x ( ) , ( float ) v . y ( ) , ( float ) v . z ( ) , ( float ) v . w ( ) ) ;
public class MtasTokenCollection { /** * Check . * @ param autoRepair the auto repair * @ param makeUnique the make unique * @ throws MtasParserException the mtas parser exception */ public void check ( Boolean autoRepair , Boolean makeUnique ) throws MtasParserException { } }
if ( autoRepair ) { autoRepair ( ) ; } if ( makeUnique ) { makeUnique ( ) ; } checkTokenCollectionIndex ( ) ; for ( Integer i : tokenCollectionIndex ) { // minimal properties if ( tokenCollection . get ( i ) . getId ( ) == null || tokenCollection . get ( i ) . getPositionStart ( ) == null || tokenCollection . get ( i )...
public class WidgetPopupMenuModel { /** * return true if we reset settings for a dashboard link with UserWidgetParameters */ private void resetSettings ( FeedbackPanel feedbackPanel , Component component , Widget widget , AjaxRequestTarget target ) { } }
// on reset settings we must delete UserWidgetParameters if any try { UserWidgetParameters wp = dashboardService . getUserWidgetParameters ( widget . getId ( ) ) ; if ( wp != null ) { storageService . removeEntityById ( wp . getId ( ) ) ; dashboardService . resetCache ( widget . getId ( ) ) ; final WidgetPanel widgetPa...
public class KeyCount { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */ public boolean isSet ( _Fields field ) { } }
if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case KEY : return isSetKey ( ) ; case COUNT : return isSetCount ( ) ; } throw new IllegalStateException ( ) ;
public class PlainDeserializer { /** * < p > Deserializes the response content to a type which is assignable to { @ link CharSequence } . < / p > * @ see AbstractDeserializer # run ( InvocationContext , HttpResponse ) */ @ Override public CharSequence deserialize ( InvocationContext context , HttpResponse response ) ...
try { HttpEntity entity = response . getEntity ( ) ; return entity == null ? "" : EntityUtils . toString ( entity ) ; } catch ( Exception e ) { throw new DeserializerException ( new StringBuilder ( "Plain deserialization failed for request <" ) . append ( context . getRequest ( ) . getName ( ) ) . append ( "> on endpoi...
public class MmffAtomTypeMatcher { /** * Obtain the MMFF symbolic types to the atoms of the provided structure . * @ param container structure representation * @ param graph adj list data structure * @ param bonds bond lookup map * @ param mmffArom flags which bonds are aromatic by MMFF model * @ return MMFF ...
// Array of symbolic types , MMFF refers to these as ' SYMB ' and the numeric // value a s ' TYPE ' . final String [ ] symbs = new String [ container . getAtomCount ( ) ] ; checkPreconditions ( container ) ; assignPreliminaryTypes ( container , symbs ) ; // aromatic types , set by upgrading preliminary types in specifi...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcMaterialList ( ) { } }
if ( ifcMaterialListEClass == null ) { ifcMaterialListEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 366 ) ; } return ifcMaterialListEClass ;
public class GenericStatsDecorator { /** * Get array of Strings from metrics - one from each with given Extractor . * @ param metrics metrics to extract values from . * @ param e extractor that extracts values * @ return array of corresponding strings . */ private static String [ ] extract ( List < ? extends IGen...
List < String > strings = new ArrayList < > ( metrics . size ( ) ) ; for ( IGenericMetrics metric : metrics ) { strings . add ( e . extract ( metric ) ) ; } return strings . toArray ( new String [ strings . size ( ) ] ) ;
public class UrlUtil { /** * Tries to open an { @ link InputStream } to the given { @ link URL } . * @ param url * URL which should be opened * @ return opened stream * @ throws net . sf . qualitycheck . exception . IllegalNullArgumentException * if the given argument is { @ code null } * @ throws CanNotOpe...
Check . notNull ( url , "url" ) ; final InputStream ret ; try { ret = url . openStream ( ) ; } catch ( final IOException e ) { throw new CanNotOpenStreamException ( url . toString ( ) , e ) ; } return ret ;
public class PipedInputStream { /** * { @ inheritDoc } * < p > Unlike most streams , { @ code PipedInputStream } returns 0 rather than throwing * { @ code IOException } if the stream has been closed . Unconnected and broken pipes also * return 0. * @ throws IOException if an I / O error occurs */ @ Override pub...
if ( buffer == null || in == - 1 ) { return 0 ; } return in <= out ? buffer . length - out + in : in - out ;
public class VoltTable { /** * Make a printable , short string for a varbinary . * String includes a CRC and the contents of the varbinary in hex . * Contents longer than 13 chars are truncated and elipsized . * Yes , " elipsized " is totally a word . * Example : " bin [ crc : 1298399436 , value : 0xABCDEF12345...
PureJavaCrc32 crc = new PureJavaCrc32 ( ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "bin[crc:" ) ; crc . update ( bin ) ; sb . append ( crc . getValue ( ) ) ; sb . append ( ",value:0x" ) ; String hex = Encoder . hexEncode ( bin ) ; if ( hex . length ( ) > 13 ) { sb . append ( hex . substring ( 0 , 10 )...
public class KriptonBinderResponseBodyConverter { /** * / * ( non - Javadoc ) * @ see retrofit2 . Converter # convert ( java . lang . Object ) */ @ Override public T convert ( ResponseBody value ) throws IOException { } }
try { return ( T ) binderContext . parse ( value . byteStream ( ) , clazz ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; return null ; } finally { value . close ( ) ; }
public class JSONCompareUtil { /** * Creates a cardinality map from { @ code coll } . * @ param coll the collection of items to convert * @ param < T > the type of elements in the input collection * @ return the cardinality map */ public static < T > Map < T , Integer > getCardinalityMap ( final Collection < T > ...
Map count = new HashMap < T , Integer > ( ) ; for ( T item : coll ) { Integer c = ( Integer ) ( count . get ( item ) ) ; if ( c == null ) { count . put ( item , INTEGER_ONE ) ; } else { count . put ( item , new Integer ( c . intValue ( ) + 1 ) ) ; } } return count ;
public class OrmLiteDefaultContentProvider { /** * @ see android . content . ContentProvider # getType ( android . net . Uri ) */ @ Override public String getType ( Uri uri ) { } }
if ( ! controller . hasPreinitialized ( ) ) { throw new IllegalStateException ( "Controller has not been initialized." ) ; } int patternCode = controller . getUriMatcher ( ) . match ( uri ) ; MatcherPattern pattern = controller . findMatcherPattern ( patternCode ) ; if ( pattern == null ) { throw new IllegalArgumentExc...
public class DefaultApplicationContext { /** * Start the environment . */ protected void startEnvironment ( ) { } }
Environment defaultEnvironment = getEnvironment ( ) ; defaultEnvironment . start ( ) ; registerSingleton ( Environment . class , defaultEnvironment ) ; registerSingleton ( new AnnotationProcessorListener ( ) ) ;
public class CertificateUtils { /** * Find a PrivateKeyInfo in the PEM object details . Returns null if the PEM object type is unknown . */ @ CheckForNull private static PrivateKeyInfo getPrivateKeyInfoOrNull ( Object pemObject ) throws NoSuchAlgorithmException { } }
PrivateKeyInfo privateKeyInfo = null ; if ( pemObject instanceof PEMKeyPair ) { PEMKeyPair pemKeyPair = ( PEMKeyPair ) pemObject ; privateKeyInfo = pemKeyPair . getPrivateKeyInfo ( ) ; } else if ( pemObject instanceof PrivateKeyInfo ) { privateKeyInfo = ( PrivateKeyInfo ) pemObject ; } else if ( pemObject instanceof AS...
public class XMLStreamReader { /** * Utility method that initialize a XMLStreamReader , initialize it , and * return an AsyncWork which is unblocked when characters are available to be read . */ public static AsyncWork < XMLStreamReader , Exception > start ( IO . Readable . Buffered io , int charactersBufferSize , in...
AsyncWork < XMLStreamReader , Exception > result = new AsyncWork < > ( ) ; new Task . Cpu . FromRunnable ( "Start reading XML " + io . getSourceDescription ( ) , io . getPriority ( ) , ( ) -> { XMLStreamReader reader = new XMLStreamReader ( io , charactersBufferSize , maxBuffers ) ; try { Starter start = new Starter ( ...
public class OrderManager { /** * Place an order and retry if Exception occur * @ param order - new BitfinexOrder to place * @ throws BitfinexClientException * @ throws InterruptedException */ public void placeOrderAndWaitUntilActive ( final BitfinexNewOrder order ) throws BitfinexClientException , InterruptedExc...
final BitfinexApiKeyPermissions capabilities = client . getApiKeyPermissions ( ) ; if ( ! capabilities . isOrderWritePermission ( ) ) { throw new BitfinexClientException ( "Unable to wait for order " + order + " connection has not enough capabilities: " + capabilities ) ; } order . setApiKey ( client . getConfiguration...
public class DescribeContinuousExportsRequest { /** * The unique IDs assigned to the exports . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setExportIds ( java . util . Collection ) } or { @ link # withExportIds ( java . util . Collection ) } if you want t...
if ( this . exportIds == null ) { setExportIds ( new java . util . ArrayList < String > ( exportIds . length ) ) ; } for ( String ele : exportIds ) { this . exportIds . add ( ele ) ; } return this ;
public class NoCompTreeMap { /** * Returns an unmodifiable set view of the map entries . */ public final Set < Map . Entry < K , V > > entrySet ( ) { } }
return new AbstractSet < Map . Entry < K , V > > ( ) { public Iterator < Map . Entry < K , V > > iterator ( ) { return entryIterator ( ) ; } public int size ( ) { return size ; } } ;
public class DefinitionsDocument { /** * Builds definition title * @ param markupDocBuilder the markupDocBuilder do use for output * @ param title definition title * @ param anchor optional anchor ( null = > auto - generate from title ) */ private void buildDefinitionTitle ( MarkupDocBuilder markupDocBuilder , St...
markupDocBuilder . sectionTitleWithAnchorLevel2 ( title , anchor ) ;
public class MultipleAlignmentScorer { /** * Calculates and puts the RMSD and the average TM - Score of the * MultipleAlignment . * @ param alignment * @ throws StructureException * @ see # getAvgTMScore ( MultipleAlignment ) * @ see # getRMSD ( MultipleAlignment ) */ public static void calculateScores ( Mult...
// Put RMSD List < Atom [ ] > trans = MultipleAlignmentTools . transformAtoms ( alignment ) ; alignment . putScore ( RMSD , getRMSD ( trans ) ) ; // Put AvgTM - Score List < Integer > lengths = new ArrayList < Integer > ( alignment . size ( ) ) ; for ( Atom [ ] atoms : alignment . getAtomArrays ( ) ) { lengths . add ( ...
public class PollingBasedFileMonitor { /** * Polls the file system for a file change ( synchronized ) * @ param currentTimeMillis * @ return true if the file has changed */ private synchronized boolean poll ( long currentTimeMillis ) { } }
long timeDiffMillis = currentTimeMillis - _lastPolled ; if ( timeDiffMillis > POLL_THRESHOLD_MILLIS ) { final long lastModifiedBefore = _lastModified ; _lastModified = _file . lastModified ( ) ; _lastPolled = System . currentTimeMillis ( ) ; return _lastModified != lastModifiedBefore ; } return false ;
public class RespokeGroup { /** * Notify the group that a connection has joined . This is used internally to the SDK and should not be called directly by your client application . * @ param connection The connection that has joined the group */ public void connectionDidJoin ( final RespokeConnection connection ) { } ...
members . add ( connection ) ; new Handler ( Looper . getMainLooper ( ) ) . post ( new Runnable ( ) { @ Override public void run ( ) { Listener listener = listenerReference . get ( ) ; if ( null != listener ) { listener . onJoin ( connection , RespokeGroup . this ) ; } } } ) ;
public class CPDefinitionSpecificationOptionValueUtil { /** * Returns a range of all the cp definition specification option values where CPDefinitionId = & # 63 ; and CPSpecificationOptionId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start...
return getPersistence ( ) . findByC_CSO ( CPDefinitionId , CPSpecificationOptionId , start , end ) ;
public class InstanceFleetTimelineMarshaller { /** * Marshall the given parameter object . */ public void marshall ( InstanceFleetTimeline instanceFleetTimeline , ProtocolMarshaller protocolMarshaller ) { } }
if ( instanceFleetTimeline == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( instanceFleetTimeline . getCreationDateTime ( ) , CREATIONDATETIME_BINDING ) ; protocolMarshaller . marshall ( instanceFleetTimeline . getReadyDateTime ( ) , READY...
public class AuthzFacadeImpl { /** * / * ( non - Javadoc ) * @ see com . att . authz . facade . AuthzFacade # cacheClear ( com . att . authz . env . AuthzTrans , java . lang . String , java . lang . Integer ) */ @ Override public Result < Void > cacheClear ( AuthzTrans trans , String cname , String segments ) { } }
TimeTaken tt = trans . start ( CACHE_CLEAR + cname + ", segments[" + segments + ']' , Env . SUB | Env . ALWAYS ) ; try { String [ ] segs = segments . split ( "\\s*,\\s*" ) ; int isegs [ ] = new int [ segs . length ] ; for ( int i = 0 ; i < segs . length ; ++ i ) { try { isegs [ i ] = Integer . parseInt ( segs [ i ] ) ;...
public class ExternalType { /** * { @ inheritDoc } */ @ Override public final void to ( ObjectOutput out ) throws IOException { } }
if ( out == null ) throw new NullPointerException ( ) ; // delegate to the equivalent internal method _to ( out ) ;
public class AmazonAlexaForBusinessClient { /** * Makes a private skill unavailable for enrolled users and prevents them from enabling it on their devices . * @ param disassociateSkillFromUsersRequest * @ return Result of the DisassociateSkillFromUsers operation returned by the service . * @ throws ConcurrentModi...
request = beforeClientExecution ( request ) ; return executeDisassociateSkillFromUsers ( request ) ;
public class ImageModerationsImpl { /** * Fuzzily match an image against one of your custom Image Lists . You can create and manage your custom image lists using & lt ; a href = " / docs / services / 578ff44d2703741568569ab9 / operations / 578ff7b12703741568569abe " & gt ; this & lt ; / a & gt ; API . * Returns ID an...
if ( this . client . baseUrl ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.baseUrl() is required and cannot be null." ) ; } if ( imageStream == null ) { throw new IllegalArgumentException ( "Parameter imageStream is required and cannot be null." ) ; } String parameterizedHost = Joiner . on...
public class JavaParser { /** * src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1157:1 : andExpression : equalityExpression ( ' & ' equalityExpression ) * ; */ public final void andExpression ( ) throws RecognitionException { } }
int andExpression_StartIndex = input . index ( ) ; try { if ( state . backtracking > 0 && alreadyParsedRule ( input , 115 ) ) { return ; } // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1158:5 : ( equalityExpression ( ' & ' equalityExpression ) * ) // src / main / resources...
public class dnsaction { /** * Use this API to unset the properties of dnsaction resource . * Properties that need to be unset are specified in args array . */ public static base_response unset ( nitro_service client , dnsaction resource , String [ ] args ) throws Exception { } }
dnsaction unsetresource = new dnsaction ( ) ; unsetresource . actionname = resource . actionname ; return unsetresource . unset_resource ( client , args ) ;
public class ToleranceRangeRule { /** * Validate the Tolerance Range of this IMolecularFormula . * @ param formula Parameter is the IMolecularFormula * @ return A double value meaning 1.0 True , 0.0 False */ @ Override public double validate ( IMolecularFormula formula ) throws CDKException { } }
logger . info ( "Start validation of " , formula ) ; double totalExactMass = MolecularFormulaManipulator . getTotalExactMass ( formula ) ; if ( Math . abs ( totalExactMass - mass ) > tolerance ) return 0.0 ; else return 1.0 ;
public class Server { /** * This is a wrapper around { @ link ReadableByteChannel # read ( ByteBuffer ) } . * If the amount of data is large , it writes to channel in smaller chunks . * This is to avoid jdk from creating many direct buffers as the size of * ByteBuffer increases . There should not be any performan...
return ( buffer . remaining ( ) <= NIO_BUFFER_LIMIT ) ? channel . read ( buffer ) : channelIO ( channel , null , buffer ) ;
public class MessageControllerManager { /** * without jdk8 , @ Repeatable doesn ' t work , so we use @ JsTopicControls annotation and parse it * @ param topic * @ return */ JsTopicMessageController getJsTopicMessageControllerFromJsTopicControls ( String topic ) { } }
logger . debug ( "Looking for messageController for topic '{}' from JsTopicControls annotation" , topic ) ; Instance < JsTopicMessageController < ? > > select = topicMessageController . select ( new JsTopicCtrlsAnnotationLiteral ( ) ) ; if ( select . isUnsatisfied ( ) ) { return null ; } return getJsTopicMessageControl...
public class Base64Utils { /** * Base64 - decode the given byte array from an UTF - 8 String . * @ param src the encoded UTF - 8 String ( may be { @ code null } ) * @ return the original byte array ( or { @ code null } if the input was { @ code null } ) * @ since 2.0 */ public static byte [ ] decodeFromString ( S...
if ( src == null ) { return null ; } if ( src . length ( ) == 0 ) { return new byte [ 0 ] ; } byte [ ] result ; try { result = delegate . decode ( src . getBytes ( DEFAULT_CHARSET . displayName ( ) ) ) ; } catch ( UnsupportedEncodingException e ) { // should not happen , UTF - 8 is always supported throw new IllegalSta...
public class AbstractPlane4F { /** * { @ inheritDoc } */ @ Override public void absolute ( ) { } }
this . set ( Math . abs ( getEquationComponentA ( ) ) , Math . abs ( getEquationComponentB ( ) ) , Math . abs ( getEquationComponentC ( ) ) , Math . abs ( getEquationComponentD ( ) ) ) ;
public class ConfigurationContext { /** * Guicey bundle manual disable registration from * { @ link ru . vyarus . dropwizard . guice . GuiceBundle . Builder # disableBundles ( Class [ ] ) } . * @ param bundles modules to disable */ @ SuppressWarnings ( "PMD.UseVarargs" ) public void disableBundle ( final Class < ? ...
for ( Class < ? extends GuiceyBundle > bundle : bundles ) { registerDisable ( ConfigItem . Bundle , bundle ) ; }
public class BeanO { /** * Obtain the < code > Identity < / code > of the bean associated with * this < code > BeanO < / code > . < p > */ @ Override @ Deprecated public java . security . Identity getCallerIdentity ( ) { } }
EJSDeployedSupport s = EJSContainer . getMethodContext ( ) ; // Method not allowed from ejbTimeout . LI2281.07 if ( s != null && s . methodInfo . ivInterface == MethodInterface . TIMED_OBJECT ) { IllegalStateException ise = new IllegalStateException ( "getCallerIdentity() not " + "allowed from ejbTimeout" ) ; if ( Trac...
public class CalendarThinTableModel { /** * Create a CalendarItem Proxy using this field list . * Usually , you use CalendarItemFieldListProxy , or override it . */ public CalendarItem getFieldListProxy ( FieldList fieldList ) { } }
return new CalendarItemFieldListProxy ( fieldList , m_strStartDateTimeField , m_strEndDateTimeField , m_strDescriptionField , m_strStatusField ) ;
public class CommerceNotificationQueueEntryPersistenceImpl { /** * Clears the cache for all commerce notification queue entries . * The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */ @ Override public void clearCache ( ) { } }
entityCache . clearCache ( CommerceNotificationQueueEntryImpl . class ) ; finderCache . clearCache ( FINDER_CLASS_NAME_ENTITY ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public IfcObjectTypeEnum createIfcObjectTypeEnumFromString ( EDataType eDataType , String initialValue ) { } }
IfcObjectTypeEnum result = IfcObjectTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class CmsFormatterSelectWidget { /** * Updates the select options from the given entity . < p > * @ param entity a top - level content entity */ public void update ( CmsEntity entity ) { } }
String removeAllFlag = CmsEntity . getValueForPath ( entity , m_valuePath ) ; boolean allRemoved = Boolean . valueOf ( removeAllFlag ) . booleanValue ( ) ; replaceOptions ( allRemoved ? m_optionsAllRemoved : m_optionsDefault ) ;
public class JSONTokener { /** * Returns the next { @ code length } characters of the input . * < p > The returned string shares its backing character array with this * tokener ' s input string . If a reference to the returned string may be held * indefinitely , you should use { @ code new String ( result ) } to ...
if ( pos + length > in . length ( ) ) { throw syntaxError ( length + " is out of bounds" ) ; } String result = in . substring ( pos , pos + length ) ; pos += length ; return result ;