signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class StorePackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getCheckoutResult ( ) { } } | if ( checkoutResultEClass == null ) { checkoutResultEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( StorePackage . eNS_URI ) . getEClassifiers ( ) . get ( 18 ) ; } return checkoutResultEClass ; |
public class SerializationServiceImpl { /** * Attempts to resolve a class from registered class providers .
* @ param name the class name
* @ return the class , or null if not found
* @ throws ClassNotFoundException if a class provider claimed to provide a
* class or package , but its bundle did not contain the... | // First , try to find the class by name .
ServiceReference < DeserializationClassProvider > provider = classProviders . getReference ( name ) ; if ( provider != null ) { return loadClass ( provider , name ) ; } // Next , try to find the class by package .
int index = name . lastIndexOf ( '.' ) ; if ( index != - 1 ) { ... |
public class SubscriptionSchedule { /** * Retrieves the list of subscription schedule revisions for a subscription schedule . */
public SubscriptionScheduleRevisionCollection revisions ( ) throws StripeException { } } | return revisions ( ( Map < String , Object > ) null , ( RequestOptions ) null ) ; |
public class Equation { /** * Parses a code block with no parentheses and no commas . After it is done there should be a single token left ,
* which is returned . */
protected TokenList . Token parseBlockNoParentheses ( TokenList tokens , Sequence sequence , boolean insideMatrixConstructor ) { } } | // search for matrix bracket operations
if ( ! insideMatrixConstructor ) { parseBracketCreateMatrix ( tokens , sequence ) ; } // First create sequences from anything involving a colon
parseSequencesWithColons ( tokens , sequence ) ; // process operators depending on their priority
parseNegOp ( tokens , sequence ) ; par... |
public class LangProfile { /** * Add n - gram to profile
* @ param gram */
public void add ( @ NotNull String gram ) { } } | if ( name == null ) throw new IllegalStateException ( ) ; int len = gram . length ( ) ; if ( len < 1 || len > NGram . N_GRAM ) { throw new IllegalArgumentException ( "ngram length must be 1-3 but was " + len + ": >>>" + gram + "<<<!" ) ; } nWords [ len - 1 ] ++ ; if ( freq . containsKey ( gram ) ) { freq . put ( gram ,... |
public class PriceListEntryUrl { /** * Get Resource Url for DeletePriceListEntry
* @ param currencyCode The three character ISOÂ currency code , such as USDÂ for US Dollars .
* @ param priceListCode The code of the specified price list associated with the price list entry .
* @ param productCode The unique , us... | UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/pricelists/{priceListCode}/entries/{productCode}/{currencyCode}?startDate={startDate}" ) ; formatter . formatUrl ( "currencyCode" , currencyCode ) ; formatter . formatUrl ( "priceListCode" , priceListCode ) ; formatter . formatUrl ( "productCode" ... |
public class RESTRequest { /** * zero - length byte [ ] is returned . The message is * not * decompressed . */
private byte [ ] readRequestBody ( ) { } } | int bytesLeft = m_request . getContentLength ( ) ; if ( bytesLeft <= 0 ) { return new byte [ 0 ] ; } int totalBytesRead = 0 ; try { byte [ ] byteBuffer = new byte [ bytesLeft ] ; try ( InputStream inputStream = m_request . getInputStream ( ) ) { int bytesRead = - 1 ; int offset = 0 ; while ( ( bytesRead = inputStream .... |
public class BaseRedisDLockFactory { /** * { @ inheritDoc }
* @ since 0.1.1.2 */
@ Override public BaseRedisDLockFactory init ( ) { } } | if ( jedisConnector == null ) { jedisConnector = buildJedisConnector ( ) ; myOwnRedis = jedisConnector != null ; } return this ; |
public class Matth { /** * Returns { @ code n ! } , that is , the product of the first { @ code n } positive integers , or { @ code 1}
* if { @ code n = = 0 } .
* < p > < b > Warning : < / b > the result takes < i > O ( n log n ) < / i > space , so use cautiously .
* < p > This uses an efficient binary recursive ... | checkNonNegative ( "n" , n ) ; // If the factorial is small enough , just use LongMath to do it .
if ( n < long_factorials . length ) { return BigInteger . valueOf ( long_factorials [ n ] ) ; } // Pre - allocate space for our list of intermediate BigIntegers .
int approxSize = divide ( n * log2 ( n , CEILING ) , Long .... |
public class CmsModule { /** * Calculates the resources belonging to the module , taking excluded resources and readability of resources into account ,
* and returns site paths of the module resources . < p >
* For more details of the returned resource , see { @ link # calculateModuleResources ( CmsObject , CmsModu... | // adjust the site root , if necessary
CmsObject cmsClone = adjustSiteRootIfNecessary ( cms , module ) ; // calculate the module resources
List < CmsResource > moduleResources = calculateModuleResources ( cmsClone , module ) ; // get the site paths
List < String > moduleResouceNames = new ArrayList < String > ( moduleR... |
public class HashList { /** * Replaces the element at the specified position in this list with
* the specified element .
* @ param index index of element to replace .
* @ param element element to be stored at the specified position .
* @ return the element previously at the specified position .
* @ throws Ind... | if ( element != null && ! contains ( element ) ) { return super . set ( index , element ) ; } return get ( index ) ; |
public class PdfContentByte { /** * Implements a link to other part of the document . The jump will
* be made to a local destination with the same name , that must exist .
* @ param name the name for this link
* @ param llx the lower left x corner of the activation area
* @ param lly the lower left y corner of ... | pdf . localGoto ( name , llx , lly , urx , ury ) ; |
public class AnyValueMap { /** * Converts map element into an AnyValueArray or returns default value if
* conversion is not possible .
* @ param key a key of element to get .
* @ param defaultValue the default value
* @ return AnyValueArray value of the element or default value if conversion is
* not supporte... | AnyValueArray result = getAsNullableArray ( key ) ; return result != null ? result : defaultValue ; |
public class TextBuffer { /** * Method called to indicate that the underlying buffers should now
* be recycled if they haven ' t yet been recycled . Although caller
* can still use this text buffer , it is not advisable to call this
* method if that is likely , since next time a buffer is needed ,
* buffers nee... | if ( mConfig != null && mCurrentSegment != null ) { if ( force ) { /* If we are allowed to wipe out all existing data , it ' s
* quite easy ; we ' ll just wipe out contents , and return
* biggest buffer : */
resetWithEmpty ( ) ; } else { /* But if there ' s non - shared data ( ie . buffer is still
* in use ) , ca... |
public class DiameterStackMultiplexer { /** * ( non - Javadoc )
* @ see org . mobicents . diameter . stack . DiameterStackMultiplexerMBean # _ LocalPeer _ setRealm ( java . lang . String ) */
@ Override public void _LocalPeer_setRealm ( String realm ) throws MBeanException { } } | getMutableConfiguration ( ) . setStringValue ( OwnRealm . ordinal ( ) , realm ) ; if ( logger . isInfoEnabled ( ) ) { logger . info ( "Local Peer Realm successfully changed to '" + realm + "'. Restart to Diameter stack is needed to apply changes." ) ; } |
public class CmsModelPageHelper { /** * Sets the default model page within the given configuration file . < p >
* @ param configFile the configuration file
* @ param modelId the default model id
* @ return the updated model configuration
* @ throws CmsException in case something goes wrong */
CmsModelInfo setDe... | CmsFile file = m_cms . readFile ( configFile ) ; CmsXmlContent content = CmsXmlContentFactory . unmarshal ( m_cms , file ) ; Locale locale = getLocale ( content ) ; int defaultValueIndex = - 1 ; String defaultModelTarget = null ; for ( I_CmsXmlContentValue value : content . getValues ( CmsConfigurationReader . N_MODEL_... |
public class RESTClient { /** * Creates MultipartBody . It contains 3 parts , " book1 " , " book2 " and " image " .
* These individual parts have their Content - Type set to application / xml ,
* application / json and application / octet - stream
* MultipartBody will use the Content - Type value of the individua... | List < Attachment > atts = new LinkedList < Attachment > ( ) ; atts . add ( new Attachment ( "book1" , "application/xml" , new Book ( "JAXB" , 1L ) ) ) ; atts . add ( new Attachment ( "book2" , "application/json" , new Book ( "JSON" , 2L ) ) ) ; atts . add ( new Attachment ( "image" , "application/octet-stream" , getCl... |
public class JMJson { /** * Transform t 2.
* @ param < T1 > the type parameter
* @ param < T2 > the type parameter
* @ param object the object
* @ param typeReference the type reference
* @ return the t 2 */
public static < T1 , T2 > T2 transform ( T1 object , TypeReference < T2 > typeReference ) { } } | try { return jsonMapper . convertValue ( object , typeReference ) ; } catch ( Exception e ) { return JMExceptionManager . handleExceptionAndReturnNull ( log , e , "transform" , object ) ; } |
public class ClassChannel { /** * Returns < code > true < / code > if the < code > value < / code >
* is the same class or a base class of this channel ' s class .
* @ see org . jgrapes . core . Eligible # isEligibleFor ( java . lang . Object ) */
@ Override public boolean isEligibleFor ( Object value ) { } } | return Class . class . isInstance ( value ) && ( ( Class < ? > ) value ) . isAssignableFrom ( ( Class < ? > ) defaultCriterion ( ) ) ; |
public class KeyChainGroup { /** * Returns whether this chain has only watching keys ( unencrypted keys with no private part ) . Mixed chains are
* forbidden .
* @ throws IllegalStateException if there are no keys , or if there is a mix between watching and non - watching keys . */
public boolean isWatching ( ) { }... | BasicKeyChain . State basicState = basic . isWatching ( ) ; BasicKeyChain . State activeState = BasicKeyChain . State . EMPTY ; if ( chains != null && ! chains . isEmpty ( ) ) { if ( getActiveKeyChain ( ) . isWatching ( ) ) activeState = BasicKeyChain . State . WATCHING ; else activeState = BasicKeyChain . State . REGU... |
public class RegularPolygon { /** * Determines the properties of the underlying circle and the point coordinates . */
protected void determineCoordinates ( ) { } } | for ( int i = 0 ; i < numPoints ; i ++ ) { coordinates . set ( i , getPointCoordinate ( i ) ) ; } |
public class CompletableFuture { /** * Returns raw result after waiting , or null if interruptible and interrupted . */
private Object waitingGet ( boolean interruptible ) { } } | Signaller q = null ; boolean queued = false ; Object r ; while ( ( r = result ) == null ) { if ( q == null ) { q = new Signaller ( interruptible , 0L , 0L ) ; if ( Thread . currentThread ( ) instanceof ForkJoinWorkerThread ) ForkJoinPool . helpAsyncBlocker ( defaultExecutor ( ) , q ) ; } else if ( ! queued ) queued = t... |
public class PluginGroup { /** * Returns a new { @ link PluginGroup } which holds the { @ link Plugin } s loaded from the classpath .
* { @ code null } is returned if there is no { @ link Plugin } whose target equals to the specified
* { @ code target } .
* @ param classLoader which is used to load the { @ link P... | requireNonNull ( classLoader , "classLoader" ) ; requireNonNull ( target , "target" ) ; requireNonNull ( config , "config" ) ; final ServiceLoader < Plugin > loader = ServiceLoader . load ( Plugin . class , classLoader ) ; final Builder < Plugin > plugins = new Builder < > ( ) ; for ( Plugin plugin : loader ) { if ( ta... |
public class Bag { /** * Check if bag contains this element . The operator = = is used to check for equality . */
public boolean contains ( E e ) { } } | for ( int i = 0 ; size > i ; i ++ ) { if ( e == data [ i ] ) { return true ; } } return false ; |
public class ChunkFrequencyManager { /** * Query values for the given region and file . Values are grouped according to the windowSize , and then a mean
* value is computed .
* @ param region Region target
* @ param filePath File target
* @ param windowSize Group size of values , the mean is computed for those ... | return query ( region , filePath , windowSize , mean ( ) ) ; |
public class Legend { /** * 设置默认选中状态
* @ param name
* @ param selected
* @ return */
public Legend selected ( String name , Boolean selected ) { } } | if ( ! this . data . contains ( name ) ) { throw new RuntimeException ( "Legend中不包含name为" + name + "的图例" ) ; } if ( this . selected == null ) { this . selected = new LinkedHashMap < String , Boolean > ( ) ; } this . selected . put ( name , selected ) ; return this ; |
public class ModifierUtil { /** * 多个修饰符做 “ 与 ” 操作 , 表示同时存在多个修饰符
* @ param modifierTypes 修饰符列表 , 元素不能为空
* @ return “ 与 ” 之后的修饰符 */
private static int modifiersToInt ( ModifierType ... modifierTypes ) { } } | int modifier = modifierTypes [ 0 ] . getValue ( ) ; for ( int i = 1 ; i < modifierTypes . length ; i ++ ) { modifier &= modifierTypes [ i ] . getValue ( ) ; } return modifier ; |
public class TeaServletAdmin { /** * returns a socket connected to a host running the TemplateServerServlet */
private HttpClient getTemplateServerClient ( String remoteSource ) throws IOException { } } | // TODO : this was copied from the RemoteCompiler class . This needs
// to be moved into a location where both can access it !
int port = 80 ; String host = remoteSource . substring ( RemoteCompilationProvider . TEMPLATE_LOAD_PROTOCOL . length ( ) ) ; int portIndex = host . indexOf ( "/" ) ; if ( portIndex >= 0 ) { hos... |
public class Result { /** * The projecting result value for the given key as a Number object
* Returns null if the key doesn ' t exist .
* @ param key The select result key .
* @ return The Number object . */
@ Override public Number getNumber ( @ NonNull String key ) { } } | if ( key == null ) { throw new IllegalArgumentException ( "key cannot be null." ) ; } final int index = indexForColumnName ( key ) ; return index >= 0 ? getNumber ( index ) : null ; |
public class ModMessageManager { /** * Registers an object to handle mod messages .
* @ param mod the mod
* @ param messageHandler the message handler */
public static void register ( IMalisisMod mod , Object messageHandler ) { } } | register ( mod , messageHandler . getClass ( ) , messageHandler ) ; |
public class TypeRegistry { /** * For a specific classname , this method will search in the current type registry and any parent type registries
* ( similar to a regular classloader delegation strategy ) . Returns null if the type is not found . It does not
* attempt to load anything in .
* @ param classname the ... | ReloadableType rtype = getReloadableType ( classname , false ) ; if ( rtype == null ) { // search
TypeRegistry tr = this ; while ( rtype == null ) { ClassLoader pcl = tr . getClassLoader ( ) . getParent ( ) ; tr = TypeRegistry . getTypeRegistryFor ( pcl ) ; if ( tr != null ) { rtype = tr . getReloadableType ( classname... |
public class Utils { /** * Selects the appropriate interface to use Multicast .
* This prevents computers with multiple interfaces to select the wrong one by default .
* @ param socket the socket on which we want to bind the specific interface .
* @ throws SocketException if something bad happens */
public static... | Enumeration e = NetworkInterface . getNetworkInterfaces ( ) ; while ( e . hasMoreElements ( ) ) { NetworkInterface n = ( NetworkInterface ) e . nextElement ( ) ; Enumeration ee = n . getInetAddresses ( ) ; while ( ee . hasMoreElements ( ) ) { InetAddress i = ( InetAddress ) ee . nextElement ( ) ; if ( i . isSiteLocalAd... |
public class DefaultProcessDiagramCanvas { /** * This method calculates shape intersection with line .
* @ param shape
* @ param line
* @ return Intersection point */
private static Point getShapeIntersection ( Shape shape , Line2D . Double line ) { } } | PathIterator it = shape . getPathIterator ( null ) ; double [ ] coords = new double [ 6 ] ; double [ ] pos = new double [ 2 ] ; Line2D . Double l = new Line2D . Double ( ) ; while ( ! it . isDone ( ) ) { int type = it . currentSegment ( coords ) ; switch ( type ) { case PathIterator . SEG_MOVETO : pos [ 0 ] = coords [ ... |
public class QueryBuilder { /** * Add the provided { @ link FeatureCode } s to the set of query constraints .
* @ param code1 the first { @ link FeatureCode } to add
* @ param codes the subsequent { @ link FeatureCode } s to add
* @ return this */
public QueryBuilder addFeatureCodes ( final FeatureCode code1 , fi... | featureCodes . add ( code1 ) ; featureCodes . addAll ( Arrays . asList ( codes ) ) ; return this ; |
public class ValidationGroupsMetadata { /** * Finds all of the validation groups extended by an intial set of groups .
* @ param baseGroups The initial set of groups to find parents of . These groups must have been
* added to the inheritance map already .
* @ return A unified set of groups and their parents .
*... | final Set < Class < ? > > found = new HashSet < > ( ) ; final Stack < Class < ? > > remaining = new Stack < > ( ) ; // initialize
baseGroups . forEach ( group -> { if ( ! inheritanceMapping . containsKey ( group ) ) { throw new IllegalArgumentException ( "The collection of groups contains a group which" + " was not add... |
public class SqlQueryStatement { /** * Answer the TableAlias for aPath or aUserAlias
* @ param aPath
* @ param aUserAlias
* @ param hintClasses
* @ return TableAlias , null if none */
private TableAlias getTableAliasForPath ( String aPath , String aUserAlias , List hintClasses ) { } } | if ( aUserAlias == null ) { return getTableAliasForPath ( aPath , hintClasses ) ; } else { return getTableAliasForPath ( aUserAlias + ALIAS_SEPARATOR + aPath , hintClasses ) ; } |
public class MouseHandler { /** * { @ inheritDoc } */
@ Override public void handle ( final MouseEvent mouseEvent ) { } } | final EventType < ? > type = mouseEvent . getEventType ( ) ; if ( MouseEvent . DRAG_DETECTED == type ) { adapter ( ) . mouseDragDetected ( mouseEvent ) ; } else if ( MouseEvent . MOUSE_CLICKED == type ) { adapter ( ) . mouseClicked ( mouseEvent ) ; } else if ( MouseEvent . MOUSE_DRAGGED == type ) { adapter ( ) . mouseD... |
public class gslbsite_gslbservice_binding { /** * Use this API to count the filtered set of gslbsite _ gslbservice _ binding resources .
* filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */
public static long count_filtered ( nitro_service service , String sitename , String filter )... | gslbsite_gslbservice_binding obj = new gslbsite_gslbservice_binding ( ) ; obj . set_sitename ( sitename ) ; options option = new options ( ) ; option . set_count ( true ) ; option . set_filter ( filter ) ; gslbsite_gslbservice_binding [ ] response = ( gslbsite_gslbservice_binding [ ] ) obj . getfiltered ( service , opt... |
public class SeaGlassLookAndFeel { /** * Set the icons to paint the title pane decorations .
* @ param d the UI defaults map . */
private void defineInternalFrames ( UIDefaults d ) { } } | // Copied from nimbus
// Initialize InternalFrameTitlePane
d . put ( "InternalFrameTitlePane.contentMargins" , new InsetsUIResource ( 0 , 0 , 0 , 0 ) ) ; d . put ( "InternalFrameTitlePane.maxFrameIconSize" , new DimensionUIResource ( 18 , 18 ) ) ; // Initialize InternalFrame
d . put ( "InternalFrame.contentMargins" , n... |
public class BeanManager { /** * Determines if a { @ link android . bluetooth . BluetoothDevice } is a Bean based on its scan record
* value .
* @ param scanRecord The scanRecord provided by
* { @ link android . bluetooth . BluetoothAdapter . LeScanCallback }
* @ return true if device is a Bean */
private boole... | List < UUID > uuids = parseUUIDs ( scanRecord ) ; return uuids . contains ( BEAN_UUID ) ; |
public class Strman { /** * Counts the number of occurrences of each character in the string
* @ param input The input string
* @ return A map containing the number of occurrences of each character in the string */
public static Map < Character , Long > charsCount ( String input ) { } } | if ( isNullOrEmpty ( input ) ) { return Collections . emptyMap ( ) ; } return input . chars ( ) . mapToObj ( c -> ( char ) c ) . collect ( groupingBy ( identity ( ) , counting ( ) ) ) ; |
public class ClassUtil { /** * @ param clazz a Class .
* @ return the class ' s primitive equivalent , if clazz is a primitive wrapper . If clazz is
* primitive , returns clazz . Otherwise , returns null . */
public static Class < ? > primitiveEquivalentOf ( Class < ? > clazz ) { } } | return clazz . isPrimitive ( ) ? clazz : _objectToPrimitiveMap . get ( clazz ) ; |
public class PhoneNumberUtil { /** * format phone number in E123 format .
* @ param pphoneNumber phone number as String to format
* @ param pcountryCode iso code of country
* @ return formated phone number as String */
public final String formatE123 ( final String pphoneNumber , final String pcountryCode ) { } } | return this . formatE123 ( this . parsePhoneNumber ( pphoneNumber ) , CreatePhoneCountryConstantsClass . create ( ) . countryMap ( ) . get ( StringUtils . defaultString ( pcountryCode ) ) ) ; |
public class PathUtils { /** * This method converts a Class into a File which contains the package path .
* This is used to access Jar contents or the content of source directories
* to find source or class files .
* @ param clazz
* is the class for which the source file is to be found .
* @ return A { @ link... | if ( File . separator . equals ( "/" ) ) { return new File ( clazz . getName ( ) . replaceAll ( "\\." , File . separator ) + ".java" ) ; } else { return new File ( clazz . getName ( ) . replaceAll ( "\\." , File . separator + File . separator ) + ".java" ) ; } |
public class DelimitedStringParser { /** * Creates a new DelimitedStringParser with the given Pair and KeyValue delimiters .
* @ param pairDelimiter A String that will be used to delimit pairs .
* @ param keyValueDelimiter A String that will be used to delimit Keys from Values ( inside a pair ) .
* @ return A new... | Exceptions . checkNotNullOrEmpty ( pairDelimiter , "pairDelimiter" ) ; Exceptions . checkNotNullOrEmpty ( keyValueDelimiter , "keyValueDelimiter" ) ; Preconditions . checkArgument ( ! pairDelimiter . equals ( keyValueDelimiter ) , "pairDelimiter (%s) cannot be the same as keyValueDelimiter (%s)" , pairDelimiter , keyVa... |
public class JCacheSessionDataStorage { /** * Create a cache with name and expiry policy with idle time .
* @ param name name of cache
* @ param idleTime idle time in seconds
* @ return the cache with name and expiry policy with idle time */
protected Cache < String , SessionData > create ( String name , long idl... | return Caching . getCachingProvider ( ) . getCacheManager ( ) . createCache ( name , new MutableConfiguration < String , SessionData > ( ) . setTypes ( String . class , SessionData . class ) . setExpiryPolicyFactory ( TouchedExpiryPolicy . factoryOf ( new Duration ( TimeUnit . SECONDS , idleTime ) ) ) ) ; |
public class BaseFlowToJobSpecCompiler { /** * Naive implementation of generating jobSpec , which fetch the first available template ,
* in an exemplified single - hop FlowCompiler implementation .
* @ param flowSpec
* @ return */
protected JobSpec jobSpecGenerator ( FlowSpec flowSpec ) { } } | JobSpec jobSpec ; JobSpec . Builder jobSpecBuilder = JobSpec . builder ( jobSpecURIGenerator ( flowSpec ) ) . withConfig ( flowSpec . getConfig ( ) ) . withDescription ( flowSpec . getDescription ( ) ) . withVersion ( flowSpec . getVersion ( ) ) ; if ( flowSpec . getTemplateURIs ( ) . isPresent ( ) && templateCatalog .... |
public class StompEndpointSample { /** * Broadcast message by returning a { @ code String } .
* @ param body the message body
* @ return the message to send by the broadcaster associated to the path specified in frame headers
* @ throws IOException if body can ' t be read */
@ StompService ( destination = "/desti... | final String now = new SimpleDateFormat ( "HH:mm:ss" ) . format ( new Date ( ) ) ; return String . format ( "%s - value '%s' returned from method mapped to /destination-2" , now , body ) ; |
public class Group { /** * For the given group name , return the module list , on which it is mapped .
* Create a new list , if not found .
* @ param map Map to be searched for group name .
* @ param groupname Group name to search . */
SortedSet < ModuleElement > getModuleList ( Map < String , SortedSet < ModuleE... | return map . computeIfAbsent ( groupname , g -> new TreeSet < > ( configuration . utils . makeModuleComparator ( ) ) ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcPipeSegmentType ( ) { } } | if ( ifcPipeSegmentTypeEClass == null ) { ifcPipeSegmentTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 356 ) ; } return ifcPipeSegmentTypeEClass ; |
public class MapTileCollisionLoader { /** * Check the constraint with the specified tile .
* @ param constraints The constraint groups to check .
* @ param tile The tile to check with .
* @ return < code > true < / code > if can be ignored , < code > false < / code > else . */
private boolean checkConstraint ( Co... | return tile != null && constraints . contains ( mapGroup . getGroup ( tile ) ) && ! tile . getFeature ( TileCollision . class ) . getCollisionFormulas ( ) . isEmpty ( ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link MultiCurvePropertyType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link MultiCurvePropertyType } ... | return new JAXBElement < MultiCurvePropertyType > ( _MultiEdgeOf_QNAME , MultiCurvePropertyType . class , null , value ) ; |
public class NaiveBayesModelV3 { /** * Version & Schema - specific filling into the impl */
@ Override public NaiveBayesModel createImpl ( ) { } } | NaiveBayesModel . NaiveBayesParameters parms = parameters . createImpl ( ) ; return new NaiveBayesModel ( model_id . key ( ) , parms , null ) ; |
public class AnalyticsContext { /** * Create a new { @ link AnalyticsContext } instance filled in with information from the given { @ link
* Context } . The { @ link Analytics } client can be called from anywhere , so the returned instances
* is thread safe . */
static synchronized AnalyticsContext create ( Context... | AnalyticsContext analyticsContext = new AnalyticsContext ( new NullableConcurrentHashMap < String , Object > ( ) ) ; analyticsContext . putApp ( context ) ; analyticsContext . setTraits ( traits ) ; analyticsContext . putDevice ( context , collectDeviceId ) ; analyticsContext . putLibrary ( ) ; analyticsContext . put (... |
public class SortCriterionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SortCriterion sortCriterion , ProtocolMarshaller protocolMarshaller ) { } } | if ( sortCriterion == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sortCriterion . getField ( ) , FIELD_BINDING ) ; protocolMarshaller . marshall ( sortCriterion . getSortOrder ( ) , SORTORDER_BINDING ) ; } catch ( Exception e ) { throw n... |
public class Task { /** * The Total Slack field contains the amount of time a task can be
* delayed without delaying the project ' s finish date .
* @ return string representing duration */
public Duration getTotalSlack ( ) { } } | Duration totalSlack = ( Duration ) getCachedValue ( TaskField . TOTAL_SLACK ) ; if ( totalSlack == null ) { Duration duration = getDuration ( ) ; if ( duration == null ) { duration = Duration . getInstance ( 0 , TimeUnit . DAYS ) ; } TimeUnit units = duration . getUnits ( ) ; Duration startSlack = getStartSlack ( ) ; i... |
public class AzureFirewallsInner { /** * Creates or updates the specified Azure Firewall .
* @ param resourceGroupName The name of the resource group .
* @ param azureFirewallName The name of the Azure Firewall .
* @ param parameters Parameters supplied to the create or update Azure Firewall operation .
* @ thr... | return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , azureFirewallName , parameters ) . map ( new Func1 < ServiceResponse < AzureFirewallInner > , AzureFirewallInner > ( ) { @ Override public AzureFirewallInner call ( ServiceResponse < AzureFirewallInner > response ) { return response . body ( ) ; }... |
public class CmsConfigurationCache { /** * Reads the complete configuration ( sitemap and module configurations ) . < p >
* @ return an object representing the currently active configuration */
public CmsADEConfigCacheState readCompleteConfiguration ( ) { } } | long beginTime = System . currentTimeMillis ( ) ; Map < CmsUUID , CmsADEConfigDataInternal > siteConfigurations = Maps . newHashMap ( ) ; if ( m_cms . existsResource ( "/" ) ) { try { @ SuppressWarnings ( "deprecation" ) List < CmsResource > configFileCandidates = m_cms . readResources ( "/" , CmsResourceFilter . DEFAU... |
public class User { /** * Map a Token instance to its Java ' s Map representation .
* @ return a Java ' s Map with the description of this object . */
public Map < String , String > toMap ( ) { } } | Map < String , String > map = new HashMap < String , String > ( ) ; map . put ( "id" , Integer . toString ( id ) ) ; map . put ( "status" , Integer . toString ( status ) ) ; map . put ( "content" , content ) ; return map ; |
public class MultimapJoiner { /** * Appends the string representation of each entry in { @ code entries } , using the previously configured separator and
* key - value separator , to { @ code builder } . Identical to { @ link # appendTo ( Appendable , Iterable ) } , except that it
* does not throw { @ link IOExcept... | try { appendTo ( ( Appendable ) builder , entries ) ; } catch ( IOException impossible ) { throw new AssertionError ( impossible ) ; } return builder ; |
public class KeyDeserializer { /** * Deserializes a key into an object .
* @ param key key to deserialize
* @ param ctx Context for the full deserialization process
* @ return the deserialized object
* @ throws com . github . nmorel . gwtjackson . client . exception . JsonDeserializationException if an error oc... | if ( null == key ) { return null ; } return doDeserialize ( key , ctx ) ; |
public class nssimpleacl6 { /** * Use this API to fetch filtered set of nssimpleacl6 resources .
* filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */
public static nssimpleacl6 [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | nssimpleacl6 obj = new nssimpleacl6 ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; nssimpleacl6 [ ] response = ( nssimpleacl6 [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class AbstractAWTDrawVisitor { /** * Calculates the boundaries of a text string in screen coordinates .
* @ param text the text string
* @ param xCoord the world x - coordinate of where the text should be placed
* @ param yCoord the world y - coordinate of where the text should be placed
* @ param graphi... | FontMetrics fontMetrics = graphics . getFontMetrics ( ) ; Rectangle2D bounds = fontMetrics . getStringBounds ( text , graphics ) ; double widthPad = 3 ; double heightPad = 1 ; double width = bounds . getWidth ( ) + widthPad ; double height = bounds . getHeight ( ) + heightPad ; int [ ] point = this . transformPoint ( x... |
public class GeometryRendererImpl { /** * Clear everything and completely redraw the edited geometry . */
public void redraw ( ) { } } | shapes . clear ( ) ; if ( container != null ) { container . setTranslation ( 0 , 0 ) ; container . clear ( ) ; try { tentativeMoveLine = new Path ( - 5 , - 5 ) ; tentativeMoveLine . lineTo ( - 5 , - 5 ) ; ShapeStyle style = styleProvider . getEdgeTentativeMoveStyle ( ) ; GeomajasImpl . getInstance ( ) . getGfxUtil ( ) ... |
public class Point3i { /** * { @ inheritDoc } */
@ Pure @ Override public int distanceSquared ( Point3D p1 ) { } } | double dx , dy , dz ; dx = this . x - p1 . getX ( ) ; dy = this . y - p1 . getY ( ) ; dz = this . z - p1 . getZ ( ) ; return ( int ) ( dx * dx + dy * dy + dz * dz ) ; |
public class ListTaskExecutionsResult { /** * A list of executed tasks .
* @ param taskExecutions
* A list of executed tasks . */
public void setTaskExecutions ( java . util . Collection < TaskExecutionListEntry > taskExecutions ) { } } | if ( taskExecutions == null ) { this . taskExecutions = null ; return ; } this . taskExecutions = new java . util . ArrayList < TaskExecutionListEntry > ( taskExecutions ) ; |
public class MonoscopicViewManager { /** * Called when the system is about to start resuming a previous activity .
* This is typically used to commit unsaved changes to persistent data , stop
* animations and other things that may be consuming CPU , etc .
* Implementations of this method must be very quick becaus... | super . onPause ( ) ; mRotationSensor . onPause ( ) ; if ( NativeVulkanCore . getVulkanPropValue ( ) > 0 ) { activeFlag = false ; if ( vulkanDrawThread != null ) { try { vulkanDrawThread . join ( ) ; } catch ( InterruptedException e ) { Log . e ( "vulkan: activity onPause:" , "draw thread not terminated" ) ; } } } Log ... |
public class CamelCatalogHelper { /** * Gets the java type of the given model
* @ param modelName the model name
* @ return the java type */
public static String getModelJavaType ( CamelCatalog camelCatalog , String modelName ) { } } | // use the camel catalog
String json = camelCatalog . modelJSonSchema ( modelName ) ; if ( json == null ) { throw new IllegalArgumentException ( "Could not find catalog entry for model name: " + modelName ) ; } List < Map < String , String > > data = JSonSchemaHelper . parseJsonSchema ( "model" , json , false ) ; if ( ... |
public class DefaultSchedulingService { /** * ~ Methods * * * * * */
@ Override @ Transactional public synchronized void startAlertScheduling ( ) { } } | requireNotDisposed ( ) ; if ( _alertSchedulingThread != null && _alertSchedulingThread . isAlive ( ) ) { _logger . info ( "Request to start alert scheduling aborted as it is already running." ) ; } else { _logger . info ( "Starting alert scheduling thread." ) ; _alertSchedulingThread = new SchedulingThread ( "schedule-... |
public class BigMoney { /** * Returns a copy of this monetary value multiplied by the specified value
* using the specified rounding mode to adjust the scale of the result .
* This multiplies this money by the specified value , retaining the scale of this money .
* This will frequently lose precision , hence the ... | return multiplyRetainScale ( BigDecimal . valueOf ( valueToMultiplyBy ) , roundingMode ) ; |
public class PyroSerializer { /** * loaded if serpent . jar is available */
public static PyroSerializer getFor ( Config . SerializerType type ) { } } | switch ( type ) { case pickle : return pickleSerializer ; case serpent : { synchronized ( PyroSerializer . class ) { if ( serpentSerializer == null ) { // try loading it
try { serpentSerializer = new SerpentSerializer ( ) ; final String requiredSerpentVersion = "1.23" ; if ( compareLibraryVersions ( net . razorvine . s... |
public class WonderPushUserPreferences { /** * Remove a channel .
* < p > Remove a channel both from this class registry and from Android . < / p >
* @ param channelId The identifier of the channel to remove . */
public static synchronized void removeChannel ( String channelId ) { } } | try { if ( _removeChannel ( channelId ) ) { save ( ) ; } } catch ( Exception ex ) { Log . e ( WonderPush . TAG , "Unexpected error while removing channel " + channelId , ex ) ; } |
public class DatabaseFullPrunedBlockStore { /** * Get the SQL statements to check if the database is compatible .
* @ return The SQL prepared statements . */
protected List < String > getCompatibilitySQL ( ) { } } | List < String > sqlStatements = new ArrayList < > ( ) ; sqlStatements . add ( SELECT_COMPATIBILITY_COINBASE_SQL ) ; return sqlStatements ; |
public class SARLValidator { /** * Check the container for the SARL agents .
* @ param agent the agent . */
@ Check public void checkContainerType ( SarlAgent agent ) { } } | final XtendTypeDeclaration declaringType = agent . getDeclaringType ( ) ; if ( declaringType != null ) { final String name = canonicalName ( declaringType ) ; assert name != null ; error ( MessageFormat . format ( Messages . SARLValidator_28 , name ) , agent , null , INVALID_NESTED_DEFINITION ) ; } |
public class AppenderatorImpl { /** * Merge segment , push to deep storage . Should only be used on segments that have been fully persisted . Must only
* be run in the single - threaded pushExecutor .
* @ param identifier sink identifier
* @ param sink sink to push
* @ param useUniquePath true if the segment sh... | // Bail out if this sink is null or otherwise not what we expect .
if ( sinks . get ( identifier ) != sink ) { log . warn ( "Sink for segment[%s] no longer valid, bailing out of mergeAndPush." , identifier ) ; return null ; } // Use a descriptor file to indicate that pushing has completed .
final File persistDir = comp... |
public class TangoDataReady { public void dispatch_event ( final EventData eventData ) { } } | final TangoDataReady tangoDataReady = this ; if ( EventUtil . graphicAvailable ( ) ) { // Causes doRun . run ( ) to be executed asynchronously
// on the AWT event dispatching thread .
Runnable do_work_later = new Runnable ( ) { public void run ( ) { fireTangoDataReadyEvent ( tangoDataReady , eventData ) ; } } ; SwingUt... |
public class AccessPoint { /** * Set standard liveweb redirector */
public void setLiveWebPrefix ( String liveWebPrefix ) { } } | if ( liveWebPrefix == null || liveWebPrefix . isEmpty ( ) ) { this . liveWebRedirector = null ; } this . liveWebRedirector = new DefaultLiveWebRedirector ( liveWebPrefix ) ; |
public class MLDouble { /** * Casts < code > Double [ ] < / code > to < code > double [ ] < / code >
* @ param - source < code > Double [ ] < / code >
* @ return - result < code > double [ ] < / code > */
private static Double [ ] castToDouble ( double [ ] d ) { } } | Double [ ] dest = new Double [ d . length ] ; for ( int i = 0 ; i < d . length ; i ++ ) { dest [ i ] = ( Double ) d [ i ] ; } return dest ; |
public class PowerMockito { /** * Allows specifying expectations on new invocations . For example you might
* want to throw an exception or return a mock . */
public static synchronized < T > WithOrWithoutExpectedArguments < T > whenNew ( Constructor < T > ctor ) { } } | return new ConstructorAwareExpectationSetup < T > ( ctor ) ; |
public class MarkovGenerator { /** * Returns the given number of randomly generated paragraphs .
* @ param num the number of paragraphs to generate
* @ return a list of randomly generated paragraphs , of the requested size */
public List < String > nextParagraphs ( int num ) { } } | List < String > paragraphs = new ArrayList < String > ( num ) ; for ( int i = 0 ; i < num ; i ++ ) { paragraphs . add ( nextParagraph ( ) ) ; } return paragraphs ; |
public class Sendinblue { /** * Get Access a specific user Information .
* @ param { Object } data contains json objects as a key value pair from HashMap .
* @ options data { String } email : Email address of the already existing user in the SendinBlue contacts [ Mandatory ] */
public String get_user ( Map < String... | String id = data . get ( "email" ) ; return get ( "user/" + id , EMPTY_STRING ) ; |
public class TransactionImpl { /** * Sets the boundary of the LTC that was completed as a
* result of this Transaction being begun . When this
* transaction completes an LTC with the same boundary
* is placed on the thread . */
@ Override public void setCompletedLTCBoundary ( Byte completedLTCBoundary ) { } } | if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setCompletedLTCBoundary" , new Object [ ] { completedLTCBoundary } ) ; _completedLTCBoundary = completedLTCBoundary ; |
public class History { /** * Create a history that contains a single key . */
@ NonNull public static History single ( @ NonNull Object key ) { } } | return emptyBuilder ( ) . push ( key ) . build ( ) ; |
public class SecurityRulesInner { /** * Deletes the specified network security rule .
* @ param resourceGroupName The name of the resource group .
* @ param networkSecurityGroupName The name of the network security group .
* @ param securityRuleName The name of the security rule .
* @ throws IllegalArgumentExce... | deleteWithServiceResponseAsync ( resourceGroupName , networkSecurityGroupName , securityRuleName ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class ResourceAssignment { /** * Set a start value .
* @ param index start index ( 1-10)
* @ param value start value */
public void setStart ( int index , Date value ) { } } | set ( selectField ( AssignmentFieldLists . CUSTOM_START , index ) , value ) ; |
public class ReflectionUtils { /** * Assert that the given method returns the expected return type .
* @ param method Method to assert .
* @ param expectedReturnType Expected return type of the method .
* @ throws IllegalArgumentException If the method ' s return type doesn ' t match the expected type . */
public... | final Class < ? > returnType = method . getReturnType ( ) ; if ( returnType != expectedReturnType ) { final String message = "Class='" + method . getDeclaringClass ( ) + "', method='" + method . getName ( ) + "': Must return a value of type '" + expectedReturnType + "'!" ; throw new IllegalArgumentException ( message )... |
public class Calculator { /** * 计算 ( ) 内的表达式
* @ param start 开始位置
* @ param formula 表达式
* @ return 长度为2的 { @ link BigDecimal } 数组 , 位置0表示计算结果 , 位置1表示结束位置
* @ throws Exception 异常 */
private static BigDecimal [ ] calculateInlineFormula ( int start , String formula ) throws Exception { } } | BigDecimal [ ] result = new BigDecimal [ 2 ] ; StringBuilder inlineFormula = new StringBuilder ( ) ; for ( ; start < formula . length ( ) ; start ++ ) { char c = formula . charAt ( start ) ; if ( c == '(' ) { BigDecimal [ ] res = calculateInlineFormula ( start + 1 , formula ) ; inlineFormula . append ( res [ 0 ] ) ; st... |
public class IronJacamarWithByteman { /** * Create a ScriptText instance
* @ param key The key
* @ param rule The rule
* @ return The ScriptText instance */
private ScriptText createScriptText ( int key , BMRule rule ) { } } | StringBuilder builder = new StringBuilder ( ) ; builder . append ( "# BMUnit autogenerated script: " ) . append ( rule . name ( ) ) ; builder . append ( "\nRULE " ) ; builder . append ( rule . name ( ) ) ; if ( rule . isInterface ( ) ) { builder . append ( "\nINTERFACE " ) ; } else { builder . append ( "\nCLASS " ) ; }... |
public class Observation { /** * Returns the inserted value of a given insertion step .
* @ param index Index of the desired insertion step
* @ return The inserted value of a given insertion step . */
public double getValueAt ( int index ) { } } | if ( index < 0 || index >= insertSeq . size ( ) ) throw new IndexOutOfBoundsException ( ) ; return insertSeq . get ( index ) ; |
public class SimpleLock { /** * Execute the provided runnable in a read lock .
* @ param aRunnable
* Runnable to be executed . May not be < code > null < / code > . */
public void locked ( @ Nonnull final Runnable aRunnable ) { } } | ValueEnforcer . notNull ( aRunnable , "Runnable" ) ; lock ( ) ; try { aRunnable . run ( ) ; } finally { unlock ( ) ; } |
public class UniqueId { /** * Converts a hex string to a byte array
* If the { @ code uid } is less than { @ code uid _ length * 2 } characters wide , it
* will be padded with 0s to conform to the spec . E . g . if the tagk width is 3
* and the given { @ code uid } string is " 1 " , the string will be padded to
... | if ( uid == null || uid . isEmpty ( ) ) { throw new IllegalArgumentException ( "UID was empty" ) ; } String id = uid ; if ( uid_length > 0 ) { while ( id . length ( ) < uid_length * 2 ) { id = "0" + id ; } } else { if ( id . length ( ) % 2 > 0 ) { id = "0" + id ; } } return DatatypeConverter . parseHexBinary ( id ) ; |
public class CobarSqlMapClientTemplate { /** * NOTE : since it ' s a deprecated interface , so distributed data access is
* not supported . */
@ Override public PaginatedList queryForPaginatedList ( String statementName , Object parameterObject , int pageSize ) throws DataAccessException { } } | return super . queryForPaginatedList ( statementName , parameterObject , pageSize ) ; |
public class RetryTemplate { /** * Extension point for subclasses to decide on behaviour after catching an exception
* in a { @ link RetryCallback } . Normal stateless behaviour is not to rethrow , and if
* there is state we rethrow .
* @ param retryPolicy the retry policy
* @ param context the current context ... | return state != null && state . rollbackFor ( context . getLastThrowable ( ) ) ; |
public class Configuration { /** * Get the comma delimited values of the < code > name < / code > property as
* an array of < code > String < / code > s , trimmed of the leading and trailing whitespace .
* If no such property is specified then an empty array is returned .
* @ param name property name .
* @ retu... | String valueString = get ( name ) ; return StringUtils . getTrimmedStrings ( valueString ) ; |
public class ResumeUploader { private void record ( long offset ) { } } | if ( config . recorder == null || offset == 0 ) { return ; } String data = format ( Locale . ENGLISH , "{\"size\":%d,\"offset\":%d, \"modify_time\":%d, \"contexts\":[%s]}" , totalSize , offset , modifyTime , StringUtils . jsonJoin ( contexts ) ) ; config . recorder . set ( recorderKey , data . getBytes ( ) ) ; |
public class CmsSecurityManager { /** * Returns a list of all template resources which must be processed during a static export . < p >
* @ param context the current request context
* @ param parameterResources flag for reading resources with parameters ( 1 ) or without ( 0)
* @ param timestamp for reading the da... | CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; List < String > result = null ; try { result = m_driverManager . readStaticExportResources ( dbc , parameterResources , timestamp ) ; } catch ( Exception e ) { dbc . report ( null , Messages . get ( ) . container ( Messages . ERR_READ_STATEXP_RESOURCES_... |
public class KDTree { /** * Recursively adds an instance to the tree starting from
* the supplied KDTreeNode .
* NOTE : This should not be called by outside classes ,
* outside classes should instead call update ( Instance )
* method .
* @ param inst The instance to add to the tree
* @ param node The node t... | if ( node . isALeaf ( ) ) { int instList [ ] = new int [ m_Instances . numInstances ( ) ] ; try { System . arraycopy ( m_InstList , 0 , instList , 0 , node . m_End + 1 ) ; // m _ InstList . squeezeIn ( m _ End ,
// index ) ;
if ( node . m_End < m_InstList . length - 1 ) System . arraycopy ( m_InstList , node . m_End + ... |
public class VdmThreadEventHandler { @ Override protected void handleChange ( DebugEvent event ) { } } | // System . out . println ( " handleChange " + event . getSource ( ) ) ;
IThread thread = ( IThread ) event . getSource ( ) ; if ( DEBUG ) { System . out . println ( "handleChange " + thread ) ; } if ( isRunning ( thread ) ) { IStackFrame frame = null ; try { frame = thread . getTopStackFrame ( ) ; int threadIndex = in... |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getGSCP ( ) { } } | if ( gscpEClass == null ) { gscpEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 473 ) ; } return gscpEClass ; |
public class SentimentScoreMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SentimentScore sentimentScore , ProtocolMarshaller protocolMarshaller ) { } } | if ( sentimentScore == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sentimentScore . getPositive ( ) , POSITIVE_BINDING ) ; protocolMarshaller . marshall ( sentimentScore . getNegative ( ) , NEGATIVE_BINDING ) ; protocolMarshaller . marsh... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.