signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Matrix3x2d { /** * Unproject the given window coordinates < code > ( winX , winY ) < / code > by < code > this < / code > matrix using the specified viewport .
* This method first converts the given window coordinates to normalized device coordinates in the range < code > [ - 1 . . 1 ] < / code >
* and... | double s = 1.0 / ( m00 * m11 - m01 * m10 ) ; double im00 = m11 * s ; double im01 = - m01 * s ; double im10 = - m10 * s ; double im11 = m00 * s ; double im20 = ( m10 * m21 - m20 * m11 ) * s ; double im21 = ( m20 * m01 - m00 * m21 ) * s ; double ndcX = ( winX - viewport [ 0 ] ) / viewport [ 2 ] * 2.0 - 1.0 ; double ndcY ... |
public class PlatformDescription { /** * The custom AMIs supported by the platform .
* @ param customAmiList
* The custom AMIs supported by the platform . */
public void setCustomAmiList ( java . util . Collection < CustomAmi > customAmiList ) { } } | if ( customAmiList == null ) { this . customAmiList = null ; return ; } this . customAmiList = new com . amazonaws . internal . SdkInternalList < CustomAmi > ( customAmiList ) ; |
public class AssignabilityTypesVisitor { /** * Check lower bounded wildcard cases . Method is not called if upper bounds are not assignable .
* When left is not lower bound - compatibility will be checked by type walker and when compatible always
* assignable . For example , String compatible ( and assignable ) wit... | final boolean res ; // ? super Object is impossible here due to types cleanup in tree walker
if ( notLowerBounded ( one ) ) { // walker will check compatibility , and compatible type is always assignable to lower bounded wildcard
// e . g . Number assignable to ? super Number , but Integer not assignable to ? super Num... |
public class FSDatasetAsyncDiskService { /** * Gracefully shut down all ThreadPool . Will wait for all deletion
* tasks to finish . */
synchronized void shutdown ( ) { } } | if ( executors == null ) { LOG . warn ( "AsyncDiskService has already shut down." ) ; } else { LOG . info ( "Shutting down all async disk service threads..." ) ; for ( Map . Entry < File , ThreadPoolExecutor > e : executors . entrySet ( ) ) { e . getValue ( ) . shutdown ( ) ; } // clear the executor map so that calling... |
public class XPathContext { /** * Get the current context node list .
* @ return An iterator for the current context list , as
* defined in XSLT . */
public final DTMIterator getContextNodes ( ) { } } | try { DTMIterator cnl = getContextNodeList ( ) ; if ( null != cnl ) return cnl . cloneWithReset ( ) ; else return null ; // for now . . . this might ought to be an empty iterator .
} catch ( CloneNotSupportedException cnse ) { return null ; // error reporting ?
} |
public class RtfDocument { /** * Writes the document
* @ param out The < code > OutputStream < / code > to write the RTF document to . */
public void writeDocument ( OutputStream out ) { } } | try { out . write ( OPEN_GROUP ) ; out . write ( RtfDocument . RTF_DOCUMENT ) ; this . documentHeader . writeContent ( out ) ; this . data . writeTo ( out ) ; out . write ( CLOSE_GROUP ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getGEPROLRES ( ) { } } | if ( geprolresEEnum == null ) { geprolresEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 140 ) ; } return geprolresEEnum ; |
public class FdfsResponse { /** * 解析反馈结果 , head已经被解析过
* @ param head
* @ param in
* @ param charset
* @ return
* @ throws IOException */
public T decode ( ProtoHead head , InputStream in , Charset charset ) throws IOException { } } | this . head = head ; return decodeContent ( in , charset ) ; |
public class MultiCacheMissHandler { /** * Attempts a resource retrieval from each of the provided
* < code > CacheMissHandler < / code > s ; as soon as one succeeds , it returns it as
* an < code > InputStream < / code > .
* @ return
* the resource as an < code > InputStream < / code > , as soon as any of the ... | List < Exception > exceptions = new ArrayList < Exception > ( ) ; for ( CacheMissHandler handler : handlers ) { try { logger . debug ( "trying handler of class '{}'" , handler . getClass ( ) ) ; InputStream stream = handler . getAsStream ( ) ; if ( stream != null ) { logger . debug ( "success, returning stream" ) ; ret... |
public class Link { /** * Factory method to easily create { @ link Link } instances from RFC - 5988 compatible { @ link String } representations of a
* link .
* @ param element an RFC - 5899 compatible representation of a link .
* @ throws IllegalArgumentException if a { @ link String } was given that does not ad... | if ( ! StringUtils . hasText ( element ) ) { throw new IllegalArgumentException ( String . format ( "Given link header %s is not RFC5988 compliant!" , element ) ) ; } Matcher matcher = URI_AND_ATTRIBUTES_PATTERN . matcher ( element ) ; if ( matcher . find ( ) ) { Map < String , String > attributes = getAttributeMap ( m... |
public class QYWeixinSupport { /** * 自定义的消息事件处理
* @ param event 事件
* @ return 响应结果 */
private QYBaseRespMsg processEventHandle ( QYBaseEvent event ) { } } | if ( CollectionUtil . isEmpty ( eventHandles ) ) { synchronized ( LOCK ) { eventHandles = this . initEventHandles ( ) ; } } if ( CollectionUtil . isNotEmpty ( eventHandles ) ) { for ( QYEventHandle eventHandle : eventHandles ) { QYBaseRespMsg resultMsg = null ; boolean result ; try { result = eventHandle . beforeHandle... |
public class RegisteredResources { /** * Log any prepared resources */
protected void logResources ( ) throws SystemException { } } | if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "logResources" , _resourcesLogged ) ; if ( ! _resourcesLogged ) { for ( int i = 0 ; i < _resourceObjects . size ( ) ; i ++ ) { final JTAResource resource = _resourceObjects . get ( i ) ; if ( resource . getResourceStatus ( ) == StatefulResource . PREPARED ) { recordLog (... |
public class FacesConfigTypeImpl { /** * If not already created , a new < code > factory < / code > element will be created and returned .
* Otherwise , the first existing < code > factory < / code > element will be returned .
* @ return the instance defined for the element < code > factory < / code > */
public Fac... | List < Node > nodeList = childNode . get ( "factory" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new FacesConfigFactoryTypeImpl < FacesConfigType < T > > ( this , "factory" , childNode , nodeList . get ( 0 ) ) ; } return createFactory ( ) ; |
public class JobProperty { /** * { @ link Action } s to be displayed in the job page .
* Returning actions from this method allows a job property to add them
* to the left navigation bar in the job page .
* { @ link Action } can implement additional marker interface to integrate
* with the UI in different ways ... | // delegate to getJobAction ( singular ) for backward compatible behavior
Action a = getJobAction ( job ) ; if ( a == null ) return Collections . emptyList ( ) ; return Collections . singletonList ( a ) ; |
public class ClassPropertyFilterHelper { /** * Test the < code > ClassPropertyFilter < / code > . It means , that test the class - name ( Class . forName ) and
* test all properties with the properties of the class .
* @ param pvClassPropertyFilter The source for the tests .
* @ return < code > Null < / code > , ... | String lvReturn = null ; if ( pvClassPropertyFilter != null ) { try { Class < ? > lvClass = pvClassPropertyFilter . getFilterClass ( ) ; Map < Object , Object > lvProperties = ReflectionMethodHelper . getAllGetterMethodWithCache ( lvClass , null ) ; Object lvAllProperties [ ] = pvClassPropertyFilter . getAllProperties ... |
public class FileConverter { /** * Return file instance for the given path string . */
@ Override public < T > T asObject ( String string , Class < T > valueType ) { } } | // at this point value type is guaranteed to be a File
return ( T ) new File ( string ) ; |
public class SimpleCycle { /** * Returns the sum of the weights of all edges in this cycle .
* @ return the sum of the weights of all edges in this cycle */
public double weight ( ) { } } | double result = 0 ; Iterator edgeIterator = edgeSet ( ) . iterator ( ) ; while ( edgeIterator . hasNext ( ) ) { result += ( ( Edge ) edgeIterator . next ( ) ) . getWeight ( ) ; } return result ; |
public class AbstractSAML2ResponseValidator { /** * Validate issuer format and value .
* @ param issuer the issuer
* @ param context the context */
protected final void validateIssuer ( final Issuer issuer , final SAML2MessageContext context ) { } } | if ( issuer . getFormat ( ) != null && ! issuer . getFormat ( ) . equals ( NameIDType . ENTITY ) ) { throw new SAMLIssuerException ( "Issuer type is not entity but " + issuer . getFormat ( ) ) ; } final String entityId = context . getSAMLPeerEntityContext ( ) . getEntityId ( ) ; if ( entityId == null || ! entityId . eq... |
public class RegistrationsApi { /** * Confirm User
* This call updates the registration request issued earlier by associating it with an authenticated user and captures all additional information required to add a new device .
* @ param registrationInfo Device Registration information . ( required )
* @ return Ap... | com . squareup . okhttp . Call call = confirmUserValidateBeforeCall ( registrationInfo , null , null ) ; Type localVarReturnType = new TypeToken < DeviceRegConfirmUserResponseEnvelope > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class ServiceDirectoryCache { /** * Put a service into cache .
* @ param serviceName
* the service name .
* @ param service
* the service . */
public void putService ( K serviceName , V service ) { } } | if ( cache . containsKey ( serviceName ) ) { cache . remove ( serviceName ) ; } cache . put ( serviceName , service ) ; |
public class RedisInner { /** * Export data from the redis cache to blobs in a container .
* @ param resourceGroupName The name of the resource group .
* @ param name The name of the Redis cache .
* @ param parameters Parameters for Redis export operation .
* @ throws IllegalArgumentException thrown if paramete... | exportDataWithServiceResponseAsync ( resourceGroupName , name , parameters ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class CollectorManagerImpl { /** * OSGi runtime calls this to notify collector manager when a new source provider
* becomes available . This method will be used by the collector manager to bind sources .
* When a source is bound , handle all pending subscriptions for the source . */
public synchronized void ... | String sourceId = CollectorManagerUtils . getSourceId ( source ) ; SourceManager srcMgr = null ; if ( ! sourceMgrs . containsKey ( sourceId ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Adding source to the list" , source . getClass ( ) ) ; } srcMgr = new SourceMa... |
public class Scene { /** * { @ inheritDoc } */
@ Override public void setSpeedFactor ( @ FloatRange ( from = 0 ) final float speedFactor ) { } } | if ( speedFactor < 0 ) { throw new IllegalArgumentException ( "speedFactor must not be nagative" ) ; } if ( Float . compare ( speedFactor , Float . NaN ) == 0 ) { throw new IllegalArgumentException ( "speedFactor must be a valid float" ) ; } this . speedFactor = speedFactor ; |
public class Tracking { /** * Returns an Iterable to be traversed when matching issues . That means
* that the traversal does not fail if method { @ link # match ( Trackable , Trackable ) }
* is called . */
public Stream < RAW > getUnmatchedRaws ( ) { } } | return raws . stream ( ) . filter ( raw -> ! rawToBase . containsKey ( raw ) ) ; |
public class AbstractPlanNode { /** * Refer to the override implementation on NestLoopIndexJoin node .
* @ param tableName
* @ return whether this node has an inlined index scan node or not . */
public boolean hasInlinedIndexScanOfTable ( String tableName ) { } } | for ( int i = 0 ; i < getChildCount ( ) ; i ++ ) { AbstractPlanNode child = getChild ( i ) ; if ( child . hasInlinedIndexScanOfTable ( tableName ) == true ) { return true ; } } return false ; |
public class FindDialog { /** * This method initializes btnCancel
* @ return javax . swing . JButton */
private JButton getBtnCancel ( ) { } } | if ( btnCancel == null ) { btnCancel = new JButton ( ) ; btnCancel . setText ( Constant . messages . getString ( "edit.find.button.cancel" ) ) ; btnCancel . addActionListener ( new java . awt . event . ActionListener ( ) { @ Override public void actionPerformed ( java . awt . event . ActionEvent e ) { FindDialog . this... |
public class Interval { /** * This method runs a runnable a specified number of times against an executor . The method is effectively
* asynchronous because it does not wait for all of the runnables to finish . */
public void run ( Runnable runnable , Executor executor ) { } } | if ( this . goForward ( ) ) { for ( int i = this . from ; i <= this . to ; i += this . step ) { executor . execute ( runnable ) ; } } else { for ( int i = this . from ; i >= this . to ; i += this . step ) { executor . execute ( runnable ) ; } } |
public class SameSizeKMeansAlgorithm { /** * Transfer a single element from one cluster to another .
* @ param metas Meta storage
* @ param meta Meta of current object
* @ param src Source cluster
* @ param dst Destination cluster
* @ param id Object ID
* @ param dstnum Destination cluster number */
protect... | src . remove ( id ) ; dst . add ( id ) ; meta . primary = dstnum ; metas . put ( id , meta ) ; // Make sure the storage is up to date . |
public class Cluster { /** * Gets all the available slots in the cluster . */
public List < WorkerSlot > getAvailableSlots ( ) { } } | List < WorkerSlot > slots = new ArrayList < > ( ) ; for ( SupervisorDetails supervisor : this . supervisors . values ( ) ) { slots . addAll ( this . getAvailableSlots ( supervisor ) ) ; } return slots ; |
public class JsJmsMessageImpl { /** * Set a Java object property value with the given name into the JMS Message .
* Javadoc description supplied by JsJmsMessage interface . */
@ Override public final void setObjectProperty ( String name , Object value ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setObjectProperty" , new Object [ ] { name , value } ) ; /* If the property is either JMSXUserID or JMSXAppID , we set it into the */
/* message regardless of whether it is null . We know the value is a */
/* String ... |
public class BitsUtil { /** * Convert bitset to a string consisting of " 0 " and " 1 " , in low - endian order .
* @ param v Value to process
* @ return String representation */
public static String toStringLow ( long v ) { } } | final int mag = magnitude ( v ) ; if ( mag == 0 ) { return "0" ; } char [ ] digits = new char [ mag ] ; long f = 1L ; for ( int pos = 0 ; pos < mag ; ++ pos , f <<= 1 ) { digits [ pos ] = ( ( v & f ) == 0 ) ? '0' : '1' ; } return new String ( digits ) ; |
public class JerseyClient { @ Override public int enqueue ( JobRequest jd ) { } } | try { return target . path ( "ji" ) . request ( ) . post ( Entity . entity ( jd , MediaType . APPLICATION_XML ) , JobInstance . class ) . getId ( ) ; } catch ( BadRequestException e ) { throw new JqmInvalidRequestException ( e . getResponse ( ) . readEntity ( String . class ) , e ) ; } catch ( Exception e ) { throw new... |
public class GA4GHPicardRunner { /** * Processes GA4GH based input , creates required API connections and data pump */
private Input processGA4GHInput ( String input ) throws IOException , GeneralSecurityException , URISyntaxException { } } | GA4GHUrl url = new GA4GHUrl ( input ) ; SAMFilePump pump ; if ( usingGrpc ) { factoryGrpc . configure ( url . getRootUrl ( ) , new Settings ( clientSecretsFilename , apiKey , noLocalServer ) ) ; pump = new ReadIteratorToSAMFilePump < com . google . genomics . v1 . Read , com . google . genomics . v1 . ReadGroupSet , co... |
public class AmazonCloudDirectoryClient { /** * Updates the schema name with a new name . Only development schema names can be updated .
* @ param updateSchemaRequest
* @ return Result of the UpdateSchema operation returned by the service .
* @ throws InternalServiceException
* Indicates a problem that must be ... | request = beforeClientExecution ( request ) ; return executeUpdateSchema ( request ) ; |
public class VirtualMachineExtensionsInner { /** * The operation to create or update the extension .
* @ param resourceGroupName The name of the resource group .
* @ param vmName The name of the virtual machine where the extension should be created or updated .
* @ param vmExtensionName The name of the virtual ma... | return ServiceFuture . fromResponse ( beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , vmName , vmExtensionName , extensionParameters ) , serviceCallback ) ; |
public class PolicyIndexBase { /** * A private method that handles reading the policy and creates the correct
* kind of AbstractPolicy .
* Because this makes use of the policyFinder , it cannot be reused between finders .
* Consider moving to policyManager , which is not intended to be reused outside
* of a pol... | // handle the policy , if it ' s a known type
Element root = doc . getDocumentElement ( ) ; String name = root . getTagName ( ) ; // see what type of policy this is
if ( name . equals ( "Policy" ) ) { return Policy . getInstance ( root ) ; } else if ( name . equals ( "PolicySet" ) ) { return PolicySet . getInstance ( r... |
public class AmazonMTurkClient { /** * The < code > ListHITsForQualificationType < / code > operation returns the HITs that use the given Qualification type
* for a Qualification requirement . The operation returns HITs of any status , except for HITs that have been deleted
* with the < code > DeleteHIT < / code > ... | request = beforeClientExecution ( request ) ; return executeListHITsForQualificationType ( request ) ; |
public class Util { /** * Find the index among siblings of the same tag name */
private static final int siblingIndex ( Element element ) { } } | // The document element has index 0
if ( element . getParentNode ( ) == element . getOwnerDocument ( ) ) return 0 ; // All other elements are compared with siblings with the same name
// TODO : How to deal with namespaces here ? Omit or keep ?
else return $ ( element ) . parent ( ) . children ( JOOX . tag ( element . g... |
public class InternalRedirectCreative { /** * Sets the assetSize value for this InternalRedirectCreative .
* @ param assetSize * The asset size of an internal redirect creative .
* Note that this may differ from { @ code size } if
* users set { @ code overrideSize } to true .
* This attribute is read - only and... | this . assetSize = assetSize ; |
public class AttributeInfoEx { public AttributeConfig_3 get_attribute_config_obj_3 ( ) { } } | return new AttributeConfig_3 ( name , writable , data_format , data_type , max_dim_x , max_dim_y , description , label , unit , standard_unit , display_unit , format , min_value , max_value , writable_attr_name , level , alarms . getTangoObj ( ) , events . getTangoObj ( ) , extensions , sys_extensions ) ; |
public class DateParser { /** * Returns the { @ link Date } represented by the specified { @ link Object } , or { @ code null } if the specified { @ link
* Object } is { @ code null } .
* @ param value the { @ link Object } to be parsed
* @ param < K > the type of the value to be parsed
* @ return the parsed { ... | if ( value == null ) { return null ; } try { if ( value instanceof Date ) { Date date = ( Date ) value ; if ( date . getTime ( ) == Long . MAX_VALUE || date . getTime ( ) == Long . MIN_VALUE ) { return date ; } else { String string = formatter . get ( ) . format ( date ) ; return formatter . get ( ) . parse ( string ) ... |
public class Output { /** * Write a Vector & lt ; Number & gt ; .
* @ param vector
* vector */
@ Override public void writeVectorNumber ( Vector < Double > vector ) { } } | log . debug ( "writeVectorNumber: {}" , vector ) ; buf . put ( AMF3 . TYPE_VECTOR_NUMBER ) ; if ( hasReference ( vector ) ) { putInteger ( getReferenceId ( vector ) << 1 ) ; return ; } storeReference ( vector ) ; putInteger ( vector . size ( ) << 1 | 1 ) ; putInteger ( 0 ) ; buf . put ( ( byte ) 0x00 ) ; for ( Double v... |
public class RadicalSiteHrDeltaReaction { /** * Initiate process .
* It is needed to call the addExplicitHydrogensToSatisfyValency
* from the class tools . HydrogenAdder .
* @ exception CDKException Description of the Exception
* @ param reactants reactants of the reaction .
* @ param agents agents of the rea... | logger . debug ( "initiate reaction: RadicalSiteHrDeltaReaction" ) ; if ( reactants . getAtomContainerCount ( ) != 1 ) { throw new CDKException ( "RadicalSiteHrDeltaReaction only expects one reactant" ) ; } if ( agents != null ) { throw new CDKException ( "RadicalSiteHrDeltaReaction don't expects agents" ) ; } IReactio... |
public class SharedObject { /** * { @ inheritDoc } */
@ SuppressWarnings ( { } } | "unchecked" , "rawtypes" } ) public void deserialize ( Input input ) throws IOException { log . debug ( "deserialize" ) ; name = Deserializer . deserialize ( input , String . class ) ; log . trace ( "Name: {}" , name ) ; persistent = true ; Map < String , Object > map = Deserializer . < Map > deserialize ( input , Map ... |
public class JMessageClient { /** * Add or remove group members from a given group id .
* @ param gid Necessary , target group id .
* @ param groups Necessary
* @ return No content
* @ throws APIConnectionException connect exception
* @ throws APIRequestException request exception */
public ResponseWrapper ad... | return _crossAppClient . addOrRemoveCrossGroupMembers ( gid , groups ) ; |
public class NodeIdRepresentation { /** * This method is responsible to deliver the whole XML resource addressed by
* a unique node id .
* @ param resourceName
* The name of the database , where the node id belongs .
* @ param nodeId
* The unique node id of the requested resource .
* @ param queryParams
*... | final StreamingOutput sOutput = new StreamingOutput ( ) { @ Override public void write ( final OutputStream output ) throws IOException , JaxRxException { // final String xPath = queryParams . get ( QueryParameter . QUERY ) ;
final String revision = queryParams . get ( QueryParameter . REVISION ) ; final String wrap = ... |
public class JemmyDSL { /** * Returns a list of all visible components which are instances of the given class . If one needs
* a find that returns an invisible component should add a parameter here . But the default
* behavior must be returning only visible components as it is the most common operation and
* requ... | List < java . awt . Component > list = new ArrayList < java . awt . Component > ( ) ; for ( java . awt . Component component : container . getComponents ( ) ) { if ( component . isVisible ( ) && componentClass . isAssignableFrom ( component . getClass ( ) ) ) { list . add ( component ) ; } if ( component instanceof jav... |
public class ConsumerDispatcher { /** * Put a message on this ConsumerDispatcher for delivery to consumers .
* @ param msg The message to be delivered
* @ param tran The transaction to be used ( must at least have an autocommit transaction )
* @ param inputHandlerStore The input handler putting this message
* @... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "put" , new Object [ ] { msg , tran , inputHandlerStore , Boolean . valueOf ( storedByIH ) } ) ; // Set a unique id in the message if explicitly told to or
// if one has not already been set
JsMessage jsMsg = msg . getMessag... |
public class HtmlBuilder { /** * Build a HTML TableRow with given CSS style attributes for a string .
* Use this method if given content contains HTML snippets , prepared with { @ link HtmlBuilder # htmlEncode ( String ) } .
* @ param style style for tr element
* @ param content content string
* @ return HTML t... | return tagStyleHtmlContent ( Html . Tag . TR , style , content ) ; |
public class KubernetesNames { /** * Lets convert the string to btw a valid kubernetes resource name
* @ param text the text to convert
* @ param allowDots whether or not to allow dots in the name
* @ return the converted name */
public static String convertToKubernetesName ( String text , boolean allowDots ) { }... | String lower = text . toLowerCase ( ) ; StringBuilder builder = new StringBuilder ( ) ; boolean started = false ; char lastCh = ' ' ; for ( int i = 0 , last = lower . length ( ) - 1 ; i <= last ; i ++ ) { char ch = lower . charAt ( i ) ; boolean digit = ch >= '0' && ch <= '9' ; // names cannot start with a digit so let... |
public class DoubleUtils { /** * Returns the index of the first maximal element of the array . That is , if there is a unique
* maximum , its index is returned . If there are multiple values tied for largest , the index of the
* first is returned . If the supplied array is empty , an { @ link IllegalArgumentExcepti... | checkArgument ( x . length > 0 ) ; double maxValue = Double . MIN_VALUE ; int maxIndex = 0 ; for ( int i = 0 ; i < x . length ; ++ i ) { final double val = x [ i ] ; if ( val > maxValue ) { maxIndex = i ; maxValue = val ; } } return maxIndex ; |
public class CCEncoder { /** * Encodes a cardinality constraint and returns its CNF encoding .
* @ param cc the cardinality constraint
* @ return the CNF encoding of the cardinality constraint */
public ImmutableFormulaList encode ( final PBConstraint cc ) { } } | final EncodingResult result = EncodingResult . resultForFormula ( f ) ; this . encodeConstraint ( cc , result ) ; return new ImmutableFormulaList ( FType . AND , result . result ( ) ) ; |
public class TrafficRoute { /** * The ARN of one listener . The listener identifies the route between a target group and a load balancer . This is an
* array of strings with a maximum size of one .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setListener... | if ( this . listenerArns == null ) { setListenerArns ( new com . amazonaws . internal . SdkInternalList < String > ( listenerArns . length ) ) ; } for ( String ele : listenerArns ) { this . listenerArns . add ( ele ) ; } return this ; |
public class RunbooksInner { /** * Update the runbook identified by runbook name .
* @ param resourceGroupName Name of an Azure Resource group .
* @ param automationAccountName The name of the automation account .
* @ param runbookName The runbook name .
* @ param parameters The update parameters for runbook . ... | return updateWithServiceResponseAsync ( resourceGroupName , automationAccountName , runbookName , parameters ) . map ( new Func1 < ServiceResponse < RunbookInner > , RunbookInner > ( ) { @ Override public RunbookInner call ( ServiceResponse < RunbookInner > response ) { return response . body ( ) ; } } ) ; |
public class GroupElement { /** * Converts the group element to the CACHED representation .
* @ return The group element in the CACHED representation . */
public org . mariadb . jdbc . internal . com . send . authentication . ed25519 . math . GroupElement toCached ( ) { } } | return toRep ( Representation . CACHED ) ; |
public class MeterImpl { /** * Mark the occurrence of a given number of events .
* @ param n the number of events */
@ Override public void mark ( long n ) { } } | tickIfNecessary ( ) ; count . add ( n ) ; m1Rate . update ( n ) ; m5Rate . update ( n ) ; m15Rate . update ( n ) ; |
public class AipBodyAnalysis { /** * 针对人像分割接口 , 将返回的二值图转化为灰度图 , 存储为jpg格式
* @ param labelmapBase64 人像分割接口返回的二值图base64
* @ param realWidth 图片原始宽度
* @ param realHeight 图片原始高度
* @ param outPath 灰度图输出路径 */
public static void convert ( String labelmapBase64 , int realWidth , int realHeight , String outPath ) { } } | try { byte [ ] bytes = Base64Util . decode ( labelmapBase64 ) ; InputStream is = new ByteArrayInputStream ( bytes ) ; BufferedImage image = ImageIO . read ( is ) ; BufferedImage newImage = resize ( image , realWidth , realHeight ) ; BufferedImage grayImage = new BufferedImage ( realWidth , realHeight , BufferedImage . ... |
public class PlanAssembler { /** * This is a UNION specific method . Generate a unique and correct plan
* for the current SQL UNION statement by building the best plans for each individual statements
* within the UNION .
* @ return A union plan or null . */
private CompiledPlan getNextUnionPlan ( ) { } } | String isContentDeterministic = null ; // Since only the one " best " plan is considered ,
// this method should be called only once .
if ( m_bestAndOnlyPlanWasGenerated ) { return null ; } m_bestAndOnlyPlanWasGenerated = true ; // Simply return an union plan node with a corresponding union type set
AbstractPlanNode su... |
public class DisconfFileCoreProcessorImpl { /** * 更新消息 : 某个配置文件 */
private void updateOneConf ( String fileName ) throws Exception { } } | DisconfCenterFile disconfCenterFile = ( DisconfCenterFile ) disconfStoreProcessor . getConfData ( fileName ) ; if ( disconfCenterFile != null ) { // 更新仓库
updateOneConfFile ( fileName , disconfCenterFile ) ; // 更新实例
inject2OneConf ( fileName , disconfCenterFile ) ; } |
public class TopoGraph { /** * + Inf is returned for the universe chain . */
double getChainArea ( int chain ) { } } | int chainIndex = getChainIndex_ ( chain ) ; double v = m_chainAreas . read ( chainIndex ) ; if ( NumberUtils . isNaN ( v ) ) { updateChainAreaAndPerimeter_ ( chain ) ; v = m_chainAreas . read ( chainIndex ) ; } return v ; |
public class BatchDeleteTableVersionRequest { /** * A list of the IDs of versions to be deleted . A < code > VersionId < / code > is a string representation of an integer .
* Each version is incremented by 1.
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # ... | if ( this . versionIds == null ) { setVersionIds ( new java . util . ArrayList < String > ( versionIds . length ) ) ; } for ( String ele : versionIds ) { this . versionIds . add ( ele ) ; } return this ; |
public class ApiOvhEmailexchange { /** * Alter this object properties
* REST : PUT / email / exchange / { organizationName } / service / { exchangeService }
* @ param body [ required ] New object properties
* @ param organizationName [ required ] The internal name of your exchange organization
* @ param exchang... | String qPath = "/email/exchange/{organizationName}/service/{exchangeService}" ; StringBuilder sb = path ( qPath , organizationName , exchangeService ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ; |
public class Multiplexing { /** * Demultiplexes elements from the source array into an iterator of channels .
* < code >
* unchain ( 2 , [ 1,2,3,4,5 ] ) - > [ [ 1,2 ] , [ 3,4 ] , [ 5 ] ]
* < / code >
* @ param < C > the channel collection type
* @ param < E > the element type
* @ param channelSize maximum s... | return new UnchainIterator < C , E > ( channelSize , new ArrayIterator < E > ( array ) , channelProvider ) ; |
public class ComparatorCompat { /** * Adds the comparator , that uses a function for extract
* an { @ code int } sort key , to the chain .
* @ param keyExtractor the function that extracts the sort key
* @ return the new { @ code ComparatorCompat } instance */
@ NotNull public ComparatorCompat < T > thenComparing... | return thenComparing ( comparingInt ( keyExtractor ) ) ; |
public class JDBCResultSet { /** * # ifdef JAVA4 */
public void updateArray ( String columnLabel , java . sql . Array x ) throws SQLException { } } | throw Util . notSupported ( ) ; |
public class RtfCell { /** * Write the cell definition part of this RtfCell */
public void writeDefinition ( final OutputStream result ) throws IOException { } } | if ( this . mergeType == MERGE_VERT_PARENT ) { result . write ( DocWriter . getISOBytes ( "\\clvmgf" ) ) ; } else if ( this . mergeType == MERGE_VERT_CHILD ) { result . write ( DocWriter . getISOBytes ( "\\clvmrg" ) ) ; } switch ( verticalAlignment ) { case Element . ALIGN_BOTTOM : result . write ( DocWriter . getISOBy... |
public class PdfLine { /** * Gets the difference between the " normal " leading and the maximum
* size ( for instance when there are images in the chunk ) .
* @ returnan extra leading for images
* @ since2.1.5 */
float [ ] getMaxSize ( ) { } } | float normal_leading = 0 ; float image_leading = - 10000 ; PdfChunk chunk ; for ( int k = 0 ; k < line . size ( ) ; ++ k ) { chunk = ( PdfChunk ) line . get ( k ) ; if ( ! chunk . isImage ( ) ) { normal_leading = Math . max ( chunk . font ( ) . size ( ) , normal_leading ) ; } else { image_leading = Math . max ( chunk .... |
public class ShanksSimulation2DGUI { /** * Remove a time chart to the simulation
* @ param chartID
* @ throws ScenarioNotFoundException
* @ throws DuplicatedPortrayalIDException */
public void removeTimeChart ( String chartID ) throws ShanksException { } } | Scenario2DPortrayal scenarioPortrayal = ( Scenario2DPortrayal ) this . getSimulation ( ) . getScenarioPortrayal ( ) ; scenarioPortrayal . removeTimeChart ( chartID ) ; |
public class LoadBalancer { /** * An array of LoadBalancerTlsCertificateSummary objects that provide additional information about the SSL / TLS
* certificates . For example , if < code > true < / code > , the certificate is attached to the load balancer .
* @ param tlsCertificateSummaries
* An array of LoadBalanc... | if ( tlsCertificateSummaries == null ) { this . tlsCertificateSummaries = null ; return ; } this . tlsCertificateSummaries = new java . util . ArrayList < LoadBalancerTlsCertificateSummary > ( tlsCertificateSummaries ) ; |
public class PhysicalDatabaseParent { /** * Free the objects .
* There is no need to call this , as the raw tables will automatically be removed
* when their physical tables are freed . */
public void free ( ) { } } | this . setCacheMinutes ( 0 ) ; // Turn off the cache
Object [ ] keys = m_htDBList . keySet ( ) . toArray ( ) ; for ( int i = 0 ; i < keys . length ; i ++ ) { Object key = keys [ i ] ; PDatabase pDatabase = ( PDatabase ) m_htDBList . get ( key ) ; pDatabase . free ( ) ; } m_htDBList . clear ( ) ; m_htDBList = null ; |
public class PolicyTypeDescription { /** * The description of the policy attributes associated with the policies defined by Elastic Load Balancing .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setPolicyAttributeTypeDescriptions ( java . util . Collection ... | if ( this . policyAttributeTypeDescriptions == null ) { setPolicyAttributeTypeDescriptions ( new com . amazonaws . internal . SdkInternalList < PolicyAttributeTypeDescription > ( policyAttributeTypeDescriptions . length ) ) ; } for ( PolicyAttributeTypeDescription ele : policyAttributeTypeDescriptions ) { this . policy... |
public class CeQueueDao { /** * Ordered by ascending id : oldest to newest */
public List < CeQueueDto > selectByMainComponentUuid ( DbSession session , String projectUuid ) { } } | return mapper ( session ) . selectByMainComponentUuid ( projectUuid ) ; |
public class ItemChooserActivity { @ Override protected void onListItemClick ( ListView l , View v , int position , long id ) { } } | Product selectedItem = adapter . getItem ( position ) ; Intent res = new Intent ( ) ; res . putExtra ( RES_SELECTED_PRODUCT , selectedItem ) ; setResult ( Activity . RESULT_OK , res ) ; finish ( ) ; |
public class UINotification { /** * Display error type of notification message .
* @ param message
* as message . */
public void displayValidationError ( final String message ) { } } | final StringBuilder updatedMsg = new StringBuilder ( FontAwesome . EXCLAMATION_TRIANGLE . getHtml ( ) ) ; updatedMsg . append ( ' ' ) ; updatedMsg . append ( message ) ; notificationMessage . showNotification ( SPUIStyleDefinitions . SP_NOTIFICATION_ERROR_MESSAGE_STYLE , null , updatedMsg . toString ( ) , true ) ; |
public class BinLogFileQueue { /** * 根据前一个文件 , 获取符合条件的下一个binlog文件
* @ param pre
* @ return
* @ throws InterruptedException */
public File waitForNextFile ( File pre ) throws InterruptedException { } } | try { lock . lockInterruptibly ( ) ; if ( binlogs . size ( ) == 0 ) { nextCondition . await ( ) ; // 等待新文件
} if ( exception != null ) { throw exception ; } if ( pre == null ) { // 第一次
return binlogs . get ( 0 ) ; } else { int index = seek ( pre ) ; if ( index < binlogs . size ( ) - 1 ) { return binlogs . get ( index + ... |
public class TimeZoneFormat { /** * Returns the ISO 8601 extended time zone string for the given offset .
* For example , " - 08:00 " , " - 08:30 " and " Z "
* @ param offset the offset from GMT ( UTC ) in milliseconds .
* @ param useUtcIndicator true if ISO 8601 UTC indicator " Z " is used when the offset is 0. ... | return formatOffsetISO8601 ( offset , false , useUtcIndicator , isShort , ignoreSeconds ) ; |
public class InstanceGroupModifyConfig { /** * The EC2 InstanceIds to terminate . After you terminate the instances , the instance group will not return to its
* original requested size .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setEC2InstanceIdsToTe... | if ( this . eC2InstanceIdsToTerminate == null ) { setEC2InstanceIdsToTerminate ( new com . amazonaws . internal . SdkInternalList < String > ( eC2InstanceIdsToTerminate . length ) ) ; } for ( String ele : eC2InstanceIdsToTerminate ) { this . eC2InstanceIdsToTerminate . add ( ele ) ; } return this ; |
public class WebSocketExtension { /** * Creates an { @ link WebSocketExtensionParamter } of the specified type .
* @ param < T > generic parameter type
* @ param parameterName name of the parameter
* @ param parameterType Class object representing the parameter type
* @ param parameterMetadata characteristics o... | if ( ( parameterName == null ) || ( parameterName . trim ( ) . length ( ) == 0 ) ) { String s = "Parameter name cannot be null or empty" ; throw new IllegalArgumentException ( s ) ; } if ( parameterType == null ) { String s = String . format ( "Null type specified for parameter '%s'" , parameterName ) ; throw new Illeg... |
public class TranStrategy { /** * Base implementation of postInvoke ; commits any local or global
* transaction which was started during preInvoke , unless
* setRollbackOnly ( ) was called . If setRollback was called , the
* transaction is rolled back now . */
void postInvoke ( EJBKey key , TxCookieImpl cookie , ... | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { // d173022.3
Tr . entry ( tc , "postInvoke" ) ; } // Any local transaction which exists now was started in preInvoke
if ( cookie . beginner ) { if ( txCtrl . getRollbackOnly ( ) ) { // Before rolling back ... |
public class GroupOf { /** * Sets this group ' s offset , at the given x and y coordinates .
* @ param x
* @ param y
* @ return Group this Group */
@ Override public C setOffset ( final double x , final double y ) { } } | getAttributes ( ) . setOffset ( x , y ) ; return cast ( ) ; |
public class HttpParser { /** * / * Parse a request or response line */
private boolean parseLine ( ByteBuffer buffer ) { } } | boolean handle = false ; // Process headers
while ( _state . ordinal ( ) < State . HEADER . ordinal ( ) && buffer . hasRemaining ( ) && ! handle ) { // process each character
HttpTokens . Token t = next ( buffer ) ; if ( t == null ) break ; if ( _maxHeaderBytes > 0 && ++ _headerBytes > _maxHeaderBytes ) { if ( _state =... |
public class TableFactoryService { /** * Prepares the supported properties of a factory to be used for match operations . */
private static Tuple2 < List < String > , List < String > > normalizeSupportedProperties ( TableFactory factory ) { } } | List < String > supportedProperties = factory . supportedProperties ( ) ; if ( supportedProperties == null ) { throw new TableException ( String . format ( "Supported properties of factory '%s' must not be null." , factory . getClass ( ) . getName ( ) ) ) ; } List < String > supportedKeys = supportedProperties . stream... |
public class JIT_Stub { /** * Core method for generating the Stub class bytes . Intended for
* use by JITDeploy only ( should not be called directly ) . < p >
* Although the ' methods ' parameter could be obtained from the
* specified remote interface , the ' methods ' and ' idlNames '
* parameters are requeste... | String [ ] remoteInterfaceNames ; int numMethods = remoteMethods . length ; // ASM uses ' internal ' java class names ( like JNI ) where ' / ' is
// used instead of ' . ' , so convert the parameters to ' internal ' format .
String internalStubClassName = convertClassName ( stubClassName ) ; String internalInterfaceName... |
public class DisplayAFP { /** * TODO : same as getEqrPos ? ? ? ! ! ! */
public static final List < Integer > getEQRAlignmentPos ( AFPChain afpChain ) { } } | List < Integer > lst = new ArrayList < Integer > ( ) ; char [ ] s1 = afpChain . getAlnseq1 ( ) ; char [ ] s2 = afpChain . getAlnseq2 ( ) ; char [ ] symb = afpChain . getAlnsymb ( ) ; boolean isFatCat = afpChain . getAlgorithmName ( ) . startsWith ( "jFatCat" ) ; for ( int i = 0 ; i < s1 . length ; i ++ ) { char c1 = s1... |
public class HtmlEscapeUtil { /** * Perform an escape operation , based on String , according to the specified level and type . */
static String escape ( final String text , final HtmlEscapeType escapeType , final HtmlEscapeLevel escapeLevel ) { } } | if ( text == null ) { return null ; } final int level = escapeLevel . getEscapeLevel ( ) ; final boolean useHtml5 = escapeType . getUseHtml5 ( ) ; final boolean useNCRs = escapeType . getUseNCRs ( ) ; final boolean useHexa = escapeType . getUseHexa ( ) ; final HtmlEscapeSymbols symbols = ( useHtml5 ? HtmlEscapeSymbols ... |
public class FrameworkMethodRunner { /** * Returns a { @ link Statement } that invokes { @ code method } on { @ code test } */
protected Statement methodInvoker ( FrameworkMethod method , Object test ) { } } | return new ParameterizedInvokeMethod ( method , test , methodArgs ) ; |
public class FastSet { /** * { @ inheritDoc } */
@ Override public int indexOf ( int e ) { } } | if ( e < 0 ) { throw new IllegalArgumentException ( "positive integer expected: " + Integer . toString ( e ) ) ; } if ( isEmpty ( ) ) { return - 1 ; } int index = wordIndex ( e ) ; if ( index >= firstEmptyWord || ( words [ index ] & ( 1 << e ) ) == 0 ) { return - 1 ; } int count = BitCount . count ( words , index ) ; c... |
public class RRSF424BaseGenerator { /** * This method tests whether a document ' s sponsor is in a given sponsor hierarchy . */
public boolean isSponsorInHierarchy ( DevelopmentProposalContract sponsorable , String sponsorHierarchy , String level1 ) { } } | return sponsorHierarchyService . isSponsorInHierarchy ( sponsorable . getSponsor ( ) . getSponsorCode ( ) , sponsorHierarchy , 1 , level1 ) ; |
public class DescribeTrustsResult { /** * The list of Trust objects that were retrieved .
* It is possible that this list contains less than the number of items specified in the < i > Limit < / i > member of the
* request . This occurs if there are less than the requested number of items left to retrieve , or if th... | if ( trusts == null ) { this . trusts = null ; return ; } this . trusts = new com . amazonaws . internal . SdkInternalList < Trust > ( trusts ) ; |
public class JobStatusCalculator { /** * Builds a JobStatusCalculator that is reporting { @ link Status # WARNING } if the last job failed .
* @ param key key of the calculator
* @ param jobRepository the repository
* @ param jobMetaRepository meta data to indentify disabled jobs
* @ param managementContextPath... | return new JobStatusCalculator ( key , 1 , 1 , jobRepository , jobMetaRepository , managementContextPath ) ; |
public class StandardDdlParser { /** * Returns a list of data type start words which can be used to help identify a column definition sub - statement .
* @ return list of data type start words */
protected List < String > getDataTypeStartWords ( ) { } } | if ( allDataTypeStartWords == null ) { allDataTypeStartWords = new ArrayList < String > ( ) ; allDataTypeStartWords . addAll ( DataTypes . DATATYPE_START_WORDS ) ; allDataTypeStartWords . addAll ( getCustomDataTypeStartWords ( ) ) ; } return allDataTypeStartWords ; |
public class IabHelper { /** * Workaround to bug where sometimes response codes come as Long instead of Integer */
int getResponseCodeFromIntent ( Intent i ) { } } | Object o = i . getExtras ( ) . get ( RESPONSE_CODE ) ; if ( o == null ) { logError ( "Intent with no response code, assuming OK (known issue)" ) ; return BILLING_RESPONSE_RESULT_OK ; } else if ( o instanceof Integer ) return ( ( Integer ) o ) . intValue ( ) ; else if ( o instanceof Long ) return ( int ) ( ( Long ) o ) ... |
public class DdosProtectionPlansInner { /** * Creates or updates a DDoS protection plan .
* @ param resourceGroupName The name of the resource group .
* @ param ddosProtectionPlanName The name of the DDoS protection plan .
* @ param parameters Parameters supplied to the create or update operation .
* @ param se... | return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , ddosProtectionPlanName , parameters ) , serviceCallback ) ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertColorFidelityStpCoExToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class PlayerImpl { /** * Player methods */
@ SuppressWarnings ( "static-access" ) public void play ( URI [ ] uris , RTC [ ] rtc , Parameters params ) throws MsControlException { } } | if ( rtc != null ) { verifyRTC ( rtc ) ; } this . checkURI ( uris ) ; PlayTask task = new PlayTask ( uris , rtc , params ) ; // user calls play during the current work ?
if ( fsm . getState ( ) . getName ( ) . equals ( STATE_IDLE ) ) { playList . offer ( task ) ; } else { // no specific behaviour ?
if ( params == null ... |
public class AbstractRemoteTransport { /** * localUpdateShortRunningFree
* @ param logicalAddress the logical address
* @ param freeCount the free count */
public void localUpdateShortRunningFree ( Address logicalAddress , Long freeCount ) { } } | if ( trace ) log . tracef ( "LOCAL_UPDATE_SHORTRUNNING_FREE(%s, %d)" , logicalAddress , freeCount ) ; DistributedWorkManager dwm = workManagerCoordinator . resolveDistributedWorkManager ( logicalAddress ) ; if ( dwm != null ) { Collection < NotificationListener > copy = new ArrayList < NotificationListener > ( dwm . ge... |
public class JaroDistanceTextSimilarity { /** * 计算相似度分值
* @ param words1 词列表1
* @ param words2 词列表2
* @ return 相似度分值 */
@ Override protected double scoreImpl ( List < Word > words1 , List < Word > words2 ) { } } | // 文本1
StringBuilder text1 = new StringBuilder ( ) ; words1 . forEach ( word -> text1 . append ( word . getText ( ) ) ) ; // 文本2
StringBuilder text2 = new StringBuilder ( ) ; words2 . forEach ( word -> text2 . append ( word . getText ( ) ) ) ; // 计算文本1和文本2的Jaro距离
// Jaro距离也就是相似度分值
double score = jaroDistance ( text1 . ... |
public class TextUtils { /** * Exception - and warning - free URL - escaping utility method .
* @ param s String to escape
* @ return URL - escaped string */
@ SuppressWarnings ( "deprecation" ) public static String urlEscape ( String s ) { } } | try { return URLEncoder . encode ( s , "UTF8" ) ; } catch ( UnsupportedEncodingException e ) { // should be impossible ; all JVMs must support UTF8
// but have a fallback just in case
return URLEncoder . encode ( s ) ; } |
public class RepositoryTypeClass { /** * < p > newInstance . < / p >
* @ param repositoryType a { @ link com . greenpepper . server . domain . RepositoryType } object .
* @ param envType a { @ link com . greenpepper . server . domain . EnvironmentType } object .
* @ param className a { @ link java . lang . String... | RepositoryTypeClass repoTypeClass = new RepositoryTypeClass ( ) ; repoTypeClass . setRepositoryType ( repositoryType ) ; repoTypeClass . setEnvType ( envType ) ; repoTypeClass . setClassName ( className ) ; return repoTypeClass ; |
public class MemorySegment { /** * Writes the given character ( 16 bit , 2 bytes ) to the given position in little - endian
* byte order . This method ' s speed depends on the system ' s native byte order , and it
* is possibly slower than { @ link # putChar ( int , char ) } . For most cases ( such as
* transient... | if ( LITTLE_ENDIAN ) { putChar ( index , value ) ; } else { putChar ( index , Character . reverseBytes ( value ) ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.