signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ST_XMin { /** * Returns the minimal x - value of the given geometry .
* @ param geom Geometry
* @ return The minimal x - value of the given geometry , or null if the geometry is null . */
public static Double getMinX ( Geometry geom ) { } } | if ( geom != null ) { return geom . getEnvelopeInternal ( ) . getMinX ( ) ; } else { return null ; } |
public class SanitizedContents { /** * Creates JS from a number .
* < p > Soy prints numbers as floats and it wraps them in spaces . This is undesirable if the source
* code is presented to the user , e . g . in { @ code < textarea > } . This function allows converting the
* number to JS which is then printed as ... | return SanitizedContent . create ( String . valueOf ( number ) , ContentKind . JS ) ; |
public class AbstractAmazonKinesisFirehoseDelivery { /** * Method to create the record object for given data .
* @ param data the content data
* @ return the Record object */
private static Record createRecord ( String data ) { } } | return new Record ( ) . withData ( ByteBuffer . wrap ( data . getBytes ( ) ) ) ; |
public class AsmUtils { /** * Determines whether the class with the given descriptor is assignable to the given type .
* @ param classInternalName the class descriptor
* @ param type the type
* @ return true if the class with the given descriptor is assignable to the given type */
public static boolean isAssignab... | checkArgNotNull ( classInternalName , "classInternalName" ) ; checkArgNotNull ( type , "type" ) ; return type . isAssignableFrom ( getClassForInternalName ( classInternalName ) ) ; |
public class GlobusPathMatchingResourcePatternResolver { /** * This method takes a location string and returns a GlobusResource of the
* corresponding location . This method does not accept any patterns for the location string .
* @ param location An absolute or relative location in the style classpath : / folder /... | GlobusResource returnResource ; URL resourceURL ; if ( location . startsWith ( "classpath:" ) ) { resourceURL = getClass ( ) . getClassLoader ( ) . getResource ( location . replaceFirst ( "classpath:/" , "" ) ) ; returnResource = new GlobusResource ( resourceURL . getPath ( ) ) ; } else if ( location . startsWith ( "fi... |
public class BigDecimalAccessor { /** * ( non - Javadoc )
* @ see
* com . impetus . kundera . property . PropertyAccessor # toBytes ( java . lang . Object ) */
@ Override public byte [ ] toBytes ( Object object ) { } } | if ( object == null ) { return null ; } BigDecimal b = ( BigDecimal ) object ; final int scale = b . scale ( ) ; final BigInteger unscaled = b . unscaledValue ( ) ; final byte [ ] value = unscaled . toByteArray ( ) ; final byte [ ] bytes = new byte [ value . length + 4 ] ; bytes [ 0 ] = ( byte ) ( scale >>> 24 ) ; byte... |
public class AttributeValueImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . ATTRIBUTE_VALUE__RESERVED0 : setReserved0 ( ( Integer ) newValue ) ; return ; case AfplibPackage . ATTRIBUTE_VALUE__ATT_VAL : setAttVal ( ( String ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class BigtableBufferedMutatorHelper { /** * Being a Mutation . This method will block if either of the following are true :
* 1 ) There are more than { @ code maxInflightRpcs } RPCs in flight
* 2 ) There are more than { @ link # getWriteBufferSize ( ) } bytes pending
* @ param mutation a { @ link Mutation ... | closedReadLock . lock ( ) ; try { if ( closed ) { throw new IllegalStateException ( "Cannot mutate when the BufferedMutator is closed." ) ; } return offer ( mutation ) ; } finally { closedReadLock . unlock ( ) ; } |
public class DateContext { /** * Compare one date to another for equality in year , month and date . Note
* that this ignores all other values including the time . If either value
* is < code > null < / code > , including if both are < code > null < / code > , then
* < code > false < / code > is returned .
* @ ... | if ( date1 == null || date2 == null ) { return false ; } boolean result ; GregorianCalendar cal1 = new GregorianCalendar ( ) ; GregorianCalendar cal2 = new GregorianCalendar ( ) ; cal1 . setTime ( date1 ) ; cal2 . setTime ( date2 ) ; if ( cal1 . get ( Calendar . YEAR ) == cal2 . get ( Calendar . YEAR ) && cal1 . get ( ... |
public class ClassLoaders { /** * Adds and returns all classes contained in the given package ( and its
* sub - packages ) .
* @ param pkg
* @ param classForClassLoader
* @ return
* @ throws IOException */
public static List < Class < ? > > getClassesForPackage ( Package pkg , Class classForClassLoader ) thro... | return getClassesForPackage ( pkg . getName ( ) , classForClassLoader ) ; |
public class StringHelper { /** * Break apart a string using a tokenizer into a { @ code List } of { @ code String } s .
* @ param inputString a string containing zero or or more segments
* @ param seperator seperator to use for the split , or null for the default
* @ return a { @ code List } of { @ code String }... | if ( inputString == null || inputString . length ( ) < 1 ) { return Collections . emptyList ( ) ; } final List < String > values = new ArrayList < String > ( ) ; values . addAll ( Arrays . asList ( inputString . split ( seperator ) ) ) ; return Collections . unmodifiableList ( values ) ; |
public class GradientActivity { /** * Demonstrates how to draw visuals */
@ Override protected void onDrawFrame ( SurfaceView view , Canvas canvas ) { } } | super . onDrawFrame ( view , canvas ) ; // Display info on the image being process and how fast input camera
// stream ( probably in YUV420 ) is converted into a BoofCV format
int width = bitmap . getWidth ( ) ; int height = bitmap . getHeight ( ) ; canvas . drawText ( String . format ( Locale . getDefault ( ) , "%d x ... |
public class CameraPinholeBrown { /** * If true then distortion parameters are specified . */
public boolean isDistorted ( ) { } } | if ( radial != null && radial . length > 0 ) { for ( int i = 0 ; i < radial . length ; i ++ ) { if ( radial [ i ] != 0 ) return true ; } } return t1 != 0 || t2 != 0 ; |
public class FxUiManager { /** * Simple utility class to load an { @ link FxmlNode } as a { @ link Scene } for use with { @ link # mainComponent ( ) }
* @ param node the node to load in the { @ link Scene }
* @ return The ready - to - use { @ link Scene }
* @ throws RuntimeException if the scene could not be load... | return easyFxml . loadNode ( node ) . getNode ( ) . map ( Scene :: new ) . getOrElseThrow ( ( Function < ? super Throwable , RuntimeException > ) RuntimeException :: new ) ; |
public class GenericUtils { /** * 将 GenericObject 转换为具体对象
* @ param genericObject 待转换的GenericObject
* @ return 转换后结果 */
public static < T > T convertToObject ( Object genericObject ) { } } | try { return ( T ) innerToConvertObject ( genericObject , new IdentityHashMap < Object , Object > ( ) ) ; } catch ( Throwable t ) { throw new ConvertException ( t ) ; } |
public class PacketBuilder { /** * Adds a boolean
* @ param b Boolean
* @ throws IllegalStateException see { @ link # checkBuilt ( ) } */
public synchronized PacketBuilder withBoolean ( final boolean b ) { } } | checkBuilt ( ) ; try { dataOutputStream . writeBoolean ( b ) ; } catch ( final IOException e ) { logger . error ( "Unable to add boolean: {} : {}" , e . getClass ( ) , e . getMessage ( ) ) ; } return this ; |
public class SaltScanner { /** * Starts all of the scanners asynchronously and returns the data fetched
* once all of the scanners have completed . Note that the result may be an
* exception if one or more of the scanners encountered an exception . The
* first error will be returned , others will be logged .
* ... | start_time = System . currentTimeMillis ( ) ; int i = 0 ; for ( final Scanner scanner : scanners ) { new ScannerCB ( scanner , i ++ ) . scan ( ) ; } return results ; |
public class Latkes { /** * Initializes Latke framework . */
public static synchronized void init ( ) { } } | if ( inited ) { return ; } inited = true ; LOGGER . log ( Level . TRACE , "Initializing Latke" ) ; loadLatkeProps ( ) ; loadLocalProps ( ) ; if ( null == runtimeMode ) { final String runtimeModeValue = getLatkeProperty ( "runtimeMode" ) ; if ( null != runtimeModeValue ) { runtimeMode = RuntimeMode . valueOf ( runtimeMo... |
public class DoubleTupleFunctions { /** * Performs an inclusive scan on the elements of the given tuple , using
* the provided associative accumulation function , and returns the
* result . < br >
* < br >
* If the given < code > result < / code > tuple is < code > null < / code > , then a
* new tuple will be... | result = DoubleTuples . validate ( t0 , result ) ; int n = t0 . getSize ( ) ; if ( n > 0 ) { result . set ( 0 , t0 . get ( 0 ) ) ; for ( int i = 1 ; i < n ; i ++ ) { double operand0 = result . get ( i - 1 ) ; double operand1 = t0 . get ( i ) ; double r = op . applyAsDouble ( operand0 , operand1 ) ; result . set ( i , r... |
public class OpenShiftAssistant { /** * Gets the URL of the route with given name .
* @ param routeName to return its URL
* @ return URL backed by the route with given name . */
public Optional < URL > getRoute ( String routeName ) { } } | Route route = getClient ( ) . routes ( ) . inNamespace ( namespace ) . withName ( routeName ) . get ( ) ; return route != null ? Optional . ofNullable ( createUrlFromRoute ( route ) ) : Optional . empty ( ) ; |
public class DefaultEurekaServerConfig { /** * ( non - Javadoc )
* @ see com . netflix . eureka . EurekaServerConfig # getAWSAccessId ( ) */
@ Override public String getAWSSecretKey ( ) { } } | String aWSSecretKey = configInstance . getStringProperty ( namespace + "awsSecretKey" , null ) . get ( ) ; if ( null != aWSSecretKey ) { return aWSSecretKey . trim ( ) ; } else { return null ; } |
public class ShapeGenerator { /** * Return a path for a rectangle with rounded corners .
* @ param x the X coordinate of the upper - left corner of the rectangle
* @ param y the Y coordinate of the upper - left corner of the rectangle
* @ param w the width of the rectangle
* @ param h the height of the rectangl... | return createRoundRectangle ( x , y , w , h , size , CornerStyle . ROUNDED , CornerStyle . ROUNDED , CornerStyle . ROUNDED , CornerStyle . ROUNDED ) ; |
public class TransactionIsolation { /** * Static method to get an instance
* @ param v The value
* @ return The instance */
public static TransactionIsolation forName ( String v ) { } } | if ( v != null && ! v . trim ( ) . equals ( "" ) ) { if ( "TRANSACTION_READ_UNCOMMITTED" . equalsIgnoreCase ( v ) || "1" . equalsIgnoreCase ( v ) ) { return TRANSACTION_READ_UNCOMMITTED ; } else if ( "TRANSACTION_READ_COMMITTED" . equalsIgnoreCase ( v ) || "2" . equalsIgnoreCase ( v ) ) { return TRANSACTION_READ_COMMIT... |
public class ConfigExportDeliveryInfoMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ConfigExportDeliveryInfo configExportDeliveryInfo , ProtocolMarshaller protocolMarshaller ) { } } | if ( configExportDeliveryInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( configExportDeliveryInfo . getLastStatus ( ) , LASTSTATUS_BINDING ) ; protocolMarshaller . marshall ( configExportDeliveryInfo . getLastErrorCode ( ) , LASTERRO... |
public class CollectionFactory { /** * Create the most appropriate collection for the given collection type .
* < p > Creates an ArrayList , TreeSet or linked Set for a List , SortedSet
* or Set , respectively .
* @ param collectionType the desired type of the target Collection
* @ param initialCapacity the ini... | if ( collectionType . isInterface ( ) ) { if ( List . class . equals ( collectionType ) ) { return new ArrayList ( initialCapacity ) ; } else if ( SortedSet . class . equals ( collectionType ) || collectionType . equals ( navigableSetClass ) ) { return new TreeSet ( ) ; } else if ( Set . class . equals ( collectionType... |
public class RESTAppListener { /** * { @ inheritDoc } */
@ Override public void contextRootAdded ( String contextRoot , VirtualHost virtualHost ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Added contextRoot {0} to virtual host {1}" , contextRoot , virtualHost . getName ( ) ) ; } // Check that our app got installed
if ( contextRoot != null && contextRoot . contains ( APIConstants . JMX_CONNECTOR_API_ROOT_PATH )... |
public class JSON { /** * write json .
* @ param obj object .
* @ param properties property name array .
* @ param writer writer .
* @ throws IOException . */
public static void json ( Object obj , final String [ ] properties , Writer writer , boolean writeClass , Converter < Object , Map < String , Object > > ... | if ( obj == null ) writer . write ( NULL ) ; else json ( obj , properties , new JSONWriter ( writer ) , writeClass , mc ) ; |
public class TagService { /** * Returns the { @ link Tag } with the provided name . */
public Tag findTag ( String tagName ) { } } | if ( null == tagName ) throw new IllegalArgumentException ( "Looking for null tag name." ) ; return definedTags . get ( Tag . normalizeName ( tagName ) ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcProfileProperties ( ) { } } | if ( ifcProfilePropertiesEClass == null ) { ifcProfilePropertiesEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 458 ) ; } return ifcProfilePropertiesEClass ; |
public class AccountHeaderBuilder { /** * method to build the header view
* @ return */
public AccountHeader build ( ) { } } | // if the user has not set a accountHeader use the default one : D
if ( mAccountHeaderContainer == null ) { withAccountHeader ( - 1 ) ; } // get the header view within the container
mAccountHeader = mAccountHeaderContainer . findViewById ( R . id . material_drawer_account_header ) ; mStatusBarGuideline = mAccountHeader... |
public class AbstractValidate { /** * < p > Validate that the specified argument object fall between the two exclusive values specified ; otherwise , throws an exception . < / p >
* < pre > Validate . exclusiveBetween ( 0 , 2 , 1 ) ; < / pre >
* @ param < T >
* the type of the argument start and end values
* @ ... | if ( value . compareTo ( start ) <= 0 || value . compareTo ( end ) >= 0 ) { fail ( String . format ( DEFAULT_EXCLUSIVE_BETWEEN_EX_MESSAGE , value , start , end ) ) ; } return value ; |
public class ExternalProgramsPanel { /** * Validates the 7Zip settings */
private void validate7ZipSettings ( ) { } } | boolean flag = controller . is7ZipEnabled ( ) ; sevenZipEnableBox . setSelected ( flag ) ; sevenZipLabel . setEnabled ( flag ) ; sevenZipPathField . setEnabled ( flag ) ; sevenZipSearchButton . setEnabled ( flag ) ; |
public class ICUHumanize { /** * Formats a monetary amount with currency plural names , for example ,
* " US dollar " or " US dollars " for America .
* @ param value
* Number to be formatted
* @ return String representing the monetary amount */
public static String formatPluralCurrency ( final Number value ) { ... | DecimalFormat decf = context . get ( ) . getPluralCurrencyFormat ( ) ; return stripZeros ( decf , decf . format ( value ) ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcSurfaceStyleShading ( ) { } } | if ( ifcSurfaceStyleShadingEClass == null ) { ifcSurfaceStyleShadingEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 582 ) ; } return ifcSurfaceStyleShadingEClass ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getIfcHumidifierTypeEnum ( ) { } } | if ( ifcHumidifierTypeEnumEEnum == null ) { ifcHumidifierTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 847 ) ; } return ifcHumidifierTypeEnumEEnum ; |
public class FeatureController { /** * REST endpoint for retrieving all features for a given sprint and team
* ( the sprint is derived )
* @ param teamId
* A given scope - owner ' s source - system ID
* @ return A data response list of type Feature containing all features for
* the given team and current spri... | ObjectId componentId = new ObjectId ( cId ) ; return this . featureService . getStory ( componentId , storyNumber ) ; |
public class DeepWaterModelInfo { /** * Internal helper to create a native backend , and fill its state
* @ param network user - given network topology
* @ param parameters user - given network state ( weights / biases ) */
private void javaToNative ( byte [ ] network , byte [ ] parameters ) { } } | long now = System . currentTimeMillis ( ) ; // existing state is fine
if ( _backend != null // either not overwriting with user - given ( new ) state , or we already are in sync
&& ( network == null || Arrays . equals ( network , _network ) ) && ( parameters == null || Arrays . equals ( parameters , _modelparams ) ) ) ... |
public class ConvertImage { /** * Converts a { @ link Planar } into the equivalent { @ link InterleavedF32}
* @ param input ( Input ) Planar image that is being converted . Not modified .
* @ param output ( Optional ) The output image . If null a new image is created . Modified .
* @ return Converted image . */
p... | if ( output == null ) { output = new InterleavedF32 ( input . width , input . height , input . getNumBands ( ) ) ; } else { output . reshape ( input . width , input . height , input . getNumBands ( ) ) ; } if ( BoofConcurrency . USE_CONCURRENT ) { ImplConvertImage_MT . convertU8F32 ( input , output ) ; } else { ImplCon... |
public class DynamoDBTableMapper { /** * Scans through an Amazon DynamoDB table and returns a single page of
* matching results .
* @ param scanExpression The scan expression .
* @ return The scan results .
* @ see com . amazonaws . services . dynamodbv2 . datamodeling . DynamoDBMapper # scanPage */
public Scan... | return mapper . < T > scanPage ( model . targetType ( ) , scanExpression ) ; |
public class GregorianCalendar { /** * Gets the date of the first week for the specified year .
* @ param year This is year - 1900 as returned by Date . getYear ( )
* @ return */
@ SuppressWarnings ( "deprecation" ) private Date getWeekOne ( int year ) { } } | GregorianCalendar weekOne = new GregorianCalendar ( ) ; weekOne . setFirstDayOfWeek ( getFirstDayOfWeek ( ) ) ; weekOne . setMinimalDaysInFirstWeek ( getMinimalDaysInFirstWeek ( ) ) ; weekOne . setTime ( new Date ( year , 0 , 1 ) ) ; // can we use the week of 1/1 / year as week one ?
int dow = weekOne . get ( DAY_OF_WE... |
public class CommercePriceListUserSegmentEntryRelPersistenceImpl { /** * Returns all the commerce price list user segment entry rels .
* @ return the commerce price list user segment entry rels */
@ Override public List < CommercePriceListUserSegmentEntryRel > findAll ( ) { } } | return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class ResponseGetDownloadAgentStatus { /** * Get the status for the download agent .
* @ return type for the download agent status */
public final TypeDownloadAgentStatus getDownloadAgentStatus ( ) { } } | // Initialization with default status to unknown
TypeDownloadAgentStatus typeStatus = TypeDownloadAgentStatus . UNKNOWN ; // Find the type by the error id
TypeDownloadAgentStatus typeStatusFoundByCode = TypeDownloadAgentStatus . findById ( status ) ; if ( null != typeStatusFoundByCode ) { typeStatus = typeStatusFoundBy... |
public class SecurityDomainJBossASClient { /** * Convenience method that removes a security domain by name . Useful when changing the characteristics of the
* login modules .
* @ param securityDomainName the name of the new security domain
* @ throws Exception if failed to remove the security domain */
public voi... | // If not there just return
if ( ! isSecurityDomain ( securityDomainName ) ) { return ; } final Address addr = Address . root ( ) . add ( SUBSYSTEM , SUBSYSTEM_SECURITY , SECURITY_DOMAIN , securityDomainName ) ; ModelNode removeSecurityDomainNode = createRequest ( REMOVE , addr ) ; final ModelNode results = execute ( r... |
public class PlayRecordContext { /** * Defines a key sequence consisting of a command key optionally followed by zero or more keys . This key sequence has the
* following action : discard any digits collected or recordings in progress and resume digit collection or recording .
* < b > No default . < / b >
* An ap... | String value = Optional . fromNullable ( getParameter ( SignalParameters . REINPUT_KEY . symbol ( ) ) ) . or ( "" ) ; return value . isEmpty ( ) ? ' ' : value . charAt ( 0 ) ; |
public class MapConverter { /** * getDate .
* @ param data a { @ link java . util . Map } object .
* @ param name a { @ link java . lang . String } object .
* @ return a { @ link java . sql . Date } object . */
public java . sql . Date getDate ( Map < String , Object > data , String name ) { } } | return get ( data , name , java . sql . Date . class ) ; |
public class BimServerClient { public SLongCheckinActionState checkinSync ( long poid , String comment , long deserializerOid , boolean merge , long fileSize , String filename , InputStream inputStream ) throws UserException , ServerException { } } | return channel . checkinSync ( baseAddress , token , poid , comment , deserializerOid , merge , fileSize , filename , inputStream ) ; |
public class AsmUtils { /** * Changes the access level for the specified method for a class .
* @ param clazz the clazz
* @ param methodName the method name
* @ param srgName the srg name
* @ param params the params
* @ return the method */
public static Method changeMethodAccess ( Class < ? > clazz , String ... | return changeMethodAccess ( clazz , methodName , srgName , false , new MethodDescriptor ( params ) . getParams ( ) ) ; |
public class ManagedBackupShortTermRetentionPoliciesInner { /** * Updates a managed database ' s short term retention policy .
* @ 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 managedInstan... | return ServiceFuture . fromResponse ( beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , managedInstanceName , databaseName , retentionDays ) , serviceCallback ) ; |
public class ChunkedInputStream { /** * Read the next chunk .
* @ throws IOException If an IO error occurs . */
private void nextChunk ( ) throws IOException { } } | if ( ! this . bof ) { this . readCrlf ( ) ; } this . size = ChunkedInputStream . chunkSize ( this . origin ) ; this . bof = false ; this . pos = 0 ; if ( this . size == 0 ) { this . eof = true ; } |
public class ParserDDL { /** * / adding support for indexed expressions . */
private java . util . List < Expression > XreadExpressions ( java . util . List < Boolean > ascDesc , boolean allowEmpty ) { } } | readThis ( Tokens . OPENBRACKET ) ; java . util . List < Expression > indexExprs = new java . util . ArrayList < > ( ) ; while ( true ) { if ( allowEmpty && readIfThis ( Tokens . CLOSEBRACKET ) ) { // empty bracket
return indexExprs ; } Expression expression = XreadValueExpression ( ) ; indexExprs . add ( expression ) ... |
public class JSONKeystore { /** * Read the instance ' s associated keystore file into memory . */
public void loadStoreFile ( ) { } } | try { BufferedInputStream bis = new BufferedInputStream ( new FileInputStream ( this . storeFile ) ) ; JSONTokener jsonTokener = new JSONTokener ( new InputStreamReader ( bis ) ) ; JSONArray array = new JSONArray ( jsonTokener ) ; bis . close ( ) ; // Init our keys array with the correct size .
this . keys = new Concur... |
public class ObjectManagerState { /** * Create or update a copy of the ObjectManagerState in each ObjectStore .
* The caller must be synchronised on objectStores .
* @ param transaction controlling the update .
* @ throws ObjectManagerException */
protected void saveClonedState ( Transaction transaction ) throws ... | final String methodName = "saveClonedState" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , transaction ) ; // Loop over all of the ObjecStores .
java . util . Iterator objectStoreIterator = objectStores . values ( ) . iterator ( ) ; while ( objectSt... |
public class TransformerImpl { /** * Set the content event handler .
* NEEDSDOC @ param handler
* @ throws java . lang . NullPointerException If the handler
* is null .
* @ see org . xml . sax . XMLReader # setContentHandler */
public void setContentHandler ( ContentHandler handler ) { } } | if ( handler == null ) { throw new NullPointerException ( XSLMessages . createMessage ( XSLTErrorResources . ER_NULL_CONTENT_HANDLER , null ) ) ; // " Null content handler " ) ;
} else { m_outputContentHandler = handler ; if ( null == m_serializationHandler ) { ToXMLSAXHandler h = new ToXMLSAXHandler ( ) ; h . setConte... |
public class TableRef { /** * Creates an instance from a table name
* < p > The table name must have the format [ & LT ; catalog & GT ; . ] [ & LT ; schema & GT ; . ] & LT ; tablename & GT ; .
* if the catalog or schema component is empty , the catalog or schema will be set to
* < code > null < / code > . < / p >... | if ( tableName == null ) { throw new IllegalArgumentException ( "TableName cannot be null." ) ; } String [ ] components = tableName . split ( "\\." ) ; return TableRef . valueOf ( components ) ; |
public class Helper { /** * Determines if the specified ByteBuffer is one which maps to a file ! */
public static boolean isFileMapped ( ByteBuffer bb ) { } } | if ( bb instanceof MappedByteBuffer ) { try { ( ( MappedByteBuffer ) bb ) . isLoaded ( ) ; return true ; } catch ( UnsupportedOperationException ex ) { } } return false ; |
public class ExtensionSpider { /** * Returns the first URI that is out of scope in the given { @ code target } or { @ code contextSpecificObjects } .
* @ param target the target that will be checked
* @ param contextSpecificObjects other { @ code Objects } used to enhance the target
* @ return a { @ code String }... | List < StructuralNode > nodes = target . getStartNodes ( ) ; if ( nodes != null ) { for ( StructuralNode node : nodes ) { if ( node == null ) { continue ; } if ( node instanceof StructuralSiteNode ) { SiteNode siteNode = ( ( StructuralSiteNode ) node ) . getSiteNode ( ) ; if ( ! siteNode . isIncludedInScope ( ) ) { ret... |
public class PDFView { /** * Draw a given PagePart on the canvas */
private void drawPart ( Canvas canvas , PagePart part ) { } } | // Can seem strange , but avoid lot of calls
RectF pageRelativeBounds = part . getPageRelativeBounds ( ) ; Bitmap renderedBitmap = part . getRenderedBitmap ( ) ; // Move to the target page
float localTranslationX = 0 ; float localTranslationY = 0 ; if ( swipeVertical ) localTranslationY = toCurrentScale ( part . getUse... |
import java . util . ArrayList ; class DuplicateList { /** * A Java function to replicate a list from a single list .
* > > > duplicateList ( [ 1 , 2 , 3 ] )
* [ 1 , 2 , 3]
* > > > duplicateList ( [ 4 , 8 , 2 , 10 , 15 , 18 ] )
* [ 4 , 8 , 2 , 10 , 15 , 18]
* > > > duplicateList ( [ 4 , 5 , 6 ] )
* [ 4 , 5 ... | return new ArrayList < > ( inputList ) ; |
public class ReferenceEntityLockService { /** * Extends the expiration time of the lock by some service - defined increment .
* @ param lock IEntityLock
* @ exception LockingException */
@ Override public void renew ( IEntityLock lock , int duration ) throws LockingException { } } | if ( isValid ( lock ) ) { Date newExpiration = getNewExpiration ( duration ) ; getLockStore ( ) . update ( lock , newExpiration ) ; ( ( EntityLockImpl ) lock ) . setExpirationTime ( newExpiration ) ; } else { throw new LockingException ( "Could not renew " + lock + " : lock is invalid." ) ; } |
public class AipOcr { /** * 表格识别结果接口
* 获取表格文字识别结果
* @ param requestId - 发送表格文字识别请求时返回的request id
* @ param options - 可选参数对象 , key : value都为string类型
* options - options列表 :
* result _ type 期望获取结果的类型 , 取值为 “ excel ” 时返回xls文件的地址 , 取值为 “ json ” 时返回json格式的字符串 , 默认为 ” excel ”
* @ return JSONObject */
public JSONO... | AipRequest request = new AipRequest ( ) ; preOperation ( request ) ; request . addBody ( "request_id" , requestId ) ; if ( options != null ) { request . addBody ( options ) ; } request . setUri ( OcrConsts . TABLE_RESULT_GET ) ; postOperation ( request ) ; return requestServer ( request ) ; |
public class CmsResourceManager { /** * Sets the folder , the file and the XSD translator . < p >
* @ param folderTranslator the folder translator to set
* @ param fileTranslator the file translator to set
* @ param xsdTranslator the XSD translator to set */
public void setTranslators ( CmsResourceTranslator fold... | m_folderTranslator = folderTranslator ; m_fileTranslator = fileTranslator ; m_xsdTranslator = xsdTranslator ; |
public class Optionals { /** * Combine an Optional with the provided Iterable ( selecting one element if present ) using the supplied BiFunction
* < pre >
* { @ code
* Optionals . zip ( Optional . of ( 10 ) , Arrays . asList ( 20 ) , this : : add )
* / / Optional [ 30]
* private int add ( int a , int b ) {
... | return narrow ( Option . fromOptional ( f ) . zip ( v , fn ) . toOptional ( ) ) ; |
public class FilesInner { /** * Update a file .
* This method updates an existing file .
* @ param groupName Name of the resource group
* @ param serviceName Name of the service
* @ param projectName Name of the project
* @ param fileName Name of the File
* @ param parameters Information about the file
* ... | return updateWithServiceResponseAsync ( groupName , serviceName , projectName , fileName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class FileSystemGroupStore { /** * Returns all directories under dir . */
private void primGetAllDirectoriesBelow ( File dir , Set allDirectories ) { } } | File [ ] files = dir . listFiles ( fileFilter ) ; for ( int i = 0 ; i < files . length ; i ++ ) { if ( files [ i ] . isDirectory ( ) ) { primGetAllDirectoriesBelow ( files [ i ] , allDirectories ) ; allDirectories . add ( files [ i ] ) ; } } |
public class DefaultSchemaOperations { /** * ( non - Javadoc )
* @ see org . springframework . data . solr . core . schema . SchemaOperations # addField ( org . springframework . data . solr . core . schema . SchemaDefinition . SchemaField ) */
@ Override public void addField ( final SchemaField field ) { } } | if ( field instanceof FieldDefinition ) { addField ( ( FieldDefinition ) field ) ; } else if ( field instanceof CopyFieldDefinition ) { addCopyField ( ( CopyFieldDefinition ) field ) ; } |
public class CancelStepsResult { /** * A list of < a > CancelStepsInfo < / a > , which shows the status of specified cancel requests for each
* < code > StepID < / code > specified .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setCancelStepsInfoList ( j... | if ( this . cancelStepsInfoList == null ) { setCancelStepsInfoList ( new com . amazonaws . internal . SdkInternalList < CancelStepsInfo > ( cancelStepsInfoList . length ) ) ; } for ( CancelStepsInfo ele : cancelStepsInfoList ) { this . cancelStepsInfoList . add ( ele ) ; } return this ; |
public class ContentMatcher { /** * Direct method for a complete ContentMatcher instance creation .
* @ param xmlInputStream the stream of the XML file that need to be used for initialization
* @ return a ContentMatcher instance */
public static ContentMatcher getInstance ( InputStream xmlInputStream ) { } } | ContentMatcher cm = new ContentMatcher ( ) ; // Load the pattern definitions from an XML file
try { cm . loadXMLPatternDefinitions ( xmlInputStream ) ; } catch ( JDOMException | IOException ex ) { throw new IllegalArgumentException ( "Failed to initialize the ContentMatcher object using that stream" , ex ) ; } return c... |
public class UserHandlerImpl { /** * { @ inheritDoc } */
public ListAccess < User > findUsersByQuery ( Query query , UserStatus status ) throws Exception { } } | return query . isEmpty ( ) ? new SimpleJCRUserListAccess ( service , status ) : new UserByQueryJCRUserListAccess ( service , query , status ) ; |
public class GenStrutsApp { /** * Tell whether the struts output file ( struts - config - * . xml ) is out of date , based on the
* file times of the source file and the ( optional ) struts - merge file . */
public boolean isStale ( File mergeFile ) { } } | // We can write to the file if it doesn ' t exist yet .
if ( ! _strutsConfigFile . exists ( ) ) { return true ; } long lastWrite = _strutsConfigFile . lastModified ( ) ; if ( mergeFile != null && mergeFile . exists ( ) && mergeFile . lastModified ( ) > lastWrite ) { return true ; } if ( _sourceFile . lastModified ( ) >... |
public class MCCRGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setStopnum ( Integer newStopnum ) { } } | Integer oldStopnum = stopnum ; stopnum = newStopnum ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . MCCRG__STOPNUM , oldStopnum , stopnum ) ) ; |
public class AbstractBigtableAdmin { /** * { @ inheritDoc } */
@ Override public void deleteTableSnapshots ( String tableNameRegex , String snapshotNameRegex ) throws IOException { } } | deleteTableSnapshots ( Pattern . compile ( tableNameRegex ) , Pattern . compile ( snapshotNameRegex ) ) ; |
public class LolChat { /** * Gets a list of user that you ' ve sent friend requests but haven ' t answered
* yet .
* @ return A list of Friends . */
public List < Friend > getPendingFriendRequests ( ) { } } | return getFriends ( new Filter < Friend > ( ) { public boolean accept ( Friend friend ) { return friend . getFriendStatus ( ) == FriendStatus . ADD_REQUEST_PENDING ; } } ) ; |
public class Type { /** * This is the setter method for instance variable { @ link # mainTable } .
* @ param _ mainTable new value for instance variable { @ link # mainTable }
* @ see # getMainTable
* @ see # mainTable */
private void setMainTable ( final SQLTable _mainTable ) { } } | SQLTable table = _mainTable ; while ( table . getMainTable ( ) != null ) { table = table . getMainTable ( ) ; } this . mainTable = table ; |
public class SftpFsHelper { /** * Create new channel every time a command needs to be executed . This is required to support execution of multiple
* commands in parallel . All created channels are cleaned up when the session is closed .
* @ return a new { @ link ChannelSftp }
* @ throws SftpException */
public Ch... | try { ChannelSftp channelSftp = ( ChannelSftp ) this . session . openChannel ( "sftp" ) ; channelSftp . connect ( ) ; return channelSftp ; } catch ( JSchException e ) { throw new SftpException ( 0 , "Cannot open a channel to SFTP server" , e ) ; } |
public class IMMImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . IMM__MMP_NAME : setMMPName ( ( String ) newValue ) ; return ; case AfplibPackage . IMM__TRIPLETS : getTriplets ( ) . clear ( ) ; getTriplets ( ) . addAll ( ( Collection < ? extends Triplet > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class FactoryPointTracker { /** * TODO remove maxTracks ? Use number of detected instead */
public static < I extends ImageGray < I > > PointTracker < I > dda_FH_SURF_Fast ( ConfigFastHessian configDetector , ConfigSurfDescribe . Speed configDescribe , ConfigAverageIntegral configOrientation , Class < I > imageT... | ScoreAssociation < TupleDesc_F64 > score = FactoryAssociation . scoreEuclidean ( TupleDesc_F64 . class , true ) ; AssociateSurfBasic assoc = new AssociateSurfBasic ( FactoryAssociation . greedy ( score , 5 , true ) ) ; AssociateDescription2D < BrightFeature > generalAssoc = new AssociateDescTo2D < > ( new WrapAssociate... |
public class JavaParser { Rule InterfaceDeclaration ( ) { } } | return Sequence ( INTERFACE , Identifier ( ) , Optional ( TypeParameters ( ) ) , Optional ( EXTENDS , ClassTypeList ( ) ) , InterfaceBody ( ) ) ; |
public class RgbaColor { /** * Returns a triple of hue [ 0-360 ) , saturation [ 0-100 ] , and
* lightness [ 0-100 ] . These are kept as float [ ] so that for any
* RgbaColor color ,
* color . equals ( RgbaColor . fromHsl ( color . convertToHsl ( ) ) ) is true .
* < i > Implementation based on < a
* href = " h... | float H , S , L ; // first normalize [ 0,1]
float R = r / 255f ; float G = g / 255f ; float B = b / 255f ; // compute min and max
float M = max ( R , G , B ) ; float m = min ( R , G , B ) ; L = ( M + m ) / 2f ; if ( M == m ) { // grey
H = S = 0 ; } else { float diff = M - m ; S = ( L < 0.5 ) ? diff / ( 2f * L ) : diff ... |
public class FixedDelayRestartStrategy { /** * Creates a FixedDelayRestartStrategy from the given Configuration .
* @ param configuration Configuration containing the parameter values for the restart strategy
* @ return Initialized instance of FixedDelayRestartStrategy
* @ throws Exception */
public static FixedD... | int maxAttempts = configuration . getInteger ( ConfigConstants . RESTART_STRATEGY_FIXED_DELAY_ATTEMPTS , 1 ) ; String delayString = configuration . getString ( ConfigConstants . RESTART_STRATEGY_FIXED_DELAY_DELAY ) ; long delay ; try { delay = Duration . apply ( delayString ) . toMillis ( ) ; } catch ( NumberFormatExce... |
public class Index { /** * Search for synonyms
* @ param query the query */
public JSONObject searchSynonyms ( SynonymQuery query ) throws AlgoliaException , JSONException { } } | return this . searchSynonyms ( query , RequestOptions . empty ) ; |
public class BaseTransport { /** * Convert this java object to a String .
* @ param obj The java object to convert .
* @ return The object represented as a string . */
public String objectToString ( Object obj ) { } } | String string = BaseTransport . convertObjectToString ( obj ) ; return string ; |
public class RuleUpdate { /** * Set to < code > null < / code > or empty set to remove existing tags . */
public RuleUpdate setTags ( @ Nullable Set < String > tags ) { } } | this . tags = tags ; this . changeTags = true ; return this ; |
public class DataReader { /** * Parse number and some currency data for locale . */
private NumberData parseNumberData ( LocaleID id , String code , JsonObject root ) { } } | NumberData data = getNumberData ( id ) ; JsonObject numbers = resolve ( root , "numbers" ) ; data . minimumGroupingDigits = Integer . valueOf ( string ( numbers , "minimumGroupingDigits" ) ) ; JsonObject symbols = resolve ( numbers , "symbols-numberSystem-latn" ) ; data . decimal = string ( symbols , "decimal" ) ; data... |
public class DecorLayoutInflater { /** * The LayoutInflater onCreateView is the fourth port of call for LayoutInflation .
* BUT only for none CustomViews .
* Basically if this method doesn ' t inflate the View nothing probably will . */
@ Override protected View onCreateView ( String name , AttributeSet attrs ) thr... | // This mimics the { @ code PhoneLayoutInflater } in the way it tries to inflate the base
// classes , if this fails its pretty certain the app will fail at this point .
View view = null ; for ( String prefix : CLASS_PREFIX_LIST ) { try { view = createView ( name , prefix , attrs ) ; } catch ( ClassNotFoundException ig... |
public class DirectoryHelper { /** * Returns the files list of whole directory including its sub directories .
* @ param srcPath
* source path
* @ return List
* @ throws IOException
* if any exception occurred */
public static List < File > listFiles ( File srcPath ) throws IOException { } } | List < File > result = new ArrayList < File > ( ) ; if ( ! srcPath . isDirectory ( ) ) { throw new IOException ( srcPath . getAbsolutePath ( ) + " is a directory" ) ; } for ( File subFile : srcPath . listFiles ( ) ) { result . add ( subFile ) ; if ( subFile . isDirectory ( ) ) { result . addAll ( listFiles ( subFile ) ... |
public class ServerConfiguration { /** * Calls modify ( ) on elements in the configuration that implement the ModifiableConfigElement interface .
* @ throws Exception when the update fails */
public void updateDatabaseArtifacts ( ) throws Exception { } } | List < ModifiableConfigElement > mofiableElementList = new ArrayList < ModifiableConfigElement > ( ) ; findModifiableConfigElements ( this , mofiableElementList ) ; for ( ModifiableConfigElement element : mofiableElementList ) { element . modify ( this ) ; } |
public class JMXQuery { protected Status report ( final Exception ex , final PrintStream out ) { } } | if ( ex instanceof ParseError ) { out . print ( UNKNOWN_STRING + " " ) ; reportException ( ex , out ) ; out . println ( " Usage: check_jmx -help " ) ; return Status . UNKNOWN ; } else { out . print ( CRITICAL_STRING + " " ) ; reportException ( ex , out ) ; out . println ( ) ; return Status . CRITICAL ; } |
public class vpnglobal_authenticationcertpolicy_binding { /** * Use this API to fetch a vpnglobal _ authenticationcertpolicy _ binding resources . */
public static vpnglobal_authenticationcertpolicy_binding [ ] get ( nitro_service service ) throws Exception { } } | vpnglobal_authenticationcertpolicy_binding obj = new vpnglobal_authenticationcertpolicy_binding ( ) ; vpnglobal_authenticationcertpolicy_binding response [ ] = ( vpnglobal_authenticationcertpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class BotAliasMetadataMarshaller { /** * Marshall the given parameter object . */
public void marshall ( BotAliasMetadata botAliasMetadata , ProtocolMarshaller protocolMarshaller ) { } } | if ( botAliasMetadata == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( botAliasMetadata . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( botAliasMetadata . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . m... |
public class Nodes { /** * Obtains an element ' s attributes as Map . */
public static Map < QName , String > getAttributes ( Node n ) { } } | Map < QName , String > map = new LinkedHashMap < QName , String > ( ) ; NamedNodeMap m = n . getAttributes ( ) ; if ( m != null ) { final int len = m . getLength ( ) ; for ( int i = 0 ; i < len ; i ++ ) { Attr a = ( Attr ) m . item ( i ) ; map . put ( getQName ( a ) , a . getValue ( ) ) ; } } return map ; |
public class TupleComparator { @ Override public int hash ( T value ) { } } | int i = 0 ; try { int code = this . comparators [ 0 ] . hash ( value . getField ( keyPositions [ 0 ] ) ) ; for ( i = 1 ; i < this . keyPositions . length ; i ++ ) { code *= HASH_SALT [ i & 0x1F ] ; // salt code with ( i % HASH _ SALT . length ) - th salt component
code += this . comparators [ i ] . hash ( value . getFi... |
public class DefaultCacheableResourceService { /** * Copy the resource to the system ' s temporary resources .
* @ param resource { @ link File } , the resource to copy from
* @ param resourceLocation { @ link String } , the resource location
* @ return the resource copy { @ link File } ready for processing
* @... | final String tmpPath = asPath ( getSystemConfiguration ( ) . getCacheDirectory ( ) . getAbsolutePath ( ) , ResourceType . TMP_FILE . getResourceFolderName ( ) ) ; final String uuidDirName = UUID . randomUUID ( ) . toString ( ) ; // load copy file and create parent directories
final File copyFile = new File ( asPath ( t... |
public class ClassGenericsUtil { /** * Instantiate the first available implementation of an interface .
* Only supports public and parameterless constructors .
* @ param clz Class to instantiate .
* @ return Instance */
public static < T > T instantiateLowlevel ( Class < ? extends T > clz ) { } } | Exception last = null ; for ( Class < ? > c : ELKIServiceRegistry . findAllImplementations ( clz ) ) { try { return clz . cast ( c . newInstance ( ) ) ; } catch ( Exception e ) { last = e ; } } throw new AbortException ( "Cannot find a usable implementation of " + clz . toString ( ) , last ) ; |
public class MDMoleculeConvention { /** * Add parsing of elements in mdmolecule :
* mdmolecule
* chargeGroup
* id
* cgNumber
* atomArray
* switchingAtom
* residue
* id
* title
* resNumber
* atomArray
* @ cdk . todo The JavaDoc of this class needs to be converted into HTML */
@ Override public vo... | // < molecule convention = " md : mdMolecule "
// xmlns = " http : / / www . xml - cml . org / schema "
// xmlns : md = " http : / / www . bioclipse . org / mdmolecule " >
// < atomArray >
// < atom id = " a1 " elementType = " C " / >
// < atom id = " a2 " elementType = " C " / >
// < / atomArray >
// < molecule dictRe... |
public class JmsDestinationImpl { /** * This method returns the " List containing SIDestinationAddress " form of the
* forward routing path that will be set into the message .
* Note that this takes the ' big ' destination as being the end of the forward
* routing path . */
protected List getConvertedFRP ( ) { } ... | List theList = null ; StringArrayWrapper saw = ( StringArrayWrapper ) properties . get ( FORWARD_ROUTING_PATH ) ; if ( saw != null ) { // This list is the forward routing path for the message .
theList = saw . getMsgForwardRoutingPath ( ) ; } return theList ; |
public class IPv4Framer { /** * { @ inheritDoc } */
@ Override public IPv4Packet frame ( final Packet parent , final Buffer payload ) throws IOException { } } | if ( parent == null ) { throw new IllegalArgumentException ( "The parent frame cannot be null" ) ; } // the ipv4 headers are always 20 bytes unless
// the length is greater than 5
final Buffer headers = payload . readBytes ( 20 ) ; // byte 1 , contains the version and the length
final byte b = headers . getByte ( 0 ) ;... |
public class AnnotationAwareRetryOperationsInterceptor { /** * Resolve the specified value if possible .
* @ see ConfigurableBeanFactory # resolveEmbeddedValue */
private String resolve ( String value ) { } } | if ( this . beanFactory != null && this . beanFactory instanceof ConfigurableBeanFactory ) { return ( ( ConfigurableBeanFactory ) this . beanFactory ) . resolveEmbeddedValue ( value ) ; } return value ; |
public class MatrixVectorReader { /** * Reads a double */
private double getDouble ( ) throws IOException { } } | st . nextToken ( ) ; if ( st . ttype == StreamTokenizer . TT_WORD ) return Double . parseDouble ( st . sval ) ; else if ( st . ttype == StreamTokenizer . TT_EOF ) throw new EOFException ( "End-of-File encountered during parsing" ) ; else throw new IOException ( "Unknown token found during parsing" ) ; |
public class Transaction { /** * Returns the confidence object for this transaction from the { @ link TxConfidenceTable } */
public TransactionConfidence getConfidence ( TxConfidenceTable table ) { } } | if ( confidence == null ) confidence = table . getOrCreate ( getTxId ( ) ) ; return confidence ; |
public class IOGroovyMethods { /** * Creates a reader for this input stream , using the specified
* charset as the encoding .
* @ param self an input stream
* @ param charset the charset for this input stream
* @ return a reader
* @ throws UnsupportedEncodingException if the encoding specified is not supporte... | return new BufferedReader ( new InputStreamReader ( self , charset ) ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.