signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class HarrisFast { /** * Sobel边缘提取算子
* @ param x
* @ param y
* @ return */
private float [ ] sobel ( int x , int y ) { } } | int v00 = 0 , v01 = 0 , v02 = 0 , v10 = 0 , v12 = 0 , v20 = 0 , v21 = 0 , v22 = 0 ; int x0 = x - 1 , x1 = x , x2 = x + 1 ; int y0 = y - 1 , y1 = y , y2 = y + 1 ; if ( x0 < 0 ) x0 = 0 ; if ( y0 < 0 ) y0 = 0 ; if ( x2 >= width ) x2 = width - 1 ; if ( y2 >= height ) y2 = height - 1 ; v00 = image [ x0 ] [ y0 ] ; v10 = imag... |
public class Intersectiond { /** * Test whether the one sphere with center < code > centerA < / code > and square radius < code > radiusSquaredA < / code > intersects the other
* sphere with center < code > centerB < / code > and square radius < code > radiusSquaredB < / code > , and store the center of the circle of... | return intersectSphereSphere ( centerA . x ( ) , centerA . y ( ) , centerA . z ( ) , radiusSquaredA , centerB . x ( ) , centerB . y ( ) , centerB . z ( ) , radiusSquaredB , centerAndRadiusOfIntersectionCircle ) ; |
public class AccessPolicy { /** * Creates an operation to create a new access policy
* @ param name
* name of the access policy
* @ param durationInMinutes
* how long the access policy will be in force
* @ param permissions
* permissions allowed by this access policy
* @ return The operation */
public sta... | return new Creator ( name , durationInMinutes , permissions ) ; |
public class SourceDocumentRepositoryMongoImpl { /** * { @ inheritDoc } */
@ Override public String newId ( final RootDocument rootDocument ) { } } | return newId ( mongoTemplate , SourceDocumentMongo . class , rootDocument . getFilename ( ) , "S" ) ; |
public class PortletAdministrationHelper { /** * Check if the link to the Fragment admin portlet should display in the status message .
* < p > Checks that the portlet is new , that the portlet has been published and that the user has
* necessary permissions to go to the fragment admin page .
* @ param person the... | if ( ! form . isNew ( ) ) { return false ; } // only include the " do layout " link for published portlets .
if ( form . getLifecycleState ( ) != PortletLifecycleState . PUBLISHED ) { return false ; } // check that the user can edit at least 1 fragment .
Map < String , String > layouts = fragmentAdminHelper . getAuthor... |
public class DebugLogPrinter { /** * { @ inheritDoc } */
@ Override public void notifyResult ( T result ) { } } | if ( logger . isDebugEnabled ( ) == true ) { logger . debug ( this . header + result . toString ( ) ) ; } |
public class DbxClientV1 { /** * Similar to { @ link # uploadFile } , except always uses the / files _ put API call .
* One difference is that { @ code numBytes } must not be negative . */
public Uploader startUploadFileSingle ( String targetPath , DbxWriteMode writeMode , long numBytes ) throws DbxException { } } | DbxPathV1 . checkArg ( "targetPath" , targetPath ) ; if ( numBytes < 0 ) throw new IllegalArgumentException ( "numBytes must be zero or greater" ) ; String host = this . host . getContent ( ) ; String apiPath = "1/files_put/auto" + targetPath ; ArrayList < HttpRequestor . Header > headers = new ArrayList < HttpRequesto... |
public class MtasCQLParserBasicSentenceCondition { /** * Adds the basic sentence .
* @ param s the s
* @ throws ParseException the parse exception */
public void addBasicSentence ( MtasCQLParserBasicSentenceCondition s ) throws ParseException { } } | if ( ! simplified ) { List < MtasCQLParserBasicSentencePartCondition > newWordList = s . getPartList ( ) ; partList . addAll ( newWordList ) ; } else { throw new ParseException ( "already simplified" ) ; } |
public class Files { /** * Replace extension on given file and return resulting file .
* @ param file file to replace extension ,
* @ param newExtension newly extension .
* @ return newly created file .
* @ throws IllegalArgumentException if file parameter is null . */
public static File replaceExtension ( File... | Params . notNull ( file , "File" ) ; return new File ( replaceExtension ( file . getPath ( ) , newExtension ) ) ; |
public class JTSLineStringExpression { /** * Returns the specified Point N in this LineString .
* @ param idx one based index
* @ return point at index */
public JTSPointExpression < Point > pointN ( int idx ) { } } | return JTSGeometryExpressions . pointOperation ( SpatialOps . POINTN , mixin , ConstantImpl . create ( idx ) ) ; |
public class VirtualFileChannel { /** * Returns always a lock . Locking virtual file makes no sense . Dummy
* implementation is provided so that existing applications don ' t throw
* exception .
* @ param position
* @ param size
* @ param shared
* @ return
* @ throws IOException */
@ Override public FileL... | return new FileLockImpl ( this , position , size , shared ) ; |
public class ElementsExceptionsFactory { /** * Constructs and initializes a new { @ link ObjectNotFoundException } with the given { @ link String message }
* formatted with the given { @ link Object [ ] arguments } .
* @ param message { @ link String } describing the { @ link ObjectNotFoundException exception } .
... | return newObjectNotFoundException ( null , message , args ) ; |
public class MenuRendererCallback { /** * Render the whole menu
* @ param aLEC
* The current layout execution context . Required for cookie - less
* handling . May not be < code > null < / code > .
* @ param aFactory
* The factory to be used to create nodes of type T . May not be
* < code > null < / code > ... | final IMenuTree aMenuTree = aLEC . getMenuTree ( ) ; return createRenderedMenu ( aLEC , aFactory , aMenuTree . getRootItem ( ) , aRenderer , MenuItemDeterminatorCallback . getAllDisplayMenuItemIDs ( aMenuTree , aLEC . getSelectedMenuItemID ( ) ) ) ; |
public class DTMDefaultBase { /** * Get the simple type ID for the given node identity .
* @ param identity The node identity .
* @ return The simple type ID , or DTM . NULL . */
protected short _type ( int identity ) { } } | int info = _exptype ( identity ) ; if ( NULL != info ) return m_expandedNameTable . getType ( info ) ; else return NULL ; |
public class HalRepresentation { /** * Merges the Curies of an embedded resource with the Curies of this resource and updates
* link - relation types in _ links and _ embedded items .
* @ param curies the Curies of the embedding resource
* @ return this */
HalRepresentation mergeWithEmbedding ( final Curies curie... | this . curies = this . curies . mergeWith ( curies ) ; if ( this . links != null ) { removeDuplicateCuriesFromEmbedding ( curies ) ; this . links = this . links . using ( this . curies ) ; if ( embedded != null ) { embedded = embedded . using ( this . curies ) ; } } else { if ( embedded != null ) { embedded = embedded ... |
public class Transformation3D { /** * Transforms an envelope . The result is the bounding box of the transformed
* envelope . */
public Envelope3D transform ( Envelope3D env ) { } } | if ( env . isEmpty ( ) ) return env ; Point3D [ ] buf = new Point3D [ 8 ] ; env . queryCorners ( buf ) ; transform ( buf , 8 , buf ) ; env . setFromPoints ( buf ) ; return env ; |
public class Config { /** * Get attribute value or null if there is no attribute with requested name . An existing attribute value cannot ever
* be empty or null so if this method returns null is for missing attribute .
* @ param name attribute name .
* @ return attribute value or null if named attribute not foun... | Params . notNullOrEmpty ( name , "Attribute name" ) ; return attributes . get ( name ) ; |
public class StylesContainer { /** * Add a cell style to the content container and register the font face
* @ param ffcStyle the cell style or the text style
* @ return true if the style was created or updated */
public boolean addStylesFontFaceContainerStyle ( final FontFaceContainerStyle ffcStyle ) { } } | final FontFace fontFace = ffcStyle . getFontFace ( ) ; if ( fontFace != null ) { this . fontFaces . add ( fontFace ) ; } return this . addStylesStyle ( ffcStyle ) ; |
public class KeyIgnoringVCFOutputFormat { /** * < code > setHeader < / code > or < code > readHeaderFrom < / code > must have been
* called first . */
@ Override public RecordWriter < K , VariantContextWritable > getRecordWriter ( TaskAttemptContext ctx ) throws IOException { } } | Configuration conf = ctx . getConfiguration ( ) ; boolean isCompressed = getCompressOutput ( ctx ) ; CompressionCodec codec = null ; String extension = "" ; if ( isCompressed ) { Class < ? extends CompressionCodec > codecClass = getOutputCompressorClass ( ctx , BGZFCodec . class ) ; codec = ReflectionUtils . newInstanc... |
public class RingBuffer { /** * Returns the current position and increments it . If discard = = true the
* bytes before position are discarded .
* < p > This method is a support for concrete subclasses get method .
* @ param discard
* @ return */
protected final int rawGet ( boolean discard ) { } } | int pos ; if ( hasRemaining ( ) ) { if ( discard ) { mark = position ; marked = 1 ; } else { marked ++ ; } pos = position ; position = ( position + 1 ) % capacity ; remaining -- ; updated ( ) ; return pos ; } else { throw new BufferUnderflowException ( ) ; } |
public class CommerceOrderNotePersistenceImpl { /** * Removes all the commerce order notes where commerceOrderId = & # 63 ; from the database .
* @ param commerceOrderId the commerce order ID */
@ Override public void removeByCommerceOrderId ( long commerceOrderId ) { } } | for ( CommerceOrderNote commerceOrderNote : findByCommerceOrderId ( commerceOrderId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceOrderNote ) ; } |
public class RemoteAsyncResultImpl { /** * Export this object so that it is remotely accessible .
* < p > This method must be called before the async work is scheduled . */
RemoteAsyncResult exportObject ( ) throws RemoteException { } } | ivObjectID = ivRemoteRuntime . activateAsyncResult ( ( Servant ) createTie ( ) ) ; return ivRemoteRuntime . getAsyncResultReference ( ivObjectID ) ; |
public class StaplerResponseWrapper { /** * { @ inheritDoc } */
@ Override public void sendRedirect ( int statusCode , String url ) throws IOException { } } | getWrapped ( ) . sendRedirect ( statusCode , url ) ; |
public class ExpressionUtil { /** * visit line number
* @ param adapter
* @ param line
* @ param silent id silent this is ignored for log */
public static void visitLine ( BytecodeContext bc , Position pos ) { } } | if ( pos != null ) { visitLine ( bc , pos . line ) ; } |
public class CPSubsystemConfig { /** * Sets the map of { @ link FencedLock } configurations , mapped by config
* name . Names could optionally contain a { @ link CPGroup } name , such as
* " myLock @ group1 " .
* @ param lockConfigs the { @ link FencedLock } config map to set
* @ return this config instance */
... | this . lockConfigs . clear ( ) ; this . lockConfigs . putAll ( lockConfigs ) ; for ( Entry < String , FencedLockConfig > entry : this . lockConfigs . entrySet ( ) ) { entry . getValue ( ) . setName ( entry . getKey ( ) ) ; } return this ; |
public class TTFFile { /** * Read the " post " table
* containing the PostScript names of the glyphs .
* @ param in The reader to get the names from
* @ throws IOException Indicates a failure to read the table */
private final void readPostScript ( FontFileReader in ) throws IOException { } } | seekTab ( in , "post" , 0 ) ; postFormat = in . readTTFLong ( ) ; italicAngle = in . readTTFULong ( ) ; underlinePosition = in . readTTFShort ( ) ; underlineThickness = in . readTTFShort ( ) ; isFixedPitch = in . readTTFULong ( ) ; // Skip memory usage values
in . skip ( 4 * 4 ) ; log . debug ( "PostScript format: 0x" ... |
public class EvaluationMetricRunner { /** * Runs a single evaluation metric .
* @ param properties The properties of the strategy .
* @ throws IOException if recommendation file is not found or output cannot
* be written ( see { @ link # generateOutput ( net . recommenders . rival . core . DataModelIF , int [ ] ,... | System . out . println ( "Parsing started: recommendation file" ) ; File recommendationFile = new File ( properties . getProperty ( PREDICTION_FILE ) ) ; DataModelIF < Long , Long > predictions ; EvaluationStrategy . OUTPUT_FORMAT recFormat ; if ( properties . getProperty ( PREDICTION_FILE_FORMAT ) . equals ( Evaluatio... |
public class ProofObligation { /** * Chain an OR expression onto a root , or just return the new expression if the root is null . Called in a loop , this
* left - associates an OR tree . */
protected PExp makeOr ( PExp root , PExp e ) { } } | if ( root != null ) { AOrBooleanBinaryExp o = new AOrBooleanBinaryExp ( ) ; o . setLeft ( root . clone ( ) ) ; o . setOp ( new LexKeywordToken ( VDMToken . OR , null ) ) ; o . setType ( new ABooleanBasicType ( ) ) ; o . setRight ( e . clone ( ) ) ; return o ; } else { return e ; } |
public class StructureTextsRepository { /** * This method will try to avoid creating new strings for each structure name ( element / attribute ) */
static String getStructureName ( final char [ ] buffer , final int offset , final int len ) { } } | final int index = TextUtil . binarySearch ( true , ALL_STANDARD_NAMES , buffer , offset , len ) ; if ( index < 0 ) { return new String ( buffer , offset , len ) ; } return ALL_STANDARD_NAMES [ index ] ; |
public class PathAddress { /** * Navigate to , and remove , this address in the given model node .
* @ param model the model node
* @ return the submodel
* @ throws NoSuchElementException if the model contains no such element
* @ deprecated manipulating a deep DMR node tree via PathAddress is no longer how the ... | final Iterator < PathElement > i = pathAddressList . iterator ( ) ; while ( i . hasNext ( ) ) { final PathElement element = i . next ( ) ; if ( i . hasNext ( ) ) { model = model . require ( element . getKey ( ) ) . require ( element . getValue ( ) ) ; } else { final ModelNode parent = model . require ( element . getKey... |
public class FileExecutor { /** * 批量复制文件 , 并重命名
* @ param files 文件路径数组
* @ param destinationFiles 目标文件路径数组 , 与文件路径数组一一对应
* @ throws IOException 异常 */
public static void copyFiles ( String [ ] files , String [ ] destinationFiles ) throws IOException { } } | copyFiles ( getFiles ( files ) , getFiles ( destinationFiles ) ) ; |
public class DescribeConfigurationRecordersResult { /** * A list that contains the descriptions of the specified configuration recorders .
* @ return A list that contains the descriptions of the specified configuration recorders . */
public java . util . List < ConfigurationRecorder > getConfigurationRecorders ( ) { ... | if ( configurationRecorders == null ) { configurationRecorders = new com . amazonaws . internal . SdkInternalList < ConfigurationRecorder > ( ) ; } return configurationRecorders ; |
public class ClassNodeUtils { /** * Get methods from all interfaces .
* Methods from interfaces visited early will be overwritten by later ones .
* @ param cNode The ClassNode
* @ return A map of methods */
public static Map < String , MethodNode > getDeclaredMethodsFromInterfaces ( ClassNode cNode ) { } } | Map < String , MethodNode > result = new HashMap < String , MethodNode > ( ) ; ClassNode [ ] interfaces = cNode . getInterfaces ( ) ; for ( ClassNode iface : interfaces ) { result . putAll ( iface . getDeclaredMethodsMap ( ) ) ; } return result ; |
public class ParallelCountBytes { /** * Print the length and MD5 of the indicated file .
* < p > This uses the normal Java NIO Api , so it can take advantage of any installed NIO Filesystem
* provider without any extra effort . */
private static void countFile ( String fname ) throws Exception { } } | // large buffers pay off
final int bufSize = 50 * 1024 * 1024 ; Queue < Future < WorkUnit > > work = new ArrayDeque < > ( ) ; Path path = Paths . get ( new URI ( fname ) ) ; long size = Files . size ( path ) ; System . out . println ( fname + ": " + size + " bytes." ) ; int nThreads = ( int ) Math . ceil ( size / ( dou... |
public class InheritableState { /** * Return the default location of all images . It is used as the location
* for the tree structure images .
* @ return String */
public String getImageRoot ( ) { } } | if ( _imageRoot != null ) return _imageRoot ; if ( _parent != null ) return _parent . getImageRoot ( ) ; return null ; |
public class Regex { /** * Creates an NFA from regular expression
* @ param scope
* @ param expression
* @ return */
public static NFA < Integer > createNFA ( Scope < NFAState < Integer > > scope , String expression ) { } } | return createNFA ( scope , expression , 1 ) ; |
public class MultiEnvAware { /** * Returns the key , if that specified key is mapped to something
* @ param key - environment name
* @ return String */
public String getKeyOrDefault ( String key ) { } } | if ( StringUtils . isBlank ( key ) ) { if ( this . hasDefaultEnvironment ( ) ) { return defaultEnvironment ; } else { throw new MultiEnvSupportException ( "[environment] property is mandatory and can't be empty" ) ; } } if ( map . containsKey ( key ) ) { return key ; } if ( this . hasTemplateEnvironment ( ) ) { return ... |
public class PAbstractObject { /** * Get a property as a array or default .
* @ param key the property name
* @ param defaultValue default */
@ Override public final PObject optObject ( final String key , final PObject defaultValue ) { } } | PObject result = optObject ( key ) ; return result == null ? defaultValue : result ; |
public class PatternLayoutEscaped { /** * Create a copy of event , but append a stack trace to the message ( if it exists ) . Then it escapes
* the backslashes , tabs , newlines and quotes in its message as we are sending it as JSON and we
* don ' t want any corruption of the JSON object . */
private LoggingEvent a... | String message = event . getMessage ( ) . toString ( ) ; // If there is a stack trace available , print it out
if ( event . getThrowableInformation ( ) != null ) { final String [ ] s = event . getThrowableStrRep ( ) ; for ( final String line : s ) { message += "\n" + line ; } } message = message . replace ( "\\" , "\\\... |
public class JobScheduleDisableHeaders { /** * Set the time at which the resource was last modified .
* @ param lastModified the lastModified value to set
* @ return the JobScheduleDisableHeaders object itself . */
public JobScheduleDisableHeaders withLastModified ( DateTime lastModified ) { } } | if ( lastModified == null ) { this . lastModified = null ; } else { this . lastModified = new DateTimeRfc1123 ( lastModified ) ; } return this ; |
public class KTypeArrayList { /** * Applies < code > procedure < / code > to a slice of the list ,
* < code > fromIndex < / code > , inclusive , to < code > toIndex < / code > , exclusive . */
public < T extends KTypeProcedure < ? super KType > > T forEach ( T procedure , int fromIndex , final int toIndex ) { } } | assert ( fromIndex >= 0 && fromIndex <= size ( ) ) : "Index " + fromIndex + " out of bounds [" + 0 + ", " + size ( ) + ")." ; assert ( toIndex >= 0 && toIndex <= size ( ) ) : "Index " + toIndex + " out of bounds [" + 0 + ", " + size ( ) + "]." ; assert fromIndex <= toIndex : "fromIndex must be <= toIndex: " + fromIndex... |
public class PeriodFormatterData { /** * Append a count to the string builder .
* @ param unit the unit
* @ param count the count
* @ param cv the format to use for displaying the count
* @ param useSep whether to use the count separator , if available
* @ param name the term name
* @ param last true if thi... | if ( cv == ECountVariant . HALF_FRACTION && dr . halves == null ) { cv = ECountVariant . INTEGER ; } if ( ! omitCount && useDigitPrefix && dr . digitPrefix != null ) { sb . append ( dr . digitPrefix ) ; } int index = unit . ordinal ( ) ; switch ( cv ) { case ECountVariant . INTEGER : { if ( ! omitCount ) { appendIntege... |
public class JsonViewMessageConverter { /** * Registering custom serializer allows to the JSonView to deal with custom serializations for certains field types . < br >
* This way you could register for instance a JODA serialization as a DateTimeSerializer . < br >
* Thus , when JSonView find a field of that type ( ... | this . serializer . registerCustomSerializer ( class1 , forType ) ; |
public class Triple { /** * 根据等号左边的泛型 , 自动构造合适的Triple */
public static < L , M , R > Triple < L , M , R > of ( @ Nullable L left , @ Nullable M middle , @ Nullable R right ) { } } | return new Triple < L , M , R > ( left , middle , right ) ; |
public class ExtensionFeatureOptions { /** * Adds a dependency */
public ExtensionFeatureOptions withDependency ( ExtensionFeature feature ) { } } | Set < String > existing = this . dependencies ; Set < String > newDependencies ; if ( existing == null ) { newDependencies = new HashSet < > ( ) ; } else { newDependencies = new HashSet < > ( existing ) ; } newDependencies . add ( feature . getId ( ) ) ; return withDependencies ( newDependencies ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcRelAssignsToGroupByFactor ( ) { } } | if ( ifcRelAssignsToGroupByFactorEClass == null ) { ifcRelAssignsToGroupByFactorEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 522 ) ; } return ifcRelAssignsToGroupByFactorEClass ; |
public class EventSubscriptionsInner { /** * Get an event subscription .
* Get properties of an event subscription .
* @ param scope The scope of the event subscription . The scope can be a subscription , or a resource group , or a top level resource belonging to a resource provider namespace , or an EventGrid topi... | return getWithServiceResponseAsync ( scope , eventSubscriptionName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class IRSwitchStatement { /** * The switch statement has a non - null terminal stmt iff :
* 1 ) There are no case stmts or all the the case stmts have non - break terminator and
* 2 ) The default stmt exists and has a non - break terminator */
@ Override public IRTerminalStatement getLeastSignificantTerminal... | if ( _defaultStatements . isEmpty ( ) ) { return null ; } IRContinueStatement caseStmtContinue = null ; if ( _cases != null ) { outer : for ( int i = 0 ; i < _cases . size ( ) ; i ++ ) { List caseStatements = _cases . get ( i ) . getStatements ( ) ; if ( caseStatements != null && caseStatements . size ( ) > 0 ) { for (... |
public class Bindings { /** * Removes a specific variable definition from
* the list of bindings . The variable name must
* match exactly to be removed ( it is case sensitive ) .
* @ param varName variable name to remove the definition of .
* @ return true if the variable was successfully removed .
* False , ... | if ( values == null ) return false ; Iterator iter = values . iterator ( ) ; Binding binding ; int i = 0 ; int found = - 1 ; while ( iter . hasNext ( ) ) { binding = ( Binding ) iter . next ( ) ; if ( binding . getName ( ) . equals ( varName ) ) { found = i ; break ; } i ++ ; } if ( found != - 1 ) { values . remove ( f... |
public class DatabasesInner { /** * Returns database metrics .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverName The name of the server .
* @ param databaseName The name of the ... | return ServiceFuture . fromResponse ( listMetricsWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , filter ) , serviceCallback ) ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getDataObjectFontDescriptor ( ) { } } | if ( dataObjectFontDescriptorEClass == null ) { dataObjectFontDescriptorEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 352 ) ; } return dataObjectFontDescriptorEClass ; |
public class ByteArray { /** * 从指定的起始位置和长度查询value值出现的位置 , 没有返回 - 1
* @ param offset 起始位置
* @ param limit 长度限制
* @ param value 查询值
* @ return 所在位置 */
public int find ( int offset , int limit , byte value ) { } } | byte [ ] bytes = this . content ; int end = limit > 0 ? limit : count ; for ( int i = offset ; i < end ; i ++ ) { if ( bytes [ i ] == value ) return i ; } return - 1 ; |
public class TargetLoginStage { /** * Sends a Login Response PDU informing the initiator that an error has occurred and that the connection must be
* closed .
* @ param errorStatus hints to the cause of the error
* @ throws InterruptedException
* @ throws IOException
* @ throws InternetSCSIException */
protec... | final ProtocolDataUnit rejectPDU = TargetPduFactory . createLoginResponsePdu ( false , // transit flag
false , // continueFlag
stageNumber , // currentStage
stageNumber , // nextStage
session . getInitiatorSessionID ( ) , // initiatorSessionID
session . getTargetSessionIdentifyingHandle ( ) , // targetSessionIdentifyin... |
public class A_CmsSearchIndex { /** * Returns a new index writer for this index . < p >
* @ param report the report to write error messages on
* @ param create if < code > true < / code > a whole new index is created , if < code > false < / code > an existing index is updated
* @ return a new instance of IndexWri... | // note - create will be :
// true if the index is to be fully rebuild ,
// false if the index is to be incrementally updated
if ( m_indexWriter != null ) { if ( ! create ) { // re - use existing index writer
return m_indexWriter ; } // need to close the index writer if create is " true "
try { m_indexWriter . close ( ... |
public class CreateDeviceDefinitionVersionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateDeviceDefinitionVersionRequest createDeviceDefinitionVersionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createDeviceDefinitionVersionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createDeviceDefinitionVersionRequest . getAmznClientToken ( ) , AMZNCLIENTTOKEN_BINDING ) ; protocolMarshaller . marshall ( createDeviceDefinitionVe... |
public class SnowflakeDatabaseMetaData { /** * Returns the JDBC standard property string for the property string used
* in our show constraint commands
* @ param property _ name operation type
* @ param property property value
* @ return metdata property value */
private short getForeignKeyConstraintProperty ( ... | short result = 0 ; switch ( property_name ) { case "update" : case "delete" : switch ( property ) { case "NO ACTION" : result = importedKeyNoAction ; break ; case "CASCADE" : result = importedKeyCascade ; break ; case "SET NULL" : result = importedKeySetNull ; break ; case "SET DEFAULT" : result = importedKeySetDefault... |
public class PlayEngine { /** * Send playback stoppage status notification
* @ param item
* Playlist item */
private void sendStopStatus ( IPlayItem item ) { } } | Status stop = new Status ( StatusCodes . NS_PLAY_STOP ) ; stop . setClientid ( streamId ) ; stop . setDesciption ( String . format ( "Stopped playing %s." , item . getName ( ) ) ) ; stop . setDetails ( item . getName ( ) ) ; doPushMessage ( stop ) ; |
public class InteractionManager { /** * Caller must hold lock on interactions */
private Interaction findContext ( String id ) { } } | for ( int i = _currentInteractions . size ( ) - 1 ; i >= 0 ; i -- ) { Interaction ia = ( Interaction ) _currentInteractions . get ( i ) ; if ( ia . id . equals ( id ) ) { return ia ; } } return null ; |
public class DeleteLoadBalancerRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteLoadBalancerRequest deleteLoadBalancerRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteLoadBalancerRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteLoadBalancerRequest . getLoadBalancerName ( ) , LOADBALANCERNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall... |
public class PathTools { /** * All - Pairs - Shortest - Path computation based on Floyd ' s
* algorithm { @ cdk . cite FLO62 } . It takes an nxn
* matrix C of edge costs and produces an nxn matrix A of lengths of shortest
* paths .
* @ param costMatrix edge cost matrix
* @ return the topological distance matr... | int nrow = costMatrix . length ; int [ ] [ ] distMatrix = new int [ nrow ] [ nrow ] ; // logger . debug ( " Matrix size : " + n ) ;
for ( int i = 0 ; i < nrow ; i ++ ) { for ( int j = 0 ; j < nrow ; j ++ ) { if ( costMatrix [ i ] [ j ] == 0 ) { distMatrix [ i ] [ j ] = 999999999 ; } else { distMatrix [ i ] [ j ] = 1 ; ... |
public class RemoteConsumerTransmit { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . runtime . SIMPRemoteConsumerTransmitControllable # getNumberOfRequestsReceived ( ) */
public long getNumberOfCurrentRequests ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getNumberOfCurrentRequests" ) ; // request , value , rejected and accepted messages are all counted
long returnValue = _aoStream . getNumberOfRequestsInState ( TickRange . Requested ) ; returnValue += _aoStream . getNumberO... |
public class ApiOvhOrder { /** * Get allowed durations for ' new ' option
* REST : GET / order / router / new
* @ param vrack [ required ] The name of your vrack */
public ArrayList < String > router_new_GET ( String vrack ) throws IOException { } } | String qPath = "/order/router/new" ; StringBuilder sb = path ( qPath ) ; query ( sb , "vrack" , vrack ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t1 ) ; |
public class Vectors { /** * Returns true if vector ( x2 , y2 ) is clockwise of ( x1 , y1 ) in ( ox , oy ) centered
* coordinate .
* @ param ox
* @ param oy
* @ param x1
* @ param y1
* @ param x2
* @ param y2
* @ return */
public static final boolean isClockwise ( double ox , double oy , double x1 , dou... | return isClockwise ( x1 - ox , y1 - oy , x2 - ox , y2 - oy ) ; |
public class XsdAsmVisitor { /** * Adds a specific method for a visitElement call .
* Example :
* void visitElementHtml ( Html < Z > html ) {
* visitElement ( html ) ;
* @ param classWriter The ElementVisitor class { @ link ClassWriter } .
* @ param elementName The specific element .
* @ param apiName The n... | elementName = getCleanName ( elementName ) ; String classType = getFullClassTypeName ( elementName , apiName ) ; String classTypeDesc = getFullClassTypeNameDesc ( elementName , apiName ) ; MethodVisitor mVisitor = classWriter . visitMethod ( ACC_PUBLIC , VISIT_ELEMENT_NAME + elementName , "(" + classTypeDesc + ")V" , "... |
public class MultipartHttpMessageConverter { /** * Set the message body converters to use . These converters are used to
* convert objects to MIME parts . */
public void setPartConverters ( List < HttpMessageConverter > partConverters ) { } } | checkNotNull ( partConverters , "'partConverters' must not be null" ) ; checkArgument ( ! partConverters . isEmpty ( ) , "'partConverters' must not be empty" ) ; this . partConverters = partConverters ; |
public class TreeGenerator { /** * / < param name = " manager " > TreeGP config < / param > */
public static TreeNode createWithDepth ( Program program , int allowableDepth , TreeGP manager , TGPInitializationStrategy method ) { } } | OperatorSet operatorSet = program . getOperatorSet ( ) ; RandEngine randEngine = manager . getRandEngine ( ) ; TreeNode root ; // Population Initialization method following the " RandomBranch " method described in " Kumar Chellapilla . Evolving computer programs without subtree crossover . IEEE Transactions on Evolutio... |
public class FormatTrackingHSSFListenerPlus { /** * Returns the format string , eg $ # # . # # , for the given number format index .
* @ param formatIndex the format index
* @ return the format string */
public String getFormatString ( int formatIndex ) { } } | String format = null ; if ( formatIndex >= HSSFDataFormat . getNumberOfBuiltinBuiltinFormats ( ) ) { FormatRecord tfr = _customFormatRecords . get ( Integer . valueOf ( formatIndex ) ) ; if ( tfr == null ) { logger . log ( POILogger . ERROR , "Requested format at index " + formatIndex + ", but it wasn't found" ) ; } el... |
public class Project { /** * Create a new Iteration in the Project where the schedule is defined .
* @ param name The initial name of the Iteration .
* @ param beginDate The begin date of the Iteration .
* @ param endDate The end date of the Iteration .
* @ param attributes additional attributes for Iteration .... | return getInstance ( ) . create ( ) . iteration ( name , getSchedule ( ) , beginDate , endDate , attributes ) ; |
public class CmsWorkplaceEditorConfiguration { /** * Sets the editor workplace URI . < p >
* @ param uri the editor workplace URI */
private void setEditorUri ( String uri ) { } } | if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( uri ) ) { setValidConfiguration ( false ) ; LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_EDITOR_CONFIG_NO_URI_0 ) ) ; } m_editorUri = uri ; |
public class AggregateCounterController { /** * Retrieve information about a specific aggregate counter .
* @ param name counter name
* @ return { @ link AggregateCounterResource } */
@ RequestMapping ( value = "/{name}" , method = RequestMethod . GET ) public AggregateCounterResource display ( @ PathVariable ( "na... | AggregateCounter counter = repository . findOne ( name ) ; if ( counter == null ) { throw new NoSuchMetricException ( name ) ; } return deepAssembler . toResource ( counter ) ; |
public class JawnServlet { /** * Actually sorts the paths , which is not appreciated and not even used anywhere
* @ param servletContext2
* @ return */
private Set < String > findExclusionPaths ( ServletContext servletContext ) { } } | Set < String > exclusions = new TreeSet < String > ( ) ; // Let other handlers deal with folders that do not reside in the WEB - INF or META - INF
Set < String > resourcePaths = servletContext . getResourcePaths ( "/" ) ; // This most certainly should not be null !
// It means that the server cannot read files at all
i... |
public class SerializerIntrinsics { /** * Double Precision Shift Left . */
public final void shld ( Mem dst , Register src1 , Immediate src2 ) { } } | emitX86 ( INST_SHLD , dst , src1 , src2 ) ; |
public class WikipediaTemplateInfoGenerator { /** * Extracts templates from pages only */
private void processPages ( ) { } } | PageIterator pageIter = new PageIterator ( getWiki ( ) , true , pageBuffer ) ; int pageCounter = 0 ; while ( pageIter . hasNext ( ) ) { pageCounter ++ ; if ( pageCounter % VERBOSITY == 0 ) { logger . info ( "{} pages processed ..." , pageCounter ) ; } Page curPage = pageIter . next ( ) ; int curPageId = curPage . getPa... |
public class NodeStack { /** * Push a node and associated state onto the stack , remembering
* a height imbalance if there is one . */
void balancedPush ( int state , GBSNode node ) { } } | push ( state , node ) ; if ( node . balance ( ) != 0 ) _bpidx = _cidx ; |
public class PasswordAuthFilter { /** * Handles an authentication request .
* @ param request HTTP request
* @ param response HTTP response
* @ return an authentication object that contains the principal object if successful .
* @ throws IOException ex
* @ throws ServletException ex */
@ Override public Authe... | String requestURI = request . getRequestURI ( ) ; UserAuthentication userAuth = null ; User user = null ; if ( requestURI . endsWith ( PASSWORD_ACTION ) ) { user = new User ( ) ; user . setIdentifier ( request . getParameter ( EMAIL ) ) ; user . setPassword ( request . getParameter ( PASSWORD ) ) ; String appid = reque... |
public class AmazonCloudFormationClient { /** * Returns summary information about stack sets that are associated with the user .
* @ param listStackSetsRequest
* @ return Result of the ListStackSets operation returned by the service .
* @ sample AmazonCloudFormation . ListStackSets
* @ see < a href = " http : /... | request = beforeClientExecution ( request ) ; return executeListStackSets ( request ) ; |
public class JDBDT { /** * Create a new database handle for given { @ link javax . sql . DataSource }
* instance .
* < p > Calling this method is shorthand for : < br >
* & nbsp ; & nbsp ; & nbsp ; & nbsp ;
* < code > database ( xds . getConnection ( ) ) < / code > .
* @ param xds { @ link javax . sql . DataS... | return database ( xds . getConnection ( ) ) ; |
public class CmsToolManager { /** * Returns the admin tool corresponding to the given abstract path . < p >
* @ param rootKey the tool root
* @ param toolPath the path
* @ return the corresponding tool , or < code > null < / code > if not found */
public CmsTool resolveAdminTool ( String rootKey , String toolPath... | return m_tools . getObject ( rootKey + ROOT_SEPARATOR + toolPath ) ; |
public class LogLog { /** * This method is used to output log4j internal debug
* statements . Output goes to < code > System . out < / code > . */
public static void debug ( String msg , Throwable t ) { } } | if ( debugEnabled && ! quietMode ) { System . out . println ( PREFIX + msg ) ; if ( t != null ) t . printStackTrace ( System . out ) ; } |
public class CommerceOrderPersistenceImpl { /** * Returns the first commerce order in the ordered set where groupId = & # 63 ; and commerceAccountId = & # 63 ; .
* @ param groupId the group ID
* @ param commerceAccountId the commerce account ID
* @ param orderByComparator the comparator to order the set by ( opti... | List < CommerceOrder > list = findByG_C ( groupId , commerceAccountId , 0 , 1 , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ; |
public class Providers { /** * Provide a Provider from the resource found in the current class loader with the provided encoding . < br / > As
* resource is accessed through a class loader , a leading " / " is not allowed in pathToResource */
public static Provider resourceProvider ( String pathToResource , Charset e... | ClassLoader classLoader = Provider . class . getClassLoader ( ) ; return resourceProvider ( classLoader , pathToResource , encoding ) ; |
public class InternalXtextParser { /** * InternalXtext . g : 178:1 : entryRuleReferencedMetamodel : ruleReferencedMetamodel EOF ; */
public final void entryRuleReferencedMetamodel ( ) throws RecognitionException { } } | try { // InternalXtext . g : 179:1 : ( ruleReferencedMetamodel EOF )
// InternalXtext . g : 180:1 : ruleReferencedMetamodel EOF
{ before ( grammarAccess . getReferencedMetamodelRule ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_1 ) ; ruleReferencedMetamodel ( ) ; state . _fsp -- ; after ( grammarAccess . getReferencedMet... |
public class NumberUtil { /** * 提供 ( 相对 ) 精确的除法运算 , 当发生除不尽的情况时 , 由scale指定精确度 , 后面的四舍五入
* @ param v1 被除数
* @ param v2 除数
* @ param scale 精确度 , 如果为负值 , 取绝对值
* @ return 两个参数的商
* @ since 3.1.0 */
public static BigDecimal div ( Number v1 , Number v2 , int scale ) { } } | return div ( v1 , v2 , scale , RoundingMode . HALF_UP ) ; |
public class RSA { /** * 从KeyStore获取公钥
* @ param location
* @ param alias
* @ param storeType
* @ param storePass
* @ param keyPass
* @ return */
public static PublicKey loadPublicKeyFromKeyStore ( String location , String alias , String storeType , String storePass , String keyPass ) { } } | try { storeType = null == storeType ? KeyStore . getDefaultType ( ) : storeType ; keyPass = keyPass == null ? storePass : keyPass ; KeyStore keyStore = KeyStore . getInstance ( storeType ) ; InputStream is = new FileInputStream ( location ) ; keyStore . load ( is , storePass . toCharArray ( ) ) ; RSAPrivateCrtKey key =... |
public class RecoveryPointsInner { /** * Provides the backup data for the RecoveryPointID . This is an asynchronous operation . To learn the status of the operation , call the GetProtectedItemOperationResult API .
* @ param vaultName The name of the Recovery Services vault .
* @ param resourceGroupName The name of ... | return getWithServiceResponseAsync ( vaultName , resourceGroupName , fabricName , containerName , protectedItemName , recoveryPointId ) . map ( new Func1 < ServiceResponse < RecoveryPointResourceInner > , RecoveryPointResourceInner > ( ) { @ Override public RecoveryPointResourceInner call ( ServiceResponse < RecoveryPo... |
public class CacheLoader { /** * Dump the XML representation of the expirer .
* @ param writer The formatted writer to which the dump should be directed .
* @ throws IOException */
public void xmlWriteOn ( FormattedWriter writer ) throws IOException { } } | DateFormat dateFormat = new SimpleDateFormat ( "yyyy-MM-dd @ HH:mm:ss.SSS" ) ; String timeNow = dateFormat . format ( new Date ( ) ) ; writer . newLine ( ) ; writer . startTag ( XML_CACHE_LOADER ) ; writer . indent ( ) ; writer . newLine ( ) ; writer . taggedValue ( "timeNow" , timeNow ) ; writer . newLine ( ) ; writer... |
public class DoubleTuples { /** * Returns the standard deviation of the given tuple .
* The method will compute { @ link # variance ( DoubleTuple ) } , return
* the square root of this value .
* @ param t The input tuple
* @ param mean The mean , which may have been computed before with
* { @ link # arithmeti... | double variance = variance ( t , mean ) ; return Math . sqrt ( variance ) ; |
public class DynamoDBTableMapper { /** * Loads an object with the hash key given .
* @ param hashKey The hash key value .
* @ return The object .
* @ see com . amazonaws . services . dynamodbv2 . datamodeling . DynamoDBMapper # load */
public T load ( H hashKey ) { } } | return mapper . < T > load ( model . targetType ( ) , hashKey ) ; |
public class APRIORI { /** * Build the 2 - itemsets .
* @ param oneitems Frequent 1 - itemsets
* @ param relation Data relation
* @ param dim Maximum dimensionality
* @ param needed Minimum support needed
* @ param ids Objects to process
* @ param survivors Output : objects that had at least two 1 - frequen... | int f1 = 0 ; long [ ] mask = BitsUtil . zero ( dim ) ; for ( OneItemset supported : oneitems ) { BitsUtil . setI ( mask , supported . item ) ; f1 ++ ; } if ( LOG . isStatistics ( ) ) { LOG . statistics ( new LongStatistic ( STAT + "2-items.candidates" , f1 * ( long ) ( f1 - 1 ) ) ) ; } // We quite aggressively size the... |
public class SftpClient { /** * Upload a file to the remote computer .
* @ param local
* the path / name of the local file
* @ param progress
* @ throws SftpStatusException
* @ throws SshException
* @ throws TransferCancelledException
* @ throws FileNotFoundException */
public void put ( String local , Fi... | put ( local , progress , false ) ; |
public class ActionConstants { /** * Creates a permission
* @ param name
* @ param serviceName
* @ param actions
* @ return the created Permission
* @ throws java . lang . IllegalArgumentException if there is no service found with the given serviceName . */
public static Permission getPermission ( String name... | PermissionFactory permissionFactory = PERMISSION_FACTORY_MAP . get ( serviceName ) ; if ( permissionFactory == null ) { throw new IllegalArgumentException ( "No permissions found for service: " + serviceName ) ; } return permissionFactory . create ( name , actions ) ; |
public class JDefaultIdentity { /** * Creates a Driver ' s license in the format of 2 Letter State Code , Dash , 8 Digit Random Number
* ie CO - 12345678
* @ return driver ' s license string */
public static String driversLicense ( ) { } } | StringBuffer dl = new StringBuffer ( JDefaultAddress . stateAbbr ( ) ) ; dl . append ( "-" ) ; dl . append ( JDefaultNumber . randomNumberString ( 8 ) ) ; return dl . toString ( ) ; |
public class GenericInputSplit { @ Override public void write ( DataOutput out ) throws IOException { } } | out . writeInt ( this . partitionNumber ) ; out . writeInt ( this . totalNumberOfPartitions ) ; |
public class SegmentIndexBufferFileIO { /** * Reads from the specified segment index buffer file .
* @ param sib - the segment index buffer
* @ param sibFile - the segment index buffer file to read from
* @ throws IOException */
@ Override public int read ( SegmentIndexBuffer sib , File sibFile ) throws IOExcepti... | check ( sibFile ) ; RandomAccessFile raf = new RandomAccessFile ( sibFile , "r" ) ; FileChannel channel = raf . getChannel ( ) ; readVersion ( channel ) ; int length = sib . read ( channel ) ; length += STORAGE_VERSION_LENGTH ; channel . close ( ) ; raf . close ( ) ; if ( _logger . isTraceEnabled ( ) ) { _logger . trac... |
public class RoaringIntPacking { /** * Duplicated from jdk8 Integer . compareUnsigned */
public static int compareUnsigned ( int x , int y ) { } } | return Integer . compare ( x + Integer . MIN_VALUE , y + Integer . MIN_VALUE ) ; |
public class SqlMapper { /** * 查询返回List < Map < String , Object > >
* @ param sql 执行的sql
* @ param value 参数
* @ return result */
public List < Map < String , Object > > selectList ( String sql , Object value ) { } } | Class < ? > parameterType = value != null ? value . getClass ( ) : null ; String msId = msUtils . selectDynamic ( sql , parameterType ) ; return sqlSession . selectList ( msId , value ) ; |
public class QueueEntryRow { /** * Returns a byte array representing prefix of a queue . The prefix is formed by first two bytes of
* MD5 of the queue name followed by the queue name . */
public static byte [ ] getQueueRowPrefix ( QueueName queueName ) { } } | if ( queueName . isStream ( ) ) { // NOTE : stream is uniquely identified by table name
return Bytes . EMPTY_BYTE_ARRAY ; } String flowlet = queueName . getThirdComponent ( ) ; String output = queueName . getSimpleName ( ) ; byte [ ] idWithinFlow = ( flowlet + "/" + output ) . getBytes ( Charsets . US_ASCII ) ; return ... |
public class SourceCredentialsInfoMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SourceCredentialsInfo sourceCredentialsInfo , ProtocolMarshaller protocolMarshaller ) { } } | if ( sourceCredentialsInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sourceCredentialsInfo . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( sourceCredentialsInfo . getServerType ( ) , SERVERTYPE_BINDING ) ; protocolMar... |
public class ClassByImplementationBenchmark { /** * Performs a benchmark of an interface implementation using cglib .
* @ return The created instance , in order to avoid JIT removal . */
@ Benchmark public ExampleInterface benchmarkCglib ( ) { } } | Enhancer enhancer = new Enhancer ( ) ; enhancer . setUseCache ( false ) ; enhancer . setClassLoader ( newClassLoader ( ) ) ; enhancer . setSuperclass ( baseClass ) ; CallbackHelper callbackHelper = new CallbackHelper ( Object . class , new Class [ ] { baseClass } ) { protected Object getCallback ( Method method ) { if ... |
public class CertificateChainUtil { /** * Extracts the DNs of the issuers from a certificate chain . The last certificate in the chain will be ignored ( since it is
* the subject )
* @ param chain
* a normalised chain
* @ return */
public static X500Principal [ ] getIssuerDNsFromChain ( List < X509Certificate >... | if ( chain == null || chain . isEmpty ( ) ) throw new IllegalArgumentException ( "Must provide a chain that is non-null and non-empty" ) ; // Given a chain of n , there are n - 1 values for " issuers " and 1 " subject "
final X500Principal [ ] issuers = new X500Principal [ chain . size ( ) - 1 ] ; // Allocate array of ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.