signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class MessageEndpointFactoryImpl { /** * Indicates what version of JCA specification the RA using
* this MessageEndpointFactory requires compliance with .
* @ see com . ibm . ws . jca . service . WSMessageEndpointFactory # setJCAVersion ( int , int ) */
@ Override public void setJCAVersion ( int majorJCAVer ... | majorJCAVersion = majorJCAVer ; minorJCAVersion = minorJCAVer ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "MessageEndpointFactoryImpl.setJCAVersionJCA: Version " + majorJCAVersion + "." + minorJCAVersion + " is set" ) ; } |
public class RequestedGlobalProperties { /** * Parameterizes the ship strategy fields of a channel such that the channel produces the desired global properties .
* @ param channel The channel to parameterize .
* @ param globalDopChange
* @ param localDopChange */
public void parameterizeChannel ( Channel channel ... | // if we request nothing , then we need no special strategy . forward , if the number of instances remains
// the same , randomly repartition otherwise
if ( isTrivial ( ) ) { channel . setShipStrategy ( globalDopChange ? ShipStrategyType . PARTITION_RANDOM : ShipStrategyType . FORWARD ) ; return ; } final GlobalPropert... |
public class LottieAnimationView { /** * Add a property callback for the specified { @ link KeyPath } . This { @ link KeyPath } can resolve
* to multiple contents . In that case , the callback ' s value will apply to all of them .
* Internally , this will check if the { @ link KeyPath } has already been resolved wi... | lottieDrawable . addValueCallback ( keyPath , property , callback ) ; |
public class SparseInstanceData { /** * Deletes an attribute at the given position ( 0 to numAttributes ( ) - 1 ) .
* @ param position the attribute ' s position */
@ Override public void deleteAttributeAt ( int position ) { } } | int index = locateIndex ( position ) ; this . numberAttributes -- ; if ( ( index >= 0 ) && ( indexValues [ index ] == position ) ) { int [ ] tempIndices = new int [ indexValues . length - 1 ] ; double [ ] tempValues = new double [ attributeValues . length - 1 ] ; System . arraycopy ( indexValues , 0 , tempIndices , 0 ,... |
public class AdminTaskResource { /** * Enqueue an admin task for processing .
* The request will return immediately and the task will be run in a separate thread .
* The execution model depending on the implementation of the queue .
* @ param taskName task name
* @ return */
@ GET @ Path ( "{taskName}" ) public... | checkNotNull ( taskName ) ; taskQueue . enqueueTask ( taskName , requestParamsProvider . get ( ) ) ; return Response . ok ( ) . build ( ) ; |
public class BasicParallelSearch { /** * This algorithm consists of a single search step only , in which ( 1 ) the contained subsearches are executed in
* parallel , ( 2 ) the main search waits until they terminate and ( 3 ) the main search stops . A subsearch may terminate
* because it has come to its natural end ... | // (1 ) execute subsearches in parallel
searches . forEach ( s -> futures . add ( pool . submit ( s ) ) ) ; // (2 ) wait for termination of subsearches
while ( ! futures . isEmpty ( ) ) { try { futures . poll ( ) . get ( ) ; } catch ( InterruptedException | ExecutionException ex ) { throw new SearchException ( "An erro... |
public class DayPeriodRules { /** * Helpers . */
private void add ( int startHour , int limitHour , DayPeriod period ) { } } | for ( int i = startHour ; i != limitHour ; ++ i ) { if ( i == 24 ) { i = 0 ; } dayPeriodForHour [ i ] = period ; } |
public class DescribeLagsResult { /** * The LAGs .
* @ param lags
* The LAGs . */
public void setLags ( java . util . Collection < Lag > lags ) { } } | if ( lags == null ) { this . lags = null ; return ; } this . lags = new com . amazonaws . internal . SdkInternalList < Lag > ( lags ) ; |
public class Tuple6 { /** * Split this tuple into two tuples of degree 0 and 6. */
public final Tuple2 < Tuple0 , Tuple6 < T1 , T2 , T3 , T4 , T5 , T6 > > split0 ( ) { } } | return new Tuple2 < > ( limit0 ( ) , skip0 ( ) ) ; |
public class Closure { /** * Creates a caching variant of the closure with automatic cache size adjustment and lower and upper limits
* on the cache size .
* Whenever the closure is called , the mapping between the parameters and the return value is preserved in cache
* making subsequent calls with the same argum... | if ( protectedCacheSize < 0 ) throw new IllegalArgumentException ( "A non-negative number is required as the protectedCacheSize parameter for memoizeBetween." ) ; if ( maxCacheSize < 0 ) throw new IllegalArgumentException ( "A non-negative number is required as the maxCacheSize parameter for memoizeBetween." ) ; if ( p... |
public class IndexedSourceMapConsumer { /** * The list of original sources . */
@ Override public List < String > sources ( ) { } } | List < String > sources = new ArrayList < > ( ) ; for ( int i = 0 ; i < this . _sections . size ( ) ; i ++ ) { for ( int j = 0 ; j < this . _sections . get ( i ) . consumer . sources ( ) . size ( ) ; j ++ ) { sources . add ( this . _sections . get ( i ) . consumer . sources ( ) . get ( j ) ) ; } } return sources ; |
public class MiscUtil { /** * Uses standard JDK java to read an inputstream to String using the given encoding ( in { @ link ByteArrayOutputStream # toString ( String ) } ) . */
@ Nonnull public static String readInputStreamToString ( @ Nonnull final InputStream inputStream , @ Nonnull final Charset charset ) throws IO... | final BufferedInputStream bufferedInputStream = new BufferedInputStream ( inputStream ) ; final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream ( ) ; int result = bufferedInputStream . read ( ) ; while ( result != - 1 ) { byteArrayOutputStream . write ( ( byte ) result ) ; result = bufferedInput... |
public class HelloServlet { @ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { } } | Window window = new Window ( ) ; window . add ( new Text ( "Hello world!" ) ) ; Reflector < Component > reflector = new HtmlComponentReflector ( ) ; response . setContentType ( reflector . getContentType ( ) ) ; try { reflector . reflect ( window , response . getWriter ( ) ) ; } catch ( ReflectorException exception ) {... |
public class AccessControlList { /** * { @ inheritDoc } */
public void writeExternal ( ObjectOutput out ) throws IOException { } } | // Writing owner
if ( owner != null ) { out . writeInt ( owner . getBytes ( ) . length ) ; out . write ( owner . getBytes ( ) ) ; } else { out . writeInt ( 0 ) ; } // writing access control entrys size
out . writeInt ( accessList . size ( ) ) ; for ( AccessControlEntry entry : accessList ) { // writing access control e... |
public class OntClassMention { /** * getter for semanticTypes - gets Names or IDs of associated semantic types .
* @ generated
* @ return value of the feature */
public StringArray getSemanticTypes ( ) { } } | if ( OntClassMention_Type . featOkTst && ( ( OntClassMention_Type ) jcasType ) . casFeat_semanticTypes == null ) jcasType . jcas . throwFeatMissing ( "semanticTypes" , "de.julielab.jules.types.OntClassMention" ) ; return ( StringArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ... |
public class Replication { /** * Sets the documents to specify as part of the replication . */
@ InterfaceAudience . Public public void setDocIds ( List < String > docIds ) { } } | properties . put ( ReplicationField . DOC_IDS , docIds ) ; replicationInternal . setDocIds ( docIds ) ; |
public class UnionType { /** * Returns a more restricted union type than { @ code this } one , in which all
* subtypes of { @ code type } have been removed . < p >
* Examples :
* < ul >
* < li > { @ code ( number , string ) } restricted by { @ code number } is
* { @ code string } < / li >
* < li > { @ code ... | UnionTypeBuilder restricted = UnionTypeBuilder . create ( registry ) ; for ( int i = 0 ; i < alternates . size ( ) ; i ++ ) { JSType t = alternates . get ( i ) ; // Keep all unknown / unresolved types .
if ( t . isUnknownType ( ) || t . isNoResolvedType ( ) || ! t . isSubtypeOf ( type ) ) { restricted . addAlternate ( ... |
public class CompileUtils { /** * To output more information when an error occurs .
* Generally , when cook fails , it shows which line is wrong . This line number starts at 1. */
private static String addLineNumber ( String code ) { } } | String [ ] lines = code . split ( "\n" ) ; StringBuilder builder = new StringBuilder ( ) ; for ( int i = 0 ; i < lines . length ; i ++ ) { builder . append ( "/* " ) . append ( i + 1 ) . append ( " */" ) . append ( lines [ i ] ) . append ( "\n" ) ; } return builder . toString ( ) ; |
public class BottomSheet { /** * Creates and returns the layout params , which should be used to show the bottom sheet ' s root
* view .
* @ return The layout params , which have been created , as an instance of the class { @ link
* android . widget . FrameLayout . LayoutParams } */
private FrameLayout . LayoutPa... | FrameLayout . LayoutParams layoutParams = new FrameLayout . LayoutParams ( FrameLayout . LayoutParams . MATCH_PARENT , FrameLayout . LayoutParams . MATCH_PARENT ) ; layoutParams . gravity = Gravity . BOTTOM | Gravity . CENTER_HORIZONTAL ; return layoutParams ; |
public class ImageMiscOps { /** * In - place 90 degree image rotation in the counter - clockwise direction . Only works on
* square images . */
public static void rotateCCW ( GrayS64 image ) { } } | if ( image . width != image . height ) throw new IllegalArgumentException ( "Image must be square" ) ; int w = image . height / 2 + image . height % 2 ; int h = image . height / 2 ; for ( int y0 = 0 ; y0 < h ; y0 ++ ) { int y1 = image . height - y0 - 1 ; for ( int x0 = 0 ; x0 < w ; x0 ++ ) { int x1 = image . width - x0... |
public class MPORGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . MPORG__RG_LENGTH : return getRGLength ( ) ; case AfplibPackage . MPORG__TRIPLETS : return getTriplets ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class DaoTemplate { /** * 增加或者更新实体
* @ param entity 实体 , 当包含主键时更新 , 否则新增
* @ return 新增或更新条数
* @ throws SQLException SQL执行异常 */
public int addOrUpdate ( Entity entity ) throws SQLException { } } | return null == entity . get ( primaryKeyField ) ? add ( entity ) : update ( entity ) ; |
public class JmsJcaActivationSpecImpl { /** * ( non - Javadoc )
* @ see com . ibm . ws . sib . api . jmsra . JmsJcaActivationSpec # setClientId ( java . lang . String ) */
@ Override public void setClientId ( final String clientId ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "setClientId" , clientId ) ; } _clientId = clientId ; |
public class NotificationDelegater { /** * Initialization .
* @ see NotificationDelegater # LOCAL
* @ see NotificationDelegater # GLOBAL
* @ see NotificationDelegater # REMOTE
* @ param context
* @ param components */
public static void initialize ( Context context , int components ) { } } | NotificationDelegater delegater = getInstance ( ) ; if ( delegater . center ( ) != null ) throw new IllegalStateException ( "NotificationDelegater already init." ) ; delegater . setContext ( context ) ; delegater . initComponents ( components ) ; Log . i ( TAG , "Notification delegater initialize" ) ; |
public class OverviewPlot { /** * Initialize the plot .
* @ param ratio Initial ratio */
public void initialize ( double ratio ) { } } | if ( ! ( ratio > 0 && ratio < Double . POSITIVE_INFINITY ) ) { LOG . warning ( "Invalid ratio: " + ratio , new Throwable ( ) ) ; ratio = 1.4 ; } this . ratio = ratio ; if ( plot != null ) { LOG . warning ( "Already initialized." ) ; lazyRefresh ( ) ; return ; } reinitialize ( ) ; // register context listener
context . ... |
public class JingleSessionStateUnknown { /** * In the UNKNOWN state we received a < session - initiate > action .
* This method processes that action .
* @ throws SmackException
* @ throws InterruptedException */
private IQ receiveSessionInitiateAction ( JingleSession session , Jingle inJingle ) throws SmackExcep... | IQ response ; boolean shouldAck = true ; // According to XEP - 166 when we get a session - initiate we need to check for :
// 1 . Initiator unknown
// 2 . Receiver redirection
// 3 . Does not support Jingle
// 4 . Does not support any < description > formats
// 5 . Does not support any < transport > formats
// If all o... |
public class SDBaseOps { /** * Return an array with equal shape to the input , but all elements set to ' value '
* @ param name Name of the output variable
* @ param in Input variable
* @ param value Value to set
* @ return Output variable */
public SDVariable assign ( String name , SDVariable in , Number value... | SDVariable ret = f ( ) . assign ( in , value ) ; return updateVariableNameAndReference ( ret , name ) ; |
public class KernelResolverRepository { /** * Return all features and samples in the repository with the given name which don ' t apply to the installed products
* @ param resourceName a short or symbolic name
* @ return the features and samples which don ' t apply to the installed products */
public Collection < A... | List < ApplicableToProduct > result = nameToNonApplicableResources . get ( resourceName ) ; if ( result == null ) { // We don ' t expect this to happen , if we ' re looking for non - applicable resources , it ' s because we failed to resolve it earlier
cacheFeaturesForName ( resourceName ) ; result = nameToNonApplicabl... |
public class BusItinerary { /** * Insert newHalt after afterHalt in the ordered list of { @ link BusItineraryHalt } .
* @ param afterHalt the halt where insert the new halt
* @ param name name of the new halt
* @ param type the type of bus halt
* @ return the added bus halt , otherwise < code > null < / code > ... | return insertBusHaltAfter ( afterHalt , null , name , type ) ; |
public class OrthogonalPolyLine { /** * Draws the last segment of the line to the tail .
* It will take into account the correction and arrow .
* Logic is applied to help draw an attractive line . Under certain conditions it will attempt to add an extra mid point . For example if you have directions
* going oppos... | final double tailOffset = pline . getTailOffset ( ) ; Point2D p1 = points . get ( points . size ( ) - 1 ) ; // correct for tailOffset
if ( tailOffset > 0 ) { if ( ! write ) { p1 = p1 . copy ( ) ; } correctEndWithOffset ( tailOffset , tailDirection , p1 ) ; p1x = p1 . getX ( ) ; p1y = p1 . getY ( ) ; } // correct for co... |
public class KeyVaultClientBaseImpl { /** * Retrieves a list of individual key versions with the same key name .
* The full key identifier , attributes , and tags are provided in the response . This operation requires the keys / list permission .
* @ param vaultBaseUrl The vault name , for example https : / / myvau... | if ( vaultBaseUrl == null ) { throw new IllegalArgumentException ( "Parameter vaultBaseUrl is required and cannot be null." ) ; } if ( keyName == null ) { throw new IllegalArgumentException ( "Parameter keyName is required and cannot be null." ) ; } if ( this . apiVersion ( ) == null ) { throw new IllegalArgumentExcept... |
public class JVMUtil { /** * Returns the canonized number of the currently available Java language specification version .
* The numbering scheme of the specification versions is structured as follows :
* < ul >
* < li > Java SE 7 : 1.7 < / li >
* < li > Java SE 8 : 1.8 < / li >
* < li > Java SE 9 : 9 < / li ... | final String version = ManagementFactory . getRuntimeMXBean ( ) . getSpecVersion ( ) ; final String [ ] split = version . split ( "\\." ) ; return split . length > 1 ? Integer . parseInt ( split [ 1 ] ) : Integer . parseInt ( split [ 0 ] ) ; |
public class MangooUtils { /** * Retrieves the current version of the framework from the version . properties file
* @ return Current mangoo I / O version */
public static String getVersion ( ) { } } | String version = Default . VERSION_UNKNOW . toString ( ) ; try ( InputStream inputStream = Resources . getResource ( Default . VERSION_PROPERTIES . toString ( ) ) . openStream ( ) ) { final Properties properties = new Properties ( ) ; properties . load ( inputStream ) ; version = String . valueOf ( properties . get ( "... |
public class ConfigObject { /** * Writes this config object into a String serialized representation which can later be parsed back using the parse ( )
* method
* @ see groovy . lang . Writable # writeTo ( java . io . Writer ) */
public Writer writeTo ( Writer outArg ) throws IOException { } } | BufferedWriter out = new BufferedWriter ( outArg ) ; try { writeConfig ( "" , this , out , 0 , false ) ; } finally { out . flush ( ) ; } return outArg ; |
public class Ix { /** * Given a per - iterator ( ) initial value , reduces the elements of this sequence into a single
* value via a reducer function .
* The result ' s iterator ( ) doesn ' t support remove ( ) .
* @ param < C > the reduced value type
* @ param initialFactory a function called for each iterator... | return new IxReduce < T , C > ( this , initialFactory , reducer ) ; |
public class RmiJournalReceiver { /** * Request to close a file . Check that :
* < ul >
* < li > a file is open , < / li >
* < li > we are able to close the file . < / li >
* < / ul > */
public void closeFile ( ) throws JournalException { } } | if ( journalFile == null ) { throw logAndGetException ( "Attempting to close a file " + "when no file is open." ) ; } try { writer . close ( ) ; journalFile . close ( ) ; } catch ( IOException e ) { throw logAndGetException ( "Problem closing the file '" + journalFile . getName ( ) + "'" , e ) ; } logger . debug ( "clo... |
public class DateTimeParseContext { /** * Gets the resolved result of the parse .
* @ return the result of the parse , not null */
TemporalAccessor toResolved ( ResolverStyle resolverStyle , Set < TemporalField > resolverFields ) { } } | Parsed parsed = currentParsed ( ) ; parsed . chrono = getEffectiveChronology ( ) ; parsed . zone = ( parsed . zone != null ? parsed . zone : formatter . getZone ( ) ) ; return parsed . resolve ( resolverStyle , resolverFields ) ; |
public class NDArrayIndex { /** * Given an all index and
* the intended indexes , return an
* index array containing a combination of all elements
* for slicing and overriding particular indexes where necessary
* @ param arr the array to resolve indexes for
* @ param intendedIndexes the indexes specified by t... | return resolve ( NDArrayIndex . allFor ( arr ) , intendedIndexes ) ; |
public class ApiOvhIp { /** * AntiDDOS option . Get statistics about your traffic in and out during this mitigation
* REST : GET / ip / { ip } / mitigation / { ipOnMitigation } / stats
* @ param to [ required ] End date
* @ param from [ required ] Start date
* @ param scale [ required ] Scale of aggregation
*... | String qPath = "/ip/{ip}/mitigation/{ipOnMitigation}/stats" ; StringBuilder sb = path ( qPath , ip , ipOnMitigation ) ; query ( sb , "from" , from ) ; query ( sb , "scale" , scale ) ; query ( sb , "to" , to ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t4 ) ; |
public class sslvserver { /** * Use this API to fetch all the sslvserver resources that are configured on netscaler . */
public static sslvserver [ ] get ( nitro_service service ) throws Exception { } } | sslvserver obj = new sslvserver ( ) ; sslvserver [ ] response = ( sslvserver [ ] ) obj . get_resources ( service ) ; return response ; |
public class CPDefinitionOptionValueRelPersistenceImpl { /** * Removes the cp definition option value rel where CPDefinitionOptionRelId = & # 63 ; and key = & # 63 ; from the database .
* @ param CPDefinitionOptionRelId the cp definition option rel ID
* @ param key the key
* @ return the cp definition option valu... | CPDefinitionOptionValueRel cpDefinitionOptionValueRel = findByC_K ( CPDefinitionOptionRelId , key ) ; return remove ( cpDefinitionOptionValueRel ) ; |
public class RestItemHandler { /** * Performs a bulk deletion of items , using a single { @ link Session } . If any of the items cannot be deleted for whatever
* reason , the entire operation fails .
* @ param request the servlet request ; may not be null or unauthenticated
* @ param repositoryName the URL - enco... | JSONArray requestArray = stringToJSONArray ( requestContent ) ; if ( requestArray . length ( ) == 0 ) { return Response . ok ( ) . build ( ) ; } Session session = getSession ( request , repositoryName , workspaceName ) ; TreeSet < String > pathsInOrder = new TreeSet < > ( ) ; for ( int i = 0 ; i < requestArray . length... |
public class ResultHierarchy { /** * Informs all registered { @ link ResultListener } that a new result was added .
* @ param child New child result added
* @ param parent Parent result that was added to */
private void fireResultAdded ( Result child , Result parent ) { } } | if ( LOG . isDebugging ( ) ) { LOG . debug ( "Result added: " + child + " <- " + parent ) ; } for ( int i = listenerList . size ( ) ; -- i >= 0 ; ) { listenerList . get ( i ) . resultAdded ( child , parent ) ; } |
public class ModbusClient { /** * pull rule */
public CreatePullRuleResponse createPullRule ( CreatePullRuleRequest request ) { } } | InternalRequest internalRequest = createRequest ( request , HttpMethodName . POST , PULL_RULE ) ; return this . invokeHttpClient ( internalRequest , CreatePullRuleResponse . class ) ; |
public class CopyDither { /** * Performs a single - input / single - output dither operation , applying basic
* Floyd - Steinberg error - diffusion to the image .
* @ param pSource the source image
* @ param pDest the destiantion image
* @ return the destination image , or a new image , if { @ code pDest } was ... | // Create destination image , if none provided
if ( pDest == null ) { pDest = createCompatibleDestImage ( pSource , getICM ( pSource ) ) ; } else if ( ! ( pDest . getColorModel ( ) instanceof IndexColorModel ) ) { throw new ImageFilterException ( "Only IndexColorModel allowed." ) ; } // Filter rasters
filter ( pSource ... |
public class RuleRegressionNode { /** * Anomaly detection */
public boolean isAnomaly ( Instance instance , double uniVariateAnomalyProbabilityThreshold , double multiVariateAnomalyProbabilityThreshold , int numberOfInstanceesForAnomaly ) { } } | // AMRUles is equipped with anomaly detection . If on , compute the anomaly value .
long perceptronIntancesSeen = this . perceptron . getInstancesSeen ( ) ; if ( perceptronIntancesSeen >= numberOfInstanceesForAnomaly ) { double attribSum ; double attribSquaredSum ; double D = 0.0 ; double N = 0.0 ; double anomaly ; for... |
public class EntrySerializer { /** * Make sure all fields are mapped in the locale - value way .
* @ param src the source to be edited .
* @ param type the type to be used .
* @ param context the json context to be changed .
* @ return a created json element . */
@ Override public JsonElement serialize ( CMAEnt... | JsonObject fields = new JsonObject ( ) ; for ( Map . Entry < String , LinkedHashMap < String , Object > > field : src . getFields ( ) . entrySet ( ) ) { LinkedHashMap < String , Object > value = field . getValue ( ) ; if ( value == null ) { continue ; } String fieldId = field . getKey ( ) ; JsonObject jsonField = seria... |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcReinforcingElement ( ) { } } | if ( ifcReinforcingElementEClass == null ) { ifcReinforcingElementEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 513 ) ; } return ifcReinforcingElementEClass ; |
public class PayloadProvider { /** * Reads - - body , - - json or - - yaml data as specific class instance . */
public < T > T read ( Class < T > clazz ) { } } | try { return readInternal ( clazz ) ; } catch ( Exception e ) { if ( e instanceof RuntimeException ) { throw ( RuntimeException ) e ; } if ( e instanceof IOException ) { throw new UncheckedIOException ( ( IOException ) e ) ; } throw new RuntimeException ( e ) ; } |
public class XMLBuilder { /** * Construct a builder from an existing XML document . The provided XML
* document will be parsed and an XMLBuilder object referencing the
* document ' s root element will be returned .
* @ param inputSource
* an XML document input source that will be parsed into a DOM .
* @ param... | return new XMLBuilder ( parseDocumentImpl ( inputSource , enableExternalEntities , isNamespaceAware ) ) ; |
public class BaseFixData { /** * FixCapitalization Method . */
public static String fixCapitalization ( String string ) { } } | if ( string != null ) { for ( int i = 0 ; i < string . length ( ) ; i ++ ) { if ( Character . isLowerCase ( string . charAt ( i ) ) ) return string ; // Already lower case
} StringBuffer sb = new StringBuffer ( ) ; boolean bPreviousSpace = true ; for ( int i = 0 ; i < string . length ( ) ; i ++ ) { Character character ... |
public class AutoConfiguredLoadBalancerFactory { /** * Unlike a normal { @ link LoadBalancer . Factory } , this accepts a full service config rather than
* the LoadBalancingConfig .
* @ return null if no selection could be made . */
@ Nullable ConfigOrError selectLoadBalancerPolicy ( Map < String , ? > serviceConfi... | try { List < LbConfig > loadBalancerConfigs = null ; if ( serviceConfig != null ) { List < Map < String , ? > > rawLbConfigs = ServiceConfigUtil . getLoadBalancingConfigsFromServiceConfig ( serviceConfig ) ; loadBalancerConfigs = ServiceConfigUtil . unwrapLoadBalancingConfigList ( rawLbConfigs ) ; } if ( loadBalancerCo... |
public class ChannelManager { /** * Returns the list of receivers for transfer envelopes produced by the channel with the given source channel ID .
* @ param jobID
* the ID of the job the given channel ID belongs to
* @ param sourceChannelID
* the source channel ID for which the receiver list shall be retrieved... | EnvelopeReceiverList receiverList = this . receiverCache . get ( sourceChannelID ) ; if ( receiverList != null ) { return receiverList ; } while ( true ) { ConnectionInfoLookupResponse lookupResponse ; synchronized ( this . channelLookupService ) { lookupResponse = this . channelLookupService . lookupConnectionInfo ( t... |
public class Related { /** * Overloaded version of { @ link # asTargetBy ( String ) } that uses the
* { @ link org . hawkular . inventory . api . Relationships . WellKnown } as the name of the relationship .
* @ param relationship the type of the relationship
* @ return a new " related " filter instance */
public... | return new Related ( null , relationship . name ( ) , EntityRole . TARGET ) ; |
public class CPDefinitionLocalizationUtil { /** * Returns a range of all the cp definition localizations where CPDefinitionId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , th... | return getPersistence ( ) . findByCPDefinitionId ( CPDefinitionId , start , end ) ; |
public class Types { /** * Return the baseName of an inner class .
* This should live in utilities somewhere .
* @ param className the class name to modify
* @ return the name before $ of a class */
public static String getBaseName ( String className ) { } } | int i = className . indexOf ( "$" ) ; if ( i == - 1 ) return className ; return className . substring ( i + 1 ) ; |
public class YamlFileNetworkTopologySnitch { /** * be careful about just blindly updating ApplicationState . INTERNAL _ IP everytime we read the yaml file ,
* as that can cause connections to get unnecessarily reset ( via IESCS . onChange ( ) ) . */
private void maybeSetApplicationState ( ) { } } | if ( localNodeData . dcLocalAddress == null ) return ; final EndpointState es = Gossiper . instance . getEndpointStateForEndpoint ( FBUtilities . getBroadcastAddress ( ) ) ; if ( es == null ) return ; final VersionedValue vv = es . getApplicationState ( ApplicationState . INTERNAL_IP ) ; if ( ( vv != null && ! vv . val... |
public class CompilingLoader { /** * source - extension : the path extension for source files ; defaults to * . java */
@ Configurable public void setSourceExtension ( String ext ) throws ConfigException { } } | if ( ! ext . startsWith ( "." ) ) throw new ConfigException ( L . l ( "source-extension '{0}' must begin with '.'" , ext ) ) ; _sourceExt = ext ; |
public class RestClient { /** * Gets the .
* @ param < T >
* the generic type
* @ param restPath
* the rest path
* @ param expectedResponse
* the expected response
* @ param queryParams
* the query params
* @ return the t */
public < T > T get ( String restPath , Class < T > expectedResponse , Map < S... | return call ( HttpMethod . GET , restPath , expectedResponse , null , queryParams ) ; |
public class BoltIdentity { /** * - - - - - interface Identity - - - - - */
@ Override public int compareTo ( final Object o ) { } } | final long otherId = ( ( BoltIdentity ) o ) . getId ( ) ; if ( id > otherId ) { return 1 ; } if ( id < otherId ) { return - 1 ; } return 0 ; |
public class BundleUtils { /** * Returns the bundle with the given symbolic name and the given version , or null if no such
* bundle exists
* @ param bc bundle context
* @ param symbolicName bundle symbolic name
* @ param version bundle version
* @ return matching bundle , or null */
public static Bundle getB... | for ( Bundle bundle : bc . getBundles ( ) ) { if ( bundle . getSymbolicName ( ) . equals ( symbolicName ) ) { if ( version == null || version . equals ( bundle . getVersion ( ) ) ) { return bundle ; } } } return null ; |
public class LToFltBiFuncMemento { /** * < editor - fold desc = " object " > */
public static boolean argEquals ( LToFltBiFuncMemento the , Object that ) { } } | return Null . < LToFltBiFuncMemento > equals ( the , that , ( one , two ) -> { if ( one . getClass ( ) != two . getClass ( ) ) { return false ; } LToFltBiFuncMemento other = ( LToFltBiFuncMemento ) two ; return LObjFltPair . argEquals ( one . function , one . lastValue ( ) , other . function , other . lastValue ( ) ) ;... |
public class PrimaveraReader { /** * Parses a record containing hours and add them to a container .
* @ param ranges hours container
* @ param hoursRecord hours record */
private void addHours ( ProjectCalendarDateRanges ranges , Record hoursRecord ) { } } | if ( hoursRecord . getValue ( ) != null ) { String [ ] wh = hoursRecord . getValue ( ) . split ( "\\|" ) ; try { String startText ; String endText ; if ( wh [ 0 ] . equals ( "s" ) ) { startText = wh [ 1 ] ; endText = wh [ 3 ] ; } else { startText = wh [ 3 ] ; endText = wh [ 1 ] ; } // for end time treat midnight as mid... |
public class SshPublicKeyFileFactory { /** * Take a < a href = " SshPublicKey . html " > SshPublicKey < / a > and write it to a
* file
* @ param key
* @ param comment
* @ param format
* @ param toFile
* @ throws IOException */
public static void createFile ( SshPublicKey key , String comment , int format , ... | SshPublicKeyFile pub = create ( key , comment , format ) ; FileOutputStream out = new FileOutputStream ( toFile ) ; try { out . write ( pub . getFormattedKey ( ) ) ; out . flush ( ) ; } finally { out . close ( ) ; } |
public class Transition { /** * Match start / end values by Adapter item ID . Adds matched values to mStartValuesList
* and mEndValuesList and removes them from unmatchedStart and unmatchedEnd , using
* startItemIds and endItemIds as a guide for which Views have unique item IDs . */
private void matchItemIds ( @ No... | int numStartIds = startItemIds . size ( ) ; for ( int i = 0 ; i < numStartIds ; i ++ ) { View startView = startItemIds . valueAt ( i ) ; if ( startView != null && isValidTarget ( startView ) ) { View endView = endItemIds . get ( startItemIds . keyAt ( i ) ) ; if ( endView != null && isValidTarget ( endView ) ) { Transi... |
public class AppHelper { /** * Prints a full list of actual arguments that will be used by the application after interpretation of defaults and actual argument values as passed by the user on the command line .
* @ return reference to this application helper , allowing command - chaining . */
public AppHelper printAc... | System . out . println ( "-------------------------------------------------------------------------------------" ) ; int maxLength = 24 ; for ( Argument a : Arguments ) if ( maxLength < a . Name . length ( ) ) maxLength = a . Name . length ( ) ; for ( Argument a : Arguments ) { String template = "%1$" + String . valueO... |
public class ProxyConnection { /** * { @ inheritDoc } */
@ Override public void setSchema ( String schema ) throws SQLException { } } | delegate . setSchema ( schema ) ; dbschema = schema ; dirtyBits |= DIRTY_BIT_SCHEMA ; |
public class FreePool { /** * Return the mcWrapper to the free pool .
* @ pre mcWrapper ! = null */
protected void returnToFreePool ( MCWrapper mcWrapper ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "returnToFreePool" , gConfigProps . cfName ) ; } if ( mcWrapper . shouldBeDestroyed ( ) || mcWrapper . hasFatalErrorNotificationOccurred ( fatalErrorNotificationTime ) || ( ( pm . agedTimeout != - 1 ) && ( mcWrapper . ... |
public class ClientTable { /** * Move the position of the record .
* @ param iRelPosition - Relative position positive or negative or FIRST _ RECORD / LAST _ RECORD .
* @ return NORMAL _ RETURN - The following are NOT mutually exclusive
* @ exception DBException File exception . */
public int doMove ( int iRelPos... | this . checkCacheMode ( Boolean . TRUE ) ; // Make sure the cache is set up correctly for this type of query ( typically needed )
int iErrorCode = DBConstants . NORMAL_RETURN ; try { Object objData = null ; synchronized ( this . getSyncObject ( ) ) { // In case this is called from another task
objData = m_tableRemote .... |
public class ServerBuilder { /** * Binds the specified annotated service object under the specified path prefix .
* @ param exceptionHandlersAndConverters an iterable object of { @ link ExceptionHandlerFunction } ,
* { @ link RequestConverterFunction } and / or
* { @ link ResponseConverterFunction } */
public Ser... | requireNonNull ( pathPrefix , "pathPrefix" ) ; requireNonNull ( service , "service" ) ; requireNonNull ( decorator , "decorator" ) ; requireNonNull ( exceptionHandlersAndConverters , "exceptionHandlersAndConverters" ) ; defaultVirtualHostBuilderUpdated ( ) ; defaultVirtualHostBuilder . annotatedService ( pathPrefix , s... |
public class AssetServlet { /** * Parses a given Range header for one or more byte ranges .
* @ param rangeHeader Range header to parse
* @ param resourceLength Length of the resource in bytes
* @ return List of parsed ranges */
private ImmutableList < ByteRange > parseRangeHeader ( final String rangeHeader , fin... | final ImmutableList . Builder < ByteRange > builder = ImmutableList . builder ( ) ; if ( rangeHeader . contains ( "=" ) ) { final String [ ] parts = rangeHeader . split ( "=" ) ; if ( parts . length > 1 ) { final List < String > ranges = Splitter . on ( "," ) . trimResults ( ) . splitToList ( parts [ 1 ] ) ; for ( fina... |
public class MachineMetricFactory { /** * Returns a subset of the given list of metrics in " defaults " and the
* corresponding value of each returned metric in the subset . Note if the
* custom set is empty , the full set of default machine metrics and values
* will be returned . ( In particular , as in set theo... | List < MachineMetric > actualMetrics = defaults ; List < Long > actualValues = values ; if ( customSet . size ( ) > 0 ) { // custom set of machine metrics specified
actualMetrics = new ArrayList < MachineMetric > ( ) ; actualValues = new ArrayList < Long > ( ) ; for ( int i = 0 ; i < defaults . size ( ) ; i ++ ) { Mach... |
public class ResourceInjectionBinding { /** * Extract the fields from the ResourceRef , and verify they match the values in the current
* binding object and / or annotation exactly . If they do indeed match , add all the
* InjectionTargets on the ResourceRef parameter to the current binding . The code takes into
... | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "merge" , resourceRef ) ; ResourceImpl curAnnotation = ( ResourceImpl ) this . getAnnotation ( ) ; String jndiName = resourceRef . getName ( ) ; String curJndiName = curAnnotation . name ( ... |
import java . util . * ; class Main { /** * Combines two dictionaries into one .
* Example usage :
* > > > combine _ dicts ( { ' R ' : ' Red ' , ' B ' : ' Black ' , ' P ' : ' Pink ' } , { ' G ' : ' Green ' , ' W ' : ' White ' } )
* { ' B ' : ' Black ' , ' R ' : ' Red ' , ' P ' : ' Pink ' , ' G ' : ' Green ' , ' W... | Map < String , String > combinedDict = new HashMap < > ( ) ; combinedDict . putAll ( dictB ) ; combinedDict . putAll ( dictA ) ; return combinedDict ; |
public class smtp_server { /** * < pre >
* Performs generic data validation for the operation to be performed
* < / pre > */
protected void validate ( String operationType ) throws Exception { } } | super . validate ( operationType ) ; MPSString id_validator = new MPSString ( ) ; id_validator . setConstraintIsReq ( MPSConstants . DELETE_CONSTRAINT , true ) ; id_validator . setConstraintIsReq ( MPSConstants . MODIFY_CONSTRAINT , true ) ; id_validator . validate ( operationType , id , "\"id\"" ) ; MPSInternetHost se... |
public class DefaultMetadataService { /** * Updates an entity , instance of the type based on the guid set .
* @ param entityInstanceDefinition json array of entity definitions
* @ return guids - json array of guids */
@ Override public CreateUpdateEntitiesResult updateEntities ( String entityInstanceDefinition ) t... | entityInstanceDefinition = ParamChecker . notEmpty ( entityInstanceDefinition , "Entity instance definition" ) ; ITypedReferenceableInstance [ ] typedInstances = deserializeClassInstances ( entityInstanceDefinition ) ; CreateUpdateEntitiesResult result = repository . updateEntities ( typedInstances ) ; onEntitiesAddedU... |
public class AdminToolDBBrowserExampleLoader { /** * datasourceName must be set < br >
* < br >
* Example : < br >
* < code >
* { < br >
* & nbsp ; & nbsp ; " datasourceName " : " datasource " , < br >
* & nbsp ; & nbsp ; " cluster " : { < br >
* & nbsp ; & nbsp ; & nbsp ; & nbsp ; " Maintainance " : [ { ... | if ( LOGGER . isTraceEnabled ( ) ) { LOGGER . trace ( "Receiving json string: " + jsonString ) ; } ObjectMapper mapper = new ObjectMapper ( ) ; ExampleStatements exampleStatements = mapper . readValue ( jsonString , ExampleStatements . class ) ; addExamples ( exampleStatements ) ; |
public class JarWithFile { /** * Returns Manifest */
public Manifest getManifest ( ) throws IOException { } } | Manifest manifest ; JarFile jarFile = getJarFile ( ) ; try { if ( jarFile == null ) manifest = null ; else manifest = jarFile . getManifest ( ) ; } finally { closeJarFile ( jarFile ) ; } return manifest ; |
public class AdobePathBuilder { /** * The Correct Order . . . P1 , P2 , P3 , P4 , P5 , P6 ( Closed ) moveTo ( P1)
* curveTo ( P1 . cpl , P2 . cpp , P2 . ap ) ; curveTo ( P2 . cpl , P3 . cppy , P3 . ap ) ;
* curveTo ( P3 . cpl , P4 . cpp , P4 . ap ) ; curveTo ( P4 . cpl , P5 . cpp , P5 . ap ) ;
* curveTo ( P5 . cp... | GeneralPath path = new GeneralPath ( Path2D . WIND_EVEN_ODD , paths . size ( ) ) ; GeneralPath subpath = null ; for ( List < AdobePathSegment > points : paths ) { int length = points . size ( ) ; for ( int i = 0 ; i < points . size ( ) ; i ++ ) { AdobePathSegment current = points . get ( i ) ; int step = i == 0 ? 0 : i... |
public class CPDefinitionInventoryLocalServiceBaseImpl { /** * Returns the cp definition inventory matching the UUID and group .
* @ param uuid the cp definition inventory ' s UUID
* @ param groupId the primary key of the group
* @ return the matching cp definition inventory , or < code > null < / code > if a mat... | return cpDefinitionInventoryPersistence . fetchByUUID_G ( uuid , groupId ) ; |
public class OpenIdServiceResponseBuilder { /** * We sign directly ( final ' true ' ) because we don ' t add extensions
* response message can be either a DirectError or an AuthSuccess here .
* Note :
* The association handle returned in the Response is either the ' public '
* created in a previous association ... | val response = serverManager . authResponse ( parameterList , id , id , successFullAuthentication , true ) ; parameters . putAll ( response . getParameterMap ( ) ) ; LOGGER . debug ( "Parameters passed for the OpenID response are [{}]" , parameters . keySet ( ) ) ; return buildRedirect ( service , parameters ) ; |
public class AcraContentProvider { /** * Provides file metadata
* @ param uri the file uri
* @ param projection any combination of { @ link OpenableColumns # DISPLAY _ NAME } and { @ link OpenableColumns # SIZE }
* @ param selection ignored
* @ param selectionArgs ignored
* @ param sortOrder ignored
* @ ret... | if ( ACRA . DEV_LOGGING ) ACRA . log . d ( ACRA . LOG_TAG , "Query: " + uri ) ; final File file = getFileForUri ( uri ) ; if ( file == null ) { return null ; } if ( projection == null ) { projection = COLUMNS ; } final Map < String , Object > columnValueMap = new LinkedHashMap < > ( ) ; for ( String column : projection... |
public class Part { /** * Create a file multi - part field , from file .
* This return a part equivalent to & lt ; input type = " file " / & gt ; field in multi part form . */
public static Part < File > file ( String name , File file ) { } } | return file ( name , file . getName ( ) , file ) ; |
public class CmsImageLoader { /** * Returns a scaled version of the given OpenCms VFS image resource . < p >
* All results are cached in disk .
* If the scaled version does not exist in the cache , it is created .
* Unscaled versions of the images are also stored in the cache . < p >
* @ param cms the current u... | String cacheParam = scaler . isValid ( ) ? scaler . toString ( ) : null ; String cacheName = m_vfsDiskCache . getCacheName ( resource , cacheParam ) ; byte [ ] content = m_vfsDiskCache . getCacheContent ( cacheName ) ; CmsFile file ; if ( content != null ) { if ( resource instanceof CmsFile ) { // the original file con... |
public class XBooleanLiteralImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case XbasePackage . XBOOLEAN_LITERAL__IS_TRUE : return isIsTrue ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class AccessControlClient { /** * Return the best - matching policy for the requested document .
* @ param url
* URL of the requested document .
* @ param captureDate
* Date the document was archived .
* @ param retrievalDate
* Date of retrieval ( usually now ) .
* @ param who
* Group name of the... | return getPolicy ( url , getRule ( url , captureDate , retrievalDate , who ) ) ; |
public class TransactionReplaceLogRecord { /** * Called to perform recovery action during a warm start of the ObjectManager .
* @ param objectManagerState of the ObjectManager performing recovery .
* @ throws ObjectManagerException */
public void performRecovery ( ObjectManagerState objectManagerState ) throws Obje... | final String methodName = "performRecovery" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { objectManagerState , logicalUnitOfWork , new Integer ( transactionState ) , token , new Integer ( managedObjectBytes . length ) } ) ; // Reco... |
public class ApiClient { /** * < b > RESERVED FOR PARTNERS < / b > Request JWT Application Token
* Configures the current instance of ApiClient with a fresh OAuth JWT access token from DocuSign
* @ param clientId DocuSign OAuth Client Id ( AKA Integrator Key )
* @ param scopes the list of requested scopes . Value... | return this . requestJWTUserToken ( clientId , null , scopes , rsaPrivateKey , expiresIn ) ; |
public class GrpcServerFactoryAutoConfiguration { /** * Creates a GrpcServerFactory using the shaded netty . This is the recommended default for gRPC .
* @ param properties The properties used to configure the server .
* @ param serviceDiscoverer The discoverer used to identify the services that should be served . ... | "io.grpc.netty.shaded.io.netty.channel.Channel" , "io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder" } ) @ Bean public ShadedNettyGrpcServerFactory shadedNettyGrpcServerFactory ( final GrpcServerProperties properties , final GrpcServiceDiscoverer serviceDiscoverer , final List < GrpcServerConfigurer > serverConfig... |
public class FieldTable { /** * Lock the current record .
* This method responds differently depending on what open mode the record is in :
* OPEN _ DONT _ LOCK - A physical lock is not done . This is usually where deadlocks are possible
* ( such as screens ) and where transactions are in use ( and locks are not ... | if ( ( this . getRecord ( ) . getEditMode ( ) != Constants . EDIT_CURRENT ) && ( this . getRecord ( ) . getEditMode ( ) != Constants . EDIT_IN_PROGRESS ) ) throw new DBException ( Constants . INVALID_RECORD ) ; int iErrorCode = this . doEdit ( ) ; // Only call if edit is supported by remote db
if ( iErrorCode == Consta... |
public class GitlabAPI { /** * Creates a new label .
* @ param projectId The ID of the project containing the new label .
* @ param name The name of the label .
* @ param color The color of the label ( eg # ff0000 ) .
* @ return The newly created label .
* @ throws IOException on gitlab api call error */
publ... | String tailUrl = GitlabProject . URL + "/" + sanitizeProjectId ( projectId ) + GitlabLabel . URL ; return dispatch ( ) . with ( "name" , name ) . with ( "color" , color ) . to ( tailUrl , GitlabLabel . class ) ; |
public class ForwardingRuleClient { /** * Retrieves a list of ForwardingRule resources available to the specified project and region .
* < p > Sample code :
* < pre > < code >
* try ( ForwardingRuleClient forwardingRuleClient = ForwardingRuleClient . create ( ) ) {
* ProjectRegionName region = ProjectRegionName... | ListForwardingRulesHttpRequest request = ListForwardingRulesHttpRequest . newBuilder ( ) . setRegion ( region ) . build ( ) ; return listForwardingRules ( request ) ; |
public class HomographyTotalLeastSquares { /** * Computes P * P _ plus * X * P . Takes in account the size of each matrix and does the multiplication in an order
* to minimize memory requirements . A naive implementation requires a temporary array of NxN
* @ param X A diagonal matrix */
static void computePPXP ( DM... | final int N = P . numRows ; output . reshape ( N , 2 ) ; // diag ( X ) * P < - - N x 2
for ( int i = 0 , index = 0 ; i < N ; i ++ , index += 2 ) { double x = - X . data [ index + offsetX ] ; output . data [ index ] = x * P . data [ index ] ; output . data [ index + 1 ] = x * P . data [ index + 1 ] ; } // A = P _ plus *... |
public class HeliosClient { /** * Returns a list of all hosts registered in the Helios cluster which match the given list of
* host
* selectors .
* For example , { @ code listHosts ( Arrays . asList ( " site = foo " ) ) } will return all agents in the
* cluster whose labels match the expression { @ code site = ... | final Multimap < String , String > query = HashMultimap . create ( ) ; query . putAll ( "selector" , unparsedHostSelectors ) ; return listHosts ( query ) ; |
public class PasswordHashGenerator { /** * generate salt value by using given string .
* salt was generated as following format
* String format of current time + given string + hostname */
public static byte [ ] generateSalt ( String saltString ) { } } | byte [ ] output = null ; if ( saltString == null || saltString . length ( ) < 1 ) { // use randomly generated value
output = new byte [ SEED_LENGTH ] ; SecureRandom rand = new SecureRandom ( ) ; rand . setSeed ( rand . generateSeed ( SEED_LENGTH ) ) ; rand . nextBytes ( output ) ; } else { try { output = saltString . g... |
public class VirtualNetworkGatewaysInner { /** * The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider .
* @ param resourceGroupName The name of the resource group . ... | return ServiceFuture . fromResponse ( beginGetVpnclientIpsecParametersWithServiceResponseAsync ( resourceGroupName , virtualNetworkGatewayName ) , serviceCallback ) ; |
public class Consumers { /** * Yields the first element of the array .
* @ param < E > the element type parameter
* @ param array the array to be searched
* @ throws IllegalArgumentException if no element matches
* @ return the found element */
public static < E > E first ( E [ ] array ) { } } | return new FirstElement < E > ( ) . apply ( new ArrayIterator < > ( array ) ) ; |
public class ReadabilityStatistics { /** * Returns total syllable count for text .
* @ param strText Text to be measured
* @ return */
private static int totalSyllables ( String strText ) { } } | int intSyllableCount = 0 ; List < String > arrWords = ( new WhitespaceTokenizer ( ) ) . tokenize ( strText ) ; int intWordCount = arrWords . size ( ) ; for ( int i = 0 ; i < intWordCount ; ++ i ) { intSyllableCount += syllableCount ( arrWords . get ( i ) ) ; } return intSyllableCount ; |
public class Problem { /** * Custom readObject method that registers this object as a deserialization validator .
* @ param stream { @ link ObjectInputStream } to register this validator to .
* @ throws OptionalDataException If any error occurs while reading the object .
* @ throws ClassNotFoundException If the d... | stream . registerValidation ( this , 0 ) ; stream . defaultReadObject ( ) ; |
public class GeneratingExpression { /** * As the regular expression was distributed in separate node , every node has its own range .
* This method returns an array containing all range objects .
* @ return the separate range objects for all sub - nodes of this expression */
public Range [ ] getRanges ( ) { } } | Range [ ] ranges = new Range [ nodes . size ( ) ] ; for ( int i = 0 ; i < ranges . length ; i ++ ) { ranges [ i ] = nodes . get ( i ) . getRange ( ) ; } return ranges ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.