signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ClassFile { /** * Return internal representation of buf [ offset . . offset + len - 1 ] , converting ' / ' to ' . ' . * Note : the naming is the inverse of that used by JVMS 4.2 The Internal Form Of Names , * which defines " internal name " to be the form using " / " instead of " . " */ public static b...
byte [ ] translated = new byte [ len ] ; for ( int j = 0 ; j < len ; j ++ ) { byte b = buf [ offset + j ] ; if ( b == '/' ) translated [ j ] = ( byte ) '.' ; else translated [ j ] = b ; } return translated ;
public class HttpURLConnection { /** * Returns the key for the { @ code n } < sup > th < / sup > header field . * @ param pIndex an index . * @ return the key for the { @ code n } < sup > th < / sup > header field , * or { @ code null } if there are fewer than { @ code n } * fields . */ public String getHeaderF...
// TODO : getInputStream ( ) first , to make sure we have header fields if ( pIndex >= responseHeaders . length ) { return null ; } String field = responseHeaders [ pIndex ] ; if ( StringUtil . isEmpty ( field ) ) { return null ; } int idx = field . indexOf ( ':' ) ; return StringUtil . toLowerCase ( ( ( idx > 0 ) ? fi...
public class Config13BuilderImpl { /** * Get the sources , default , discovered and user registered sources are * included as appropriate . * Call this method only from within a ' synchronized ( this ) block * @ return sources as a sorted set */ @ Override protected SortedSources getSources ( ) { } }
SortedSources sources = new SortedSources ( getUserSources ( ) ) ; if ( addDefaultSourcesFlag ( ) ) { sources . addAll ( Config13DefaultSources . getDefaultSources ( getClassLoader ( ) ) ) ; } if ( addDiscoveredSourcesFlag ( ) ) { sources . addAll ( Config13DefaultSources . getDiscoveredSources ( getClassLoader ( ) ) )...
public class GaussianNumericAttributeClassObserver { /** * assume all values equal to splitValue go to lhs */ public double [ ] [ ] getClassDistsResultingFromBinarySplit ( double splitValue ) { } }
DoubleVector lhsDist = new DoubleVector ( ) ; DoubleVector rhsDist = new DoubleVector ( ) ; for ( int i = 0 ; i < this . attValDistPerClass . size ( ) ; i ++ ) { GaussianEstimator estimator = this . attValDistPerClass . get ( i ) ; if ( estimator != null ) { if ( splitValue < this . minValueObservedPerClass . getValue ...
public class ConstructorWriterImpl { /** * { @ inheritDoc } */ @ Override public void addTags ( ExecutableElement constructor , Content constructorDocTree ) { } }
writer . addTagsInfo ( constructor , constructorDocTree ) ;
public class ZeroMQNetworkService { /** * Receive data from the network . * @ param socket * - network reader . * @ return the envelope received over the network . * @ throws IOException * if the envelope cannot be read from the network . */ private static EventEnvelope extractEnvelope ( Socket socket ) throw...
// To - Do : Read the ZeroMQ socket via a NIO wrapper to support large data : // indeed the arrays has a maximal size bounded by a native int value , and // the real data could be larger than this limit . byte [ ] data = socket . recv ( ZMQ . DONTWAIT ) ; byte [ ] cdata ; int oldSize = 0 ; while ( socket . hasReceiveMo...
public class YEmitter { /** * syck _ emitter _ set _ resolver */ @ JRubyMethod public static IRubyObject set_resolver ( IRubyObject self , IRubyObject resolver ) { } }
( ( RubyObject ) self ) . fastSetInstanceVariable ( "@resolver" , resolver ) ; return self ;
public class CollapseSpliterator { /** * < ? | acc | last > + r */ private R pushRight ( R acc , T last ) { } }
a = none ( ) ; if ( right == null ) return acc ; synchronized ( root ) { Connector < T , R > r = right ; if ( r == null ) return acc ; right = null ; r . lhs = null ; T raleft = r . left ; r . left = none ( ) ; if ( r . acc == NONE ) { if ( acc == NONE ) { r . drain ( ) ; } else { r . acc = acc ; r . right = last ; } r...
public class JaxWsHandler { /** * Extracts the { @ link JaxWsSoapContextHandler } object from a SOAP client ' s * handler chain . * In the event that no { @ code JaxWsSoapContextHandler } object could be found , * this method throws an { @ code IllegalStateException } . * @ param soapClient the JAX - WS soap cl...
@ SuppressWarnings ( "rawtypes" ) // getHandlerChain returns a list of raw Handler . List < Handler > handlers = soapClient . getBinding ( ) . getHandlerChain ( ) ; for ( Handler < ? > handler : handlers ) { if ( handler instanceof JaxWsSoapContextHandler ) { return ( JaxWsSoapContextHandler ) handler ; } } throw new I...
public class WriterFactoryImpl { /** * { @ inheritDoc } */ public MemberSummaryWriter getMemberSummaryWriter ( AnnotationTypeWriter annotationTypeWriter , int memberType ) throws Exception { } }
switch ( memberType ) { case VisibleMemberMap . ANNOTATION_TYPE_FIELDS : return ( AnnotationTypeFieldWriterImpl ) getAnnotationTypeFieldWriter ( annotationTypeWriter ) ; case VisibleMemberMap . ANNOTATION_TYPE_MEMBER_OPTIONAL : return ( AnnotationTypeOptionalMemberWriterImpl ) getAnnotationTypeOptionalMemberWriter ( an...
public class MMAXAnnotation { /** * setter for attributeList - sets List of attributes of the MMAX annotation . * @ generated * @ param v value to set into the feature */ public void setAttributeList ( FSArray v ) { } }
if ( MMAXAnnotation_Type . featOkTst && ( ( MMAXAnnotation_Type ) jcasType ) . casFeat_attributeList == null ) jcasType . jcas . throwFeatMissing ( "attributeList" , "de.julielab.jules.types.mmax.MMAXAnnotation" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( MMAXAnnotation_Type ) jcasType ) . casFeatCode_attribute...
public class GenomicsChannel { /** * Create a new gRPC channel to the Google Genomics API , using the application default credentials * for auth . * @ param fields Which fields to return in the partial response , or null for none . * @ return The ManagedChannel . * @ throws SSLException * @ throws IOException...
return fromCreds ( CredentialFactory . getApplicationDefaultCredentials ( ) , fields ) ;
public class DurationHelper { /** * Converts a formatted String into a Duration object . * @ param formattedDuration * String in { @ link # DURATION _ FORMAT } * @ return duration * @ throws DateTimeParseException * when String is in wrong format */ public static Duration formattedStringToDuration ( final Str...
if ( formattedDuration == null ) { return null ; } final TemporalAccessor ta = DateTimeFormatter . ofPattern ( DURATION_FORMAT ) . parse ( formattedDuration . trim ( ) ) ; return Duration . between ( LocalTime . MIDNIGHT , LocalTime . from ( ta ) ) ;
public class Service { /** * < pre > * Quota configuration . * < / pre > * < code > . google . api . Quota quota = 10 ; < / code > */ public com . google . api . Quota getQuota ( ) { } }
return quota_ == null ? com . google . api . Quota . getDefaultInstance ( ) : quota_ ;
public class ClusterLocator { /** * Locates the local address of the nearest node if one exists . * @ param cluster The cluster in which to search for the node . * @ param doneHandler A handler to be called once the address has been located . */ public void locateCluster ( String cluster , Handler < AsyncResult < S...
Set < String > registry = vertx . sharedData ( ) . getSet ( cluster ) ; synchronized ( registry ) { if ( ! registry . isEmpty ( ) ) { locateNode ( cluster , new HashSet < > ( registry ) , doneHandler ) ; } }
public class JsonService { /** * Get a boolean value from a { @ link JSONObject } . * @ param jsonObject The object to get the key value from . * @ param key The name of the key to search the value for . * @ return Returns the value for the key in the object . * @ throws JSONException Thrown in case the key cou...
checkArguments ( jsonObject , key ) ; JSONValue value = jsonObject . get ( key ) ; Boolean result = null ; if ( value != null && value . isBoolean ( ) != null ) { return ( ( JSONBoolean ) value ) . booleanValue ( ) ; } return result ;
public class AbstractInstanceManager { /** * Create a proxy instance which corresponds to the given datastore type . * @ param datastoreType * The datastore type . * @ param < T > * The instance type . * @ return The instance . */ private < T > T newInstance ( DatastoreId id , DatastoreType datastoreType , Dy...
validateType ( types ) ; InstanceInvocationHandler invocationHandler = new InstanceInvocationHandler ( datastoreType , getProxyMethodService ( ) ) ; T instance = proxyFactory . createInstance ( invocationHandler , types . getCompositeType ( ) ) ; cache . put ( id , instance , cacheMode ) ; return instance ;
public class techsupport { /** * < pre > * Use this operation to delete technical support file . * < / pre > */ public static techsupport delete ( nitro_service client , techsupport resource ) throws Exception { } }
resource . validate ( "delete" ) ; return ( ( techsupport [ ] ) resource . delete_resource ( client ) ) [ 0 ] ;
public class CWSEvaluator { /** * 在标准答案与分词结果上执行评测 * @ param goldFile * @ param predFile * @ return */ public static Result evaluate ( String goldFile , String predFile ) throws IOException { } }
return evaluate ( goldFile , predFile , null ) ;
public class WQConstraint { /** * Encode this constraint in the query string value format * @ return */ public String encodeValue ( ) { } }
switch ( function ) { case EQ : if ( value != null && value . startsWith ( "_" ) ) return function . getPrefix ( ) + value ; else return value ; default : if ( function . hasBinaryParam ( ) ) return function . getPrefix ( ) + value + ".." + value2 ; else if ( function . hasParam ( ) ) return function . getPrefix ( ) + ...
public class ConvertCode { /** * Move the files in this directory to the new directory . */ public void run ( ) { } }
String sourceDir = this . getProperty ( SOURCE_DIR ) ; sourceDir = ConvertBase . fixFilePath ( sourceDir , File . separator ) ; this . setProperty ( SOURCE_DIR , sourceDir ) ; String destDir = this . getProperty ( DEST_DIR ) ; destDir = ConvertBase . fixFilePath ( destDir , File . separator ) ; if ( destDir != null ) i...
public class DMatrixUtils { /** * Returns the median of the vector . * @ param vector The input vector as a double array * @ return The median of the vector */ public static double median ( double [ ] vector ) { } }
final double [ ] sorted = vector . clone ( ) ; Arrays . sort ( sorted ) ; if ( vector . length % 2 == 1 ) { return sorted [ vector . length / 2 ] ; } return ( sorted [ vector . length / 2 - 1 ] + sorted [ vector . length / 2 ] ) / 2 ;
public class JDBCStorageConnection { /** * Reads count of nodes in workspace . * @ return * nodes count * @ throws RepositoryException * if a database access error occurs */ public long getNodesCount ( ) throws RepositoryException { } }
try { ResultSet countNodes = findNodesCount ( ) ; try { if ( countNodes . next ( ) ) { return countNodes . getLong ( 1 ) ; } else { throw new SQLException ( "ResultSet has't records." ) ; } } finally { JDBCUtils . freeResources ( countNodes , null , null ) ; } } catch ( SQLException e ) { throw new RepositoryException ...
public class Input { /** * Returns true if enough bytes are available to read a long with { @ link # readVarLong ( boolean ) } . */ public boolean canReadVarLong ( ) throws KryoException { } }
if ( limit - position >= 9 ) return true ; if ( optional ( 5 ) <= 0 ) return false ; int p = position , limit = this . limit ; byte [ ] buffer = this . buffer ; if ( ( buffer [ p ++ ] & 0x80 ) == 0 ) return true ; if ( p == limit ) return false ; if ( ( buffer [ p ++ ] & 0x80 ) == 0 ) return true ; if ( p == limit ) re...
public class MathUtil { /** * 将坐标以原点为中心旋转 * @ param point 坐标 * @ param angle 旋转弧度 ( 注意 : 不是度数 , 是弧度 ) , 为正时表示逆时针旋转 , 为负时表示顺时针旋转 , 顺时针旋转不精确 , 尽量使用逆时针旋转 , 可以使用内置的弧度ANGLE _ N 。 * @ return 旋转后的坐标 , 不精确 ( 弧度对应的角度是90、180、270、360时是精确的 , 尽量使用这些值 ) */ public static Point spin ( Point point , double angle ) { } }
return spin ( Collections . singletonList ( point ) , angle ) . get ( 0 ) ;
public class LogicTransformer { /** * recurse through the rule condition elements updating the declaration objecs */ private void processElement ( final DeclarationScopeResolver resolver , final Stack < RuleConditionElement > contextStack , final RuleConditionElement element ) { } }
if ( element instanceof Pattern ) { Pattern pattern = ( Pattern ) element ; for ( RuleConditionElement ruleConditionElement : pattern . getNestedElements ( ) ) { processElement ( resolver , contextStack , ruleConditionElement ) ; } for ( Constraint constraint : pattern . getConstraints ( ) ) { if ( constraint instanceo...
public class ServletEnvironment { /** * Set the session handler . * @ param sessionHandler The sessionHandler to set . */ public void setSessionHandler ( SessionHandler sessionHandler ) { } }
handler . setSessionsEnabled ( sessionHandler != null ) ; handler . setSessionHandler ( sessionHandler ) ;
public class Address { /** * Compares this object with the specified object for order . Returns a * negative integer , zero , or a positive integer as this object is less * than , equal to , or greater than the specified object . * < p > The implementor must ensure < code > sgn ( x . compareTo ( y ) ) = = * - s...
if ( address == null ) { return 1 ; } return this . agentId . compareTo ( address . getUUID ( ) ) ;
public class LargeObject { /** * See # size ( ) for information about efficiency . * @ return the size of the large object * @ throws SQLException if a database - access error occurs . */ public long size64 ( ) throws SQLException { } }
long cp = tell64 ( ) ; seek64 ( 0 , SEEK_END ) ; long sz = tell64 ( ) ; seek64 ( cp , SEEK_SET ) ; return sz ;
public class SipNetworkInterfaceManagerImpl { /** * Compute all the outbound interfaces for this manager */ protected void computeOutboundInterfaces ( ) { } }
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Outbound Interface List : " ) ; } List < SipURI > newlyComputedOutboundInterfaces = new CopyOnWriteArrayList < SipURI > ( ) ; Set < String > newlyComputedOutboundInterfacesIpAddresses = new CopyOnWriteArraySet < String > ( ) ; Iterator < MobicentsExtendedListeningP...
public class ExtractCoocurrencesFilterDistance { /** * Adds all cooccurrences ( no filtering ) . Subclasses can implement finer * filtering . * @ param jCas * @ param enclosingAnnot * @ param annot1 * @ param annot2 * @ param ids1 * @ param ids2 */ @ Override protected Cooccurrence filterCooccurence ( JCa...
if ( distance ( annot1 , annot2 ) < maximumDistance ) { return super . filterCooccurence ( jCas , enclosingAnnot , annot1 , annot2 , ids1 , ids2 ) ; } else { return null ; }
public class MethodFinder { /** * Loads up the data structures for my target class ' s methods . */ protected void maybeLoadMethods ( ) { } }
if ( _methodMap == null ) { _methodMap = new HashMap < String , List < Member > > ( ) ; Method [ ] methods = _clazz . getMethods ( ) ; for ( int i = 0 ; i < methods . length ; ++ i ) { Method m = methods [ i ] ; String methodName = m . getName ( ) ; Class < ? > [ ] paramTypes = m . getParameterTypes ( ) ; List < Member...
public class FlatMapOperatorBase { @ Override protected List < OUT > executeOnCollections ( List < IN > input , RuntimeContext ctx , ExecutionConfig executionConfig ) throws Exception { } }
FlatMapFunction < IN , OUT > function = userFunction . getUserCodeObject ( ) ; FunctionUtils . setFunctionRuntimeContext ( function , ctx ) ; FunctionUtils . openFunction ( function , parameters ) ; ArrayList < OUT > result = new ArrayList < OUT > ( input . size ( ) ) ; TypeSerializer < IN > inSerializer = getOperatorI...
public class TableLayoutBuilder { /** * Inserts a new row . A gap row with specified RowSpec will be inserted * before this row . */ public TableLayoutBuilder row ( RowSpec gapRowSpec ) { } }
row ( ) ; gapRows . put ( new Integer ( currentRow ) , gapRowSpec ) ; return this ;
public class ObjectEditorTable { /** * Set the data to be viewed or edited . */ public void setData ( Collection < ? > data ) { } }
_data . clear ( ) ; _data . addAll ( data ) ; _model . fireTableDataChanged ( ) ;
public class AmazonAlexaForBusinessClient { /** * Retrieves the details of a gateway . * @ param getGatewayRequest * @ return Result of the GetGateway operation returned by the service . * @ throws NotFoundException * The resource is not found . * @ sample AmazonAlexaForBusiness . GetGateway * @ see < a hre...
request = beforeClientExecution ( request ) ; return executeGetGateway ( request ) ;
public class DefaultNamespaceService { /** * { @ inheritDoc } */ @ Override public Set < String > search ( String resourceLocation , Pattern pattern ) throws IndexingFailure , ResourceDownloadError { } }
if ( resourceLocation == null ) { throw new InvalidArgument ( "resourceLocation" , resourceLocation ) ; } if ( pattern == null ) { throw new InvalidArgument ( "pattern" , pattern ) ; } // check and open namespace for this resource location synchronized ( resourceLocation ) { if ( ! isOpen ( resourceLocation ) ) { Strin...
public class ArrayUtils { /** * < p > Defensive programming technique to change a < code > null < / code > * reference to an empty one . < / p > * < p > This method returns an empty array for a < code > null < / code > input array . < / p > * < p > As a memory optimizing technique an empty array passed in will be...
if ( array == null || array . length == 0 ) { return EMPTY_OBJECT_ARRAY ; } return array ;
public class ChunkedFileSet { /** * Given a partition ID , determine which replica of this partition is hosted by the * current node , if any . * Note : This is an implementation detail of the READONLY _ V2 naming scheme , and should * not be used outside of that scope . * @ param partitionId for which we want ...
List < Integer > routingPartitionList = routingStrategy . getReplicatingPartitionList ( partitionId ) ; // Determine if we should host this partition , and if so , whether we are a primary , // secondary or n - ary replica for it int correctReplicaType = - 1 ; for ( int replica = 0 ; replica < routingPartitionList . si...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcSoundPowerLevelMeasure ( ) { } }
if ( ifcSoundPowerLevelMeasureEClass == null ) { ifcSoundPowerLevelMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 865 ) ; } return ifcSoundPowerLevelMeasureEClass ;
public class TagVLiteralOrFilter { /** * Overridden here so that we can resolve the literal values if we don ' t have * too many of them AND we ' re not searching with case insensitivity . */ @ Override public Deferred < byte [ ] > resolveTagkName ( final TSDB tsdb ) { } }
final Config config = tsdb . getConfig ( ) ; // resolve tag values if the filter is NOT case insensitive and there are // fewer literals than the expansion limit if ( ! case_insensitive && literals . size ( ) <= config . getInt ( "tsd.query.filter.expansion_limit" ) ) { return resolveTags ( tsdb , literals ) ; } else {...
public class DrizzlePreparedStatement { /** * Sets the designated parameter to the given input stream , which will have the specified number of bytes . When a * very large ASCII value is input to a < code > LONGVARCHAR < / code > parameter , it may be more practical to send it via * a < code > java . io . InputStre...
if ( x == null ) { setNull ( parameterIndex , Types . BLOB ) ; return ; } try { setParameter ( parameterIndex , new StreamParameter ( x , length ) ) ; } catch ( IOException e ) { throw SQLExceptionMapper . getSQLException ( "Could not read stream" , e ) ; }
public class ScopedMailAPI { /** * Unconditionally queue a mail * @ param aSMTPSettings * The SMTP settings to use . May not be < code > null < / code > . * @ param aMailData * The data of the email to be send . May not be < code > null < / code > . * @ return { @ link ESuccess } */ @ Nonnull public ESuccess ...
return MailAPI . queueMail ( aSMTPSettings , aMailData ) ;
public class JsJmsStreamMessageImpl { /** * Provide an estimate of encoded length of the payload */ int guessPayloadLength ( ) { } }
int length = 0 ; // Total guess at average size of stream entry try { List < Object > payload = getBodyList ( ) ; length = payload . size ( ) * 40 ; } catch ( UnsupportedEncodingException e ) { // No FFDC code needed // hmm . . . how do we figure out a reasonable length } return length ;
public class WriteCloseableDataStore { /** * Methods below simply defer to delegate */ @ Override public Iterator < Table > listTables ( @ Nullable String fromTableExclusive , long limit ) { } }
return _delegate . listTables ( fromTableExclusive , limit ) ;
public class JSDocInfoBuilder { /** * Records an implemented interface . */ public boolean recordImplementedInterface ( JSTypeExpression interfaceName ) { } }
if ( interfaceName != null && currentInfo . addImplementedInterface ( interfaceName ) ) { populated = true ; return true ; } else { return false ; }
public class DfuServiceInitiator { /** * Sets custom UUIDs for the experimental Buttonless DFU Service from SDK 12 . x . Use this method * if your DFU implementation uses different UUID for at least one of the given UUIDs . * Parameter set to < code > null < / code > will reset the UUID to the default value . * R...
final ParcelUuid [ ] uuids = new ParcelUuid [ 2 ] ; uuids [ 0 ] = buttonlessDfuServiceUuid != null ? new ParcelUuid ( buttonlessDfuServiceUuid ) : null ; uuids [ 1 ] = buttonlessDfuControlPointUuid != null ? new ParcelUuid ( buttonlessDfuControlPointUuid ) : null ; experimentalButtonlessDfuUuids = uuids ; return this ;
public class VdmBreakpointPropertyPage { /** * Creates the button to toggle enablement of the breakpoint * @ param parent * @ throws CoreException */ protected void createEnabledButton ( Composite parent ) throws CoreException { } }
fEnabledButton = createCheckButton ( parent , "Enable" ) ; fEnabledButton . setSelection ( getBreakpoint ( ) . isEnabled ( ) ) ;
public class AbstractLinear { /** * Returns the image of the MinMeasuredValue and MaxMeasuredValue dependend * on the given color * @ param WIDTH * @ param HEIGHT * @ param COLOR * @ return a buffered image of either the min measured value or the max measured value indicator */ protected BufferedImage create_...
if ( WIDTH <= 20 || HEIGHT <= 20 ) // 20 is needed otherwise the image size could be smaller than 1 { return UTIL . createImage ( 1 , 1 , Transparency . TRANSLUCENT ) ; } final int IMAGE_WIDTH ; final int IMAGE_HEIGHT ; if ( getOrientation ( ) == Orientation . VERTICAL ) { // Vertical orientation IMAGE_WIDTH = ( int ) ...
public class InternalSARLLexer { /** * $ ANTLR start " T _ _ 123" */ public final void mT__123 ( ) throws RecognitionException { } }
try { int _type = T__123 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalSARL . g : 109:8 : ( ' ELSE ' ) // InternalSARL . g : 109:10 : ' ELSE ' { match ( "ELSE" ) ; } state . type = _type ; state . channel = _channel ; } finally { }
public class TagletWriterImpl { /** * { @ inheritDoc } */ public Content returnTagOutput ( Element element , DocTree returnTag ) { } }
ContentBuilder result = new ContentBuilder ( ) ; CommentHelper ch = utils . getCommentHelper ( element ) ; result . addContent ( HtmlTree . DT ( HtmlTree . SPAN ( HtmlStyle . returnLabel , new StringContent ( configuration . getText ( "doclet.Returns" ) ) ) ) ) ; result . addContent ( HtmlTree . DD ( htmlWriter . comme...
public class SqlMapper { /** * 查询返回一个结果 , 多个结果时抛出异常 * @ param sql 执行的sql * @ param value 参数 * @ param resultType 返回的结果类型 * @ param < T > 泛型类型 * @ return result */ public < T > T selectOne ( String sql , Object value , Class < T > resultType ) { } }
List < T > list = selectList ( sql , value , resultType ) ; return getOne ( list ) ;
public class QrHelperFunctions_ZDRM { /** * Finds the magnitude of the largest element in the row * @ param A Complex matrix * @ param row Row in A * @ param col0 First column in A to be copied * @ param col1 Last column in A + 1 to be copied * @ return magnitude of largest element */ public static double com...
double max = 0 ; int indexA = A . getIndex ( row , col0 ) ; double h [ ] = A . data ; for ( int i = col0 ; i < col1 ; i ++ ) { double realVal = h [ indexA ++ ] ; double imagVal = h [ indexA ++ ] ; double magVal = realVal * realVal + imagVal * imagVal ; if ( max < magVal ) { max = magVal ; } } return Math . sqrt ( max )...
public class JInternalFrameExtensions { /** * Adds the given { @ link View } object to the given { @ link JInternalFrame } object . * @ param internalFrame * the { @ link JInternalFrame } object . * @ param view * the { @ link View } object to add */ public static void addViewToFrame ( final JInternalFrame inte...
internalFrame . add ( view . getComponent ( ) , BorderLayout . CENTER ) ; internalFrame . pack ( ) ;
public class JvmMemberImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setDeclaringType ( JvmDeclaredType newDeclaringType ) { } }
if ( newDeclaringType != eInternalContainer ( ) || ( eContainerFeatureID ( ) != TypesPackage . JVM_MEMBER__DECLARING_TYPE && newDeclaringType != null ) ) { if ( EcoreUtil . isAncestor ( this , newDeclaringType ) ) throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString ( ) ) ; Notificat...
public class StringUtil { /** * Returns true if the String is considered a " safe " string where only specific * characters are allowed to be used . Useful for checking passwords or other * information you don ' t want a user to be able to type just anything in . * This method does not allow any whitespace charac...
for ( int i = 0 ; i < string0 . length ( ) ; i ++ ) { if ( ! isSafeChar ( string0 . charAt ( i ) ) ) { return false ; } } return true ;
public class StereoMatch { /** * Verify the tetrahedral stereochemistry ( clockwise / anticlockwise ) of atom * { @ code u } is preserved in the target when the { @ code mapping } is used . * @ param u tetrahedral index in the target * @ param mapping mapping of vertices * @ return the tetrahedral configuration...
int v = mapping [ u ] ; if ( targetTypes [ v ] != Type . Tetrahedral ) return false ; ITetrahedralChirality queryElement = ( ITetrahedralChirality ) queryElements [ u ] ; ITetrahedralChirality targetElement = ( ITetrahedralChirality ) targetElements [ v ] ; // access neighbors of each element , then map the query to th...
public class EmailMessage { /** * Adding one bcc - address to the EmailMessage . * @ param internetAddress * The InternetAddress - object . * @ throws MessagingException * is thrown if the underlying implementation does not support modification of * existing values */ public void addBcc ( final Address intern...
super . addRecipient ( javax . mail . Message . RecipientType . BCC , internetAddress ) ;
public class HttpContinue { /** * Returns true if this exchange requires the server to send a 100 ( Continue ) response . * @ param exchange The exchange * @ return < code > true < / code > if the server needs to send a continue response */ public static boolean requiresContinueResponse ( final HttpServerExchange e...
if ( ! COMPATIBLE_PROTOCOLS . contains ( exchange . getProtocol ( ) ) || exchange . isResponseStarted ( ) || ! exchange . getConnection ( ) . isContinueResponseSupported ( ) || exchange . getAttachment ( ALREADY_SENT ) != null ) { return false ; } HeaderMap requestHeaders = exchange . getRequestHeaders ( ) ; return req...
public class Mutations { /** * Extracts sub mutations by { @ code from } - { @ code to } mutation indices . * @ param from index in current mutations object pointing to the first mutation to be extracted * @ param to index in current mutations object pointing to the next after last mutation to be extracted * @ re...
return new Mutations < > ( alphabet , Arrays . copyOfRange ( mutations , from , to ) ) ;
public class SPDateTimeUtil { /** * Get formatted date ' last modified at ' by entity . * @ param baseEntity * the entity * @ param datePattern * pattern how to format the date ( cp . { @ code SimpleDateFormat } ) * @ return String formatted date */ public static String formatLastModifiedAt ( final BaseEntity...
if ( baseEntity == null ) { return "" ; } return formatDate ( baseEntity . getLastModifiedAt ( ) , "" , datePattern ) ;
public class Auth { /** * Deletes the user from AUTH _ KS . USERS _ CF . * @ param username Username to delete . * @ throws RequestExecutionException */ public static void deleteUser ( String username ) throws RequestExecutionException { } }
QueryProcessor . process ( String . format ( "DELETE FROM %s.%s WHERE name = '%s'" , AUTH_KS , USERS_CF , escape ( username ) ) , consistencyForUser ( username ) ) ;
public class RemotePDPProvider { /** * Get a list of all PDP domains for a given PDB entry * @ param pdbId PDB ID * @ return Set of domain names , e . g . " PDP : 4HHBAa " * @ throws IOException if the server cannot be reached */ @ Override public SortedSet < String > getPDPDomainNamesForPDB ( String pdbId ) thro...
SortedSet < String > results = null ; try { URL u = new URL ( server + "getPDPDomainNamesForPDB?pdbId=" + pdbId ) ; logger . info ( "Fetching {}" , u ) ; InputStream response = URLConnectionTools . getInputStream ( u ) ; String xml = JFatCatClient . convertStreamToString ( response ) ; results = XMLUtil . getDomainRang...
public class OrcParser { /** * This method is written to check and make sure any value written to a column of type long * is more than Long . MIN _ VALUE . If this is not true , a warning will be passed to the user . * @ param l * @ param cIdx * @ param rowNumber * @ param dout */ private void check_Min_Value...
if ( l <= Long . MIN_VALUE ) { String warning = "Orc Parser: Long.MIN_VALUE: " + l + " is found in column " + cIdx + " row " + rowNumber + " of stripe " + _cidx + ". This value is used for sentinel and will not be parsed correctly." ; dout . addError ( new ParseWriter . ParseErr ( warning , _cidx , rowNumber , - 2L ) ...
public class IHEAuditor { /** * Get alternate user id for the system ' s ActiveParticipant in * audit messages . This is either set in configuration or * the the auditor will attempt to determine it from the JVM ' s process * id . * @ see org . openhealthtools . ihe . atna . auditor . context . AuditorModuleCon...
// If a localized value is set , use it if ( ! EventUtils . isEmptyOrNull ( systemAltUserId ) ) { return systemAltUserId ; } // Check if a configuration parameter is set systemAltUserId = getConfig ( ) . getSystemAltUserId ( ) ; if ( ! EventUtils . isEmptyOrNull ( systemAltUserId ) ) { return systemAltUserId ; } // If ...
public class NotifierFuncMain { /** * overloaded functions */ public < A , B , C , D , E , R > R callAdd ( A a , B b , C c , D d , E e , Notifier < A , B , C , D , E , R > notifier ) { } }
R result = notifier . apply ( a , b , c , d , e ) ; return result ;
public class TaskServiceImpl { /** * Get Task type queue sizes . * @ param taskTypes List of task types . * @ return map of task type as Key and queue size as value . */ @ Service public Map < String , Integer > getTaskQueueSizes ( List < String > taskTypes ) { } }
return executionService . getTaskQueueSizes ( taskTypes ) ;
public class TreeBuilder { /** * Convert data content for all resources matching the resource selector and the path selector * @ param converter content converter * @ param pathSelector path selector * @ param resourceSelector resource selector * @ return builder */ public TreeBuilder < T > convert ( ContentCon...
return TreeBuilder . < T > builder ( new ConverterTree < T > ( build ( ) , converter , pathSelector , resourceSelector ) ) ;
public class AbstractAstVisitorRule { /** * Return true if this rule should be applied for the specified ClassNode , based on the * configuration of this rule . * @ param classNode - the ClassNode * @ return true if this rule should be applied for the specified ClassNode */ protected boolean shouldApplyThisRuleTo...
// TODO Consider caching applyTo , doNotApplyTo and associated WildcardPatterns boolean shouldApply = true ; String applyTo = getApplyToClassNames ( ) ; String doNotApplyTo = getDoNotApplyToClassNames ( ) ; if ( applyTo != null && applyTo . length ( ) > 0 ) { WildcardPattern pattern = new WildcardPattern ( applyTo , tr...
public class RF1Importer { /** * Processes the raw RF1 files and generates a { @ link VersionRows } . */ public VersionRows extractVersionRows ( ) { } }
// Read all the concepts from the raw data List < ConceptRow > crs = new ArrayList < ConceptRow > ( ) ; BufferedReader br = null ; try { br = new BufferedReader ( new InputStreamReader ( conceptsFile ) ) ; String line = br . readLine ( ) ; // Skip first line while ( null != ( line = br . readLine ( ) ) ) { line = new S...
public class GeneralPurposeFFT_F64_1D { /** * rfftf1 : further processing of Real forward FFT */ void rfftf ( final double a [ ] , final int offa ) { } }
if ( n == 1 ) return ; int l1 , l2 , na , kh , nf , ip , iw , ido , idl1 ; final int twon = 2 * n ; nf = ( int ) wtable_r [ 1 + twon ] ; na = 1 ; l2 = n ; iw = twon - 1 ; for ( int k1 = 1 ; k1 <= nf ; ++ k1 ) { kh = nf - k1 ; ip = ( int ) wtable_r [ kh + 2 + twon ] ; l1 = l2 / ip ; ido = n / l2 ; idl1 = ido * l1 ; iw -...
public class VCard { /** * Load VCard information for a connected user . XMPPConnection should be authenticated * and not anonymous . * @ param connection connection . * @ throws XMPPErrorException * @ throws NoResponseException * @ throws NotConnectedException * @ throws InterruptedException * @ deprecat...
load ( connection , null ) ;
public class appfwlearningdata { /** * Use this API to delete appfwlearningdata resources . */ public static base_responses delete ( nitro_service client , appfwlearningdata resources [ ] ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { appfwlearningdata deleteresources [ ] = new appfwlearningdata [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { deleteresources [ i ] = new appfwlearningdata ( ) ; deleteresources [ i ] . profilename = resourc...
public class ServletUtil { /** * Converts a possibly - relative path to a context - relative absolute path . * Resolves . / and . . / at the beginning of the URL but not in the middle of the URL . * If the URL begins with http : , https : , file : , mailto : , telnet : , tel : , or cid : , it is not altered . * @...
char firstChar ; if ( relativeUrlPath . length ( ) > 0 && ( firstChar = relativeUrlPath . charAt ( 0 ) ) != '/' && firstChar != '#' // Skip anchor - only paths && ! relativeUrlPath . startsWith ( "http:" ) && ! relativeUrlPath . startsWith ( "https:" ) && ! relativeUrlPath . startsWith ( "file:" ) && ! relativeUrlPath ...
public class SQLExecutor { @ Beta public static SQLExecutor w ( final String url , final String user , final String password ) { } }
return new SQLExecutor ( JdbcUtil . createDataSource ( url , user , password ) ) ;
public class SeekableStreamIndexTaskRunner { /** * Signals the ingestion loop to pause . * @ return one of the following Responses : 400 Bad Request if the task has started publishing ; 202 Accepted if the * method has timed out and returned before the task has paused ; 200 OK with a map of the current partition se...
authorizationCheck ( req , Action . WRITE ) ; return pause ( ) ;
public class DisplayResourceCommand { /** * ( non - Javadoc ) * @ see org . apache . commons . chain . Command # execute ( org . apache . commons . chain . Context ) */ public boolean execute ( Context context ) throws Exception { } }
GenericWebAppContext webCtx = ( GenericWebAppContext ) context ; HttpServletResponse response = webCtx . getResponse ( ) ; HttpServletRequest request = webCtx . getRequest ( ) ; // standalone request ? String servletPath = request . getPathInfo ( ) ; boolean doClose = true ; // or included ? if ( servletPath == null ) ...
public class FiguerasSSSRFinder { /** * Returns a Vector that contains the union of Vectors vec1 and vec2 * @ param list1 The first vector * @ param list2 The second vector * @ return the union of the two list */ private List < IAtom > getUnion ( List < IAtom > list1 , List < IAtom > list2 ) { } }
// FIXME : the JavaDoc does not describe what happens : that vec1 gets to be the union ! // jm : pretty sure retainAll would do the trick here but don ' t want to change the // functionality as item only present in list1 are not removed ( i . e . not union ) List < IAtom > is = new ArrayList < IAtom > ( list1 ) ; for (...
public class RtpStatistics { /** * Checks whether this SSRC is still a sender . * If an RTP packet has not been transmitted since time tc - 2T , the * participant removes itself from the sender table , decrements the sender * count , and sets we _ sent to false . * @ return whether this SSRC is still considered...
long t = rtcpReceiverInterval ( false ) ; long minTime = getCurrentTime ( ) - ( 2 * t ) ; if ( this . rtpSentOn < minTime ) { removeSender ( this . ssrc ) ; } return this . weSent ;
public class CPDefinitionVirtualSettingPersistenceImpl { /** * Returns the cp definition virtual setting with the primary key or throws a { @ link com . liferay . portal . kernel . exception . NoSuchModelException } if it could not be found . * @ param primaryKey the primary key of the cp definition virtual setting ...
CPDefinitionVirtualSetting cpDefinitionVirtualSetting = fetchByPrimaryKey ( primaryKey ) ; if ( cpDefinitionVirtualSetting == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw new NoSuchCPDefinitionVirtualSettingException ( _NO_SUCH_ENTITY_WITH_PRIMARY_...
public class TransformerImpl { /** * Subroutine of simplifyTree to handle EQ nodes */ private static Selector simplifyEQ ( Selector sel0 , Selector sel1 ) { } }
if ( sel0 . getType ( ) != Selector . BOOLEAN ) return new OperatorImpl ( Selector . EQ , sel0 , sel1 ) ; else return makeOR ( makeAND ( simplifyTree ( sel0 ) , simplifyTree ( sel1 ) ) , makeAND ( simplifyNOT ( sel0 ) , simplifyNOT ( sel1 ) ) ) ;
public class JCusparse { /** * If the given result is not cusparseStatus . CUSPARSE _ STATUS _ SUCCESS * and exceptions have been enabled , this method will throw a * CudaException with an error message that corresponds to the * given result code . Otherwise , the given result is simply * returned . * @ param...
if ( exceptionsEnabled && result != cusparseStatus . CUSPARSE_STATUS_SUCCESS ) { throw new CudaException ( cusparseStatus . stringFor ( result ) ) ; } return result ;
public class PatternBox { /** * Pattern for a Conversion has an input PhysicalEntity and another output PhysicalEntity that * belongs to the same EntityReference . * @ param p pattern to update * @ param ctrlLabel label * @ return the pattern */ public static Pattern stateChange ( Pattern p , String ctrlLabel )...
if ( p == null ) p = new Pattern ( Conversion . class , "Conversion" ) ; if ( ctrlLabel == null ) p . add ( new Participant ( RelType . INPUT ) , "Conversion" , "input PE" ) ; else p . add ( new Participant ( RelType . INPUT , true ) , ctrlLabel , "Conversion" , "input PE" ) ; p . add ( linkToSpecific ( ) , "input PE" ...
public class SendBulkTemplatedEmailRequest { /** * A list of tags , in the form of name / value pairs , to apply to an email that you send to a destination using * < code > SendBulkTemplatedEmail < / code > . * @ param defaultTags * A list of tags , in the form of name / value pairs , to apply to an email that yo...
if ( defaultTags == null ) { this . defaultTags = null ; return ; } this . defaultTags = new com . amazonaws . internal . SdkInternalList < MessageTag > ( defaultTags ) ;
public class RandomAccessFile { /** * Moves this file ' s file pointer to a new position , from where following * { @ code read } , { @ code write } or { @ code skip } operations are done . The * position may be greater than the current length of the file , but the * file ' s length will only change if the moving...
if ( offset < 0 ) { throw new IOException ( "offset < 0: " + offset ) ; } try { Libcore . os . lseek ( fd , offset , SEEK_SET ) ; } catch ( ErrnoException errnoException ) { throw errnoException . rethrowAsIOException ( ) ; }
public class LocalTransactionWrapper { /** * Register the current object with the Synchronisation manager for the current transaction */ @ Override public boolean addSync ( ) throws ResourceException { } }
if ( tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "addSync" ) ; } try { UOWCoordinator uowCoord = mcWrapper . getUOWCoordinator ( ) ; if ( uowCoord != null ) { if ( uowCoord . isGlobal ( ) ) { if ( mcWrapper . isConnectionSynchronizationProvider ( ) ) { throw new UnsupportedOperationException ( "com.ibm.ws.Tran...
public class VirtualMachinesInner { /** * Run command on the VM . * @ param resourceGroupName The name of the resource group . * @ param vmName The name of the virtual machine . * @ param parameters Parameters supplied to the Run command operation . * @ throws IllegalArgumentException thrown if parameters fail ...
return beginRunCommandWithServiceResponseAsync ( resourceGroupName , vmName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ChronicleMapBuilder { /** * Shortcut for { @ link # valueMarshallers ( BytesReader , BytesWriter ) * valueMarshallers ( marshaller , marshaller ) } . */ public < M extends BytesReader < V > & BytesWriter < ? super V > > ChronicleMapBuilder < K , V > valueMarshaller ( @ NotNull M marshaller ) { } }
return valueMarshallers ( marshaller , marshaller ) ;
public class URIDestinationCreator { /** * Extract the value of the named property from URI . * Find the named property in the name value pairs of the uri and return the value , * or null if the property is not present . * @ param propName the name of the property whose value is required * @ param uri the URI t...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "extractPropertyFromURI" , new Object [ ] { propName , uri } ) ; String result = null ; // only something to do if uri is non - null & non - empty u if ( uri != null ) { uri = uri . trim ( ) ; if ( ! uri . equals ( ""...
public class User { /** * Gets a reference to the authentication extension . * @ return the authentication extension */ private static ExtensionAuthentication getAuthenticationExtension ( ) { } }
if ( extensionAuth == null ) { extensionAuth = Control . getSingleton ( ) . getExtensionLoader ( ) . getExtension ( ExtensionAuthentication . class ) ; } return extensionAuth ;
public class AppServiceEnvironmentsInner { /** * Reboot all machines in an App Service Environment . * Reboot all machines in an App Service Environment . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service Environment . * @ throws Illega...
rebootWithServiceResponseAsync ( resourceGroupName , name ) . toBlocking ( ) . single ( ) . body ( ) ;
public class AlgorithmId { /** * DER encode this object onto an output stream . * Implements the < code > DerEncoder < / code > interface . * @ param out * the output stream on which to write the DER encoding . * @ exception IOException on encoding error . */ public void derEncode ( OutputStream out ) throws IO...
DerOutputStream bytes = new DerOutputStream ( ) ; DerOutputStream tmp = new DerOutputStream ( ) ; bytes . putOID ( algid ) ; // Setup params from algParams since no DER encoding is given if ( constructedFromDer == false ) { if ( algParams != null ) { params = new DerValue ( algParams . getEncoded ( ) ) ; } else { param...
public class IfcPresentationLayerWithStyleImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcPresentationStyleSelect > getLayerStyles ( ) { } }
return ( EList < IfcPresentationStyleSelect > ) eGet ( Ifc2x3tc1Package . Literals . IFC_PRESENTATION_LAYER_WITH_STYLE__LAYER_STYLES , true ) ;
public class ImageLoaderCurrent { /** * Process the INode records stored in the fsimage . * @ param in Datastream to process * @ param v Visitor to walk over INodes * @ param numInodes Number of INodes stored in file * @ param skipBlocks Process all the blocks within the INode ? * @ throws VisitException * ...
v . visitEnclosingElement ( ImageElement . INODES , ImageElement . NUM_INODES , numInodes ) ; if ( LayoutVersion . supports ( Feature . FSIMAGE_NAME_OPTIMIZATION , imageVersion ) ) { processLocalNameINodes ( in , v , numInodes , skipBlocks ) ; } else { // full path name processFullNameINodes ( in , v , numInodes , skip...
public class ArrayMath { /** * PRINTING FUNCTIONS */ public static String toBinaryString ( byte [ ] b ) { } }
StringBuilder s = new StringBuilder ( ) ; for ( byte by : b ) { for ( int j = 7 ; j >= 0 ; j -- ) { if ( ( by & ( 1 << j ) ) > 0 ) { s . append ( '1' ) ; } else { s . append ( '0' ) ; } } s . append ( ' ' ) ; } return s . toString ( ) ;
public class SingleNonNioFileObjectStore { /** * ( non - Javadoc ) * @ see com . ibm . ws . objectManager . AbstractSingleFileObjectStore # readDirectory ( int , long , long ) */ final AbstractSingleFileObjectStore . Directory makeDirectory ( int minimumNodeSize , long directoryRootByteAddress , long directoryRootLen...
return new Directory ( minimumNodeSize , directoryRootByteAddress , directoryRootLength ) ;
public class Constant { /** * Constructs a new instance of the specified type with value converted from * the input byte array . * @ param type * the specified type * @ param val * the byte array contains the value * @ return a constant of specified type with value converted from the byte * array */ publi...
switch ( type . getSqlType ( ) ) { case ( INTEGER ) : return new IntegerConstant ( val ) ; case ( BIGINT ) : return new BigIntConstant ( val ) ; case ( DOUBLE ) : return new DoubleConstant ( val ) ; case ( VARCHAR ) : return new VarcharConstant ( val , type ) ; } throw new UnsupportedOperationException ( "Unspported SQ...
public class CollectionUtils { /** * Returns a list of all modes in the Collection . ( If the Collection has multiple items with the * highest frequency , all of them will be returned . ) */ public static < T > Set < T > modes ( Collection < T > values ) { } }
Counter < T > counter = new ClassicCounter < T > ( values ) ; List < Double > sortedCounts = CollectionUtils . sorted ( counter . values ( ) ) ; Double highestCount = sortedCounts . get ( sortedCounts . size ( ) - 1 ) ; Counters . retainAbove ( counter , highestCount ) ; return counter . keySet ( ) ;
public class FrenchRepublicanCalendar { /** * / * [ deutsch ] * < p > Erzeugt ein neues franz & ouml ; sisches Republikdatum als Erg & auml ; nzungstag . < / p > * @ param year republican year in range 1-1202 * @ param sansculottides the complementary day * @ return new instance of { @ code FrenchRepublicanCale...
if ( ( year < 1 ) || ( year > MAX_YEAR ) ) { throw new IllegalArgumentException ( "Year out of range: " + year ) ; } else if ( ( sansculottides == Sansculottides . LEAP_DAY ) && ! isLeapYear ( year ) ) { throw new IllegalArgumentException ( "Day of Revolution only exists in leap years: " + year ) ; } return new FrenchR...
public class ntp_sync { /** * Use this API to fetch filtered set of ntp _ sync resources . * filter string should be in JSON format . eg : " vm _ state : DOWN , name : [ a - z ] + " */ public static ntp_sync [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
ntp_sync obj = new ntp_sync ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; ntp_sync [ ] response = ( ntp_sync [ ] ) obj . getfiltered ( service , option ) ; return response ;