signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Config { /** * Get configuration object property value or null if there is no property with requested name . * @ param name property name . * @ return configuration object property value or null . * @ throws IllegalArgumentException if < code > name < / code > argument is null or empty . */ public St...
Params . notNullOrEmpty ( name , "Property name" ) ; usedProperties . add ( name ) ; return properties . getProperty ( name ) ;
public class ChoiceFormat { /** * Set the choices to be used in formatting . * @ param limits contains the top value that you want * parsed with that format , and should be in ascending sorted order . When * formatting X , the choice will be the i , where * limit [ i ] & lt ; = X & lt ; limit [ i + 1 ] . * If...
if ( limits . length != formats . length ) { throw new IllegalArgumentException ( "Array and limit arrays must be of the same length." ) ; } choiceLimits = limits ; choiceFormats = formats ;
public class RocksDbWrapper { /** * Gets a value from a column family . * @ param cfName * @ param key * @ return * @ throws RocksDbException */ public byte [ ] get ( String cfName , String key ) throws RocksDbException { } }
return get ( cfName , readOptions , key ) ;
public class PrefixedPropertyOverrideConfigurer { /** * Gets the effective properties . * @ return the effective properties */ @ ManagedAttribute ( ) public List < String > getEffectiveProperties ( ) { } }
final List < String > properties = new LinkedList < String > ( ) ; for ( final String key : myProperties . stringPropertyNames ( ) ) { properties . add ( key + "=" + myProperties . get ( key ) ) ; } return properties ;
public class FullSegmentation { /** * 获取文本的所有可能切分结果 * @ param text 文本 * @ return 全切分结果 */ private List < Word > [ ] fullSeg ( String text ) { } }
// 文本长度 final int textLen = text . length ( ) ; // 以每一个字作为词的开始 , 所能切分的词 final List < String > [ ] sequence = new LinkedList [ textLen ] ; if ( isParallelSeg ( ) ) { // 并行化 List < Integer > list = new ArrayList < > ( textLen ) ; for ( int i = 0 ; i < textLen ; i ++ ) { list . add ( i ) ; } list . parallelStream ( ) . fo...
public class Tokens { /** * Returns { @ code true } if the two tokens are adjacent in the input stream with no intervening * characters . */ static boolean areAdjacent ( Token first , Token second ) { } }
return first . endLine == second . beginLine && first . endColumn == second . beginColumn - 1 ;
public class DeploymentScenario { /** * Validate that a deployment of same type is not already added */ private void validateNotSameNameAndTypeOfDeployment ( DeploymentDescription deployment ) { } }
for ( Deployment existing : deployments ) { if ( existing . getDescription ( ) . getName ( ) . equals ( deployment . getName ( ) ) ) { if ( ( existing . getDescription ( ) . isArchiveDeployment ( ) && deployment . isArchiveDeployment ( ) ) || ( existing . getDescription ( ) . isDescriptorDeployment ( ) && deployment . ...
public class BeanDefinitionParser { /** * parseCollectionElements . * @ param elementNodes a { @ link org . w3c . dom . NodeList } object . * @ param target a { @ link java . util . Collection } object . * @ param bd a { @ link org . springframework . beans . factory . config . BeanDefinition } object . * @ par...
for ( int i = 0 ; i < elementNodes . getLength ( ) ; i ++ ) { Node node = elementNodes . item ( i ) ; if ( node instanceof Element && ! nodeNameEquals ( node , DESCRIPTION_ELEMENT ) ) target . add ( parsePropertySubElement ( ( Element ) node , bd , defaultElementType ) ) ; }
public class Reflection { /** * Utility method that allows to extract actual annotation from field , bypassing LibGDX annotation wrapper . Returns * null if annotation is not present . * @ param field might be annotated . * @ param annotationType class of the annotation . * @ return an instance of the annotatio...
if ( isAnnotationPresent ( field , annotationType ) ) { return field . getDeclaredAnnotation ( annotationType ) . getAnnotation ( annotationType ) ; } return null ;
public class AbstractQueueJsonDeserializer { /** * < p > newInstance < / p > * @ param deserializer { @ link JsonDeserializer } used to deserialize the objects inside the { @ link AbstractQueue } . * @ param < T > Type of the elements inside the { @ link AbstractQueue } * @ return a new instance of { @ link Abstr...
return new AbstractQueueJsonDeserializer < T > ( deserializer ) ;
public class LoadAllOperation { /** * Filters the { @ link # keys } list for keys matching the partition on * which this operation is executed . * @ return the filtered key list */ private List < Data > selectThisPartitionsKeys ( ) { } }
final IPartitionService partitionService = mapServiceContext . getNodeEngine ( ) . getPartitionService ( ) ; final int partitionId = getPartitionId ( ) ; List < Data > dataKeys = null ; for ( Data key : keys ) { if ( partitionId == partitionService . getPartitionId ( key ) ) { if ( dataKeys == null ) { dataKeys = new A...
public class JmolSymmetryScriptGeneratorH { /** * Returns a Jmol script to set the default orientation for a structure * @ return Jmol script */ @ Override public String getDefaultOrientation ( ) { } }
StringBuilder s = new StringBuilder ( ) ; s . append ( setCentroid ( ) ) ; Quat4d q = new Quat4d ( ) ; q . set ( helixAxisAligner . getRotationMatrix ( ) ) ; // set orientation s . append ( "moveto 0 quaternion{" ) ; s . append ( jMolFloat ( q . x ) ) ; s . append ( "," ) ; s . append ( jMolFloat ( q . y ) ) ; s . appe...
public class SibRaDestinationSession { /** * Checks that the parent connection has not been invalidated by the * connection manager . * @ throws SISessionUnavailableException * if the connection has been invalidated */ protected void checkValid ( ) throws SISessionUnavailableException { } }
if ( ! _parentConnection . isValid ( ) ) { final SISessionUnavailableException exception = new SISessionUnavailableException ( NLS . getString ( "INVALID_SESSION_CWSIV0200" ) ) ; if ( TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } throw exception ; }
public class Swarm { /** * Retrieve the default ShrinkWrap deployment . * @ return The default deployment , unmodified . */ public Archive < ? > createDefaultDeployment ( ) throws Exception { } }
if ( this . server == null ) { throw SwarmMessages . MESSAGES . containerNotStarted ( "createDefaultDeployment()" ) ; } return this . server . deployer ( ) . createDefaultDeployment ( ) ;
public class Gen { /** * Derived visitor method : generate code for a list of statements . */ public void genStats ( List < ? extends JCTree > trees , Env < GenContext > env ) { } }
for ( List < ? extends JCTree > l = trees ; l . nonEmpty ( ) ; l = l . tail ) genStat ( l . head , env , CRT_STATEMENT ) ;
public class AbstractClasspathScanner { /** * This method gets the singleton instance of this { @ link ClasspathScanner } . < br > * < b > ATTENTION : < / b > < br > * Please prefer dependency - injection instead of using this method . * @ return the singleton instance . */ public static ClasspathScanner getInsta...
if ( instance == null ) { synchronized ( AbstractClasspathScanner . class ) { if ( instance == null ) { ClasspathScannerImpl impl = new ClasspathScannerImpl ( ) ; impl . initialize ( ) ; } } } return instance ;
public class Bits { /** * available via default BitStore method */ static Positions newDisjointPositions ( Matches matches ) { } }
if ( matches == null ) throw new IllegalArgumentException ( "null matches" ) ; return new BitStorePositions ( matches , true , 0 ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcBooleanResult ( ) { } }
if ( ifcBooleanResultEClass == null ) { ifcBooleanResultEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 46 ) ; } return ifcBooleanResultEClass ;
public class CmsDriverManager { /** * Unlocks a resource . < p > * @ param dbc the current database context * @ param resource the resource to unlock * @ param force < code > true < / code > , if a resource is forced to get unlocked , no matter by which user and in which project the resource is currently locked ...
// update the resource cache m_monitor . clearResourceCache ( ) ; // now update lock status m_lockManager . removeResource ( dbc , resource , force , removeSystemLock ) ; // we must also clear the permission cache m_monitor . flushCache ( CmsMemoryMonitor . CacheType . PERMISSION ) ; // fire resource modification event...
public class ZookeeperPublishHandler { /** * 发布服务 * @ param descs * 所有的服务描述 * @ return 发布成功与否 * @ see com . baidu . beidou . navi . server . locator . PublishHandler # publish ( java . util . Collection ) */ @ Override public < KEY > boolean publish ( Collection < MethodDescriptor < KEY > > descs ) { } }
if ( CollectionUtil . isEmpty ( descs ) ) { LOG . warn ( "No service to publish" ) ; return false ; } List < String > methodNames = CollectionUtil . transform ( descs , new Function < MethodDescriptor < KEY > , String > ( ) { @ Override public String apply ( MethodDescriptor < KEY > input ) { return String . format ( "...
public class OutputManager { /** * adds output extension to desired outputPlugin * adds output extension to desired outputPlugin , so that the output - plugin can start and stop the outputExtension * task as needed . The outputExtension is specific to the output - plugin * @ param outputExtension the outputExtens...
if ( outputExtensions . containsKey ( outputExtension . getPluginId ( ) ) ) { outputExtensions . get ( outputExtension . getPluginId ( ) ) . add ( outputExtension ) ; } else { IdentifiableSet < OutputExtensionModel < ? , ? > > outputExtensionList = new IdentifiableSet < > ( ) ; outputExtensionList . add ( outputExtensi...
public class AmazonMachineLearningClient { /** * Creates a < code > DataSource < / code > object . A < code > DataSource < / code > references data that can be used to perform * < code > CreateMLModel < / code > , < code > CreateEvaluation < / code > , or < code > CreateBatchPrediction < / code > operations . * < c...
request = beforeClientExecution ( request ) ; return executeCreateDataSourceFromS3 ( request ) ;
public class AbstractPlainDatagramSocketImpl { /** * Return the first address bound to NetworkInterface with given ID . * In case of niIndex = = 0 or no address return anyLocalAddress */ static InetAddress getNIFirstAddress ( int niIndex ) throws SocketException { } }
if ( niIndex > 0 ) { NetworkInterface networkInterface = NetworkInterface . getByIndex ( niIndex ) ; Enumeration < InetAddress > addressesEnum = networkInterface . getInetAddresses ( ) ; if ( addressesEnum . hasMoreElements ( ) ) { return addressesEnum . nextElement ( ) ; } } return InetAddress . anyLocalAddress ( ) ;
public class XmppHostnameVerifier { /** * Returns true if the name matches against the template that may contain the wildcard char ' * ' . * @ param name * @ param template * @ return true if < code > name < / code > matches < code > template < / code > . */ private static boolean matchWildCards ( String name , S...
int wildcardIndex = template . indexOf ( "*" ) ; if ( wildcardIndex == - 1 ) { return name . equals ( template ) ; } boolean isBeginning = true ; String beforeWildcard ; String afterWildcard = template ; while ( wildcardIndex != - 1 ) { beforeWildcard = afterWildcard . substring ( 0 , wildcardIndex ) ; afterWildcard = ...
public class SSTableExport { /** * than once from within the same process . */ static void export ( SSTableReader reader , PrintStream outs , String [ ] excludes , CFMetaData metadata ) throws IOException { } }
Set < String > excludeSet = new HashSet < String > ( ) ; if ( excludes != null ) excludeSet = new HashSet < String > ( Arrays . asList ( excludes ) ) ; SSTableIdentityIterator row ; ISSTableScanner scanner = reader . getScanner ( ) ; try { outs . println ( "[" ) ; int i = 0 ; // collecting keys to export while ( scanne...
public class SoapClient { /** * 设置请求方法 * @ param name 方法名及其命名空间 * @ param params 参数 * @ param useMethodPrefix 是否使用方法的命名空间前缀 * @ return this */ public SoapClient setMethod ( Name name , Map < String , Object > params , boolean useMethodPrefix ) { } }
return setMethod ( new QName ( name . getURI ( ) , name . getLocalName ( ) , name . getPrefix ( ) ) , params , useMethodPrefix ) ;
public class DataUtils { /** * Bubble sort * @ param targets */ public static void sort ( final List < Artifact > targets ) { } }
int n = targets . size ( ) ; while ( n != 0 ) { int newn = 0 ; for ( int i = 1 ; i <= n - 1 ; i ++ ) { if ( targets . get ( i - 1 ) . toString ( ) . compareTo ( targets . get ( i ) . toString ( ) ) > 0 ) { Collections . swap ( targets , i - 1 , i ) ; newn = i ; } } n = newn ; }
public class OWLSameIndividualAxiomImpl_CustomFieldSerializer { /** * Serializes the content of the object into the * { @ link com . google . gwt . user . client . rpc . SerializationStreamWriter } . * @ param streamWriter the { @ link com . google . gwt . user . client . rpc . SerializationStreamWriter } to write ...
serialize ( streamWriter , instance ) ;
public class gslbservice_lbmonitor_binding { /** * Use this API to fetch gslbservice _ lbmonitor _ binding resources of given name . */ public static gslbservice_lbmonitor_binding [ ] get ( nitro_service service , String servicename ) throws Exception { } }
gslbservice_lbmonitor_binding obj = new gslbservice_lbmonitor_binding ( ) ; obj . set_servicename ( servicename ) ; gslbservice_lbmonitor_binding response [ ] = ( gslbservice_lbmonitor_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class BccClient { /** * Listing volumes owned by the authenticated user . * @ param request The request containing all options for listing volumes owned by the authenticated user . * @ return The response containing a list of volume owned by the authenticated user . */ public ListVolumesResponse listVolumes ...
InternalRequest internalRequest = this . createRequest ( request , HttpMethodName . GET , VOLUME_PREFIX ) ; if ( request . getMarker ( ) != null ) { internalRequest . addParameter ( "marker" , request . getMarker ( ) ) ; } if ( request . getMaxKeys ( ) > 0 ) { internalRequest . addParameter ( "maxKeys" , String . value...
public class CmsImportVersion5 { /** * Reads all the relations of the resource from the < code > manifest . xml < / code > file * and adds them to the according resource . < p > * @ param resource the resource to import the relations for * @ param parentElement the current element */ protected void importRelation...
// Get the nodes for the relations @ SuppressWarnings ( "unchecked" ) List < Node > relationElements = parentElement . selectNodes ( "./" + A_CmsImport . N_RELATIONS + "/" + A_CmsImport . N_RELATION ) ; List < CmsRelation > relations = new ArrayList < CmsRelation > ( ) ; // iterate over the nodes Iterator < Node > itRe...
public class GeometryConverterService { /** * Convert a JTS geometry to a Geomajas geometry . * @ param geometry JTS geometry * @ return Geomajas geometry * @ throws JtsConversionException conversion failed */ public static Geometry fromJts ( com . vividsolutions . jts . geom . Geometry geometry ) throws JtsConve...
if ( geometry == null ) { throw new JtsConversionException ( "Cannot convert null argument" ) ; } int srid = geometry . getSRID ( ) ; int precision = - 1 ; PrecisionModel precisionmodel = geometry . getPrecisionModel ( ) ; if ( ! precisionmodel . isFloating ( ) ) { precision = ( int ) Math . log10 ( precisionmodel . ge...
public class FileSystemAccess { /** * throws an IOException if the current FileSystem isn ' t working */ private FileSystem getFileSystemSafe ( ) throws IOException { } }
try { fs . getFileStatus ( new Path ( "/" ) ) ; return fs ; } catch ( NullPointerException e ) { throw new IOException ( "file system not initialized" ) ; }
public class ParameterUtil { /** * Fetches the supplied parameter from the request and converts it to an integer . If the * parameter does not exist or is not a well - formed integer , a data validation exception is * thrown with the supplied message . */ public static int requireIntParameter ( HttpServletRequest r...
return parseIntParameter ( getParameter ( req , name , false ) , invalidDataMessage ) ;
public class ParameterBuilder { /** * Copy builder * @ param other parameter to copy from * @ return this */ ParameterBuilder from ( Parameter other ) { } }
return name ( other . getName ( ) ) . allowableValues ( other . getAllowableValues ( ) ) . allowMultiple ( other . isAllowMultiple ( ) ) . defaultValue ( other . getDefaultValue ( ) ) . description ( other . getDescription ( ) ) . modelRef ( other . getModelRef ( ) ) . parameterAccess ( other . getParamAccess ( ) ) . p...
public class PathToObjectIdentifiersMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PathToObjectIdentifiers pathToObjectIdentifiers , ProtocolMarshaller protocolMarshaller ) { } }
if ( pathToObjectIdentifiers == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( pathToObjectIdentifiers . getPath ( ) , PATH_BINDING ) ; protocolMarshaller . marshall ( pathToObjectIdentifiers . getObjectIdentifiers ( ) , OBJECTIDENTIFIERS_B...
public class CmsFileTable { /** * Applies settings generally used within workplace app file lists . < p > */ public void applyWorkplaceAppSettings ( ) { } }
// add site path property to container m_container . addContainerProperty ( CmsResourceTableProperty . PROPERTY_SITE_PATH , CmsResourceTableProperty . PROPERTY_SITE_PATH . getColumnType ( ) , CmsResourceTableProperty . PROPERTY_SITE_PATH . getDefaultValue ( ) ) ; // replace the resource name column with the path column...
public class SysLibraryLoader { /** * Load a shared library . * @ param name Name of the library to load . * @ param verify Ignored , no verification is done . * @ return true if the library was successfully loaded . */ public boolean load ( String name , boolean verify ) { } }
boolean loaded ; try { System . loadLibrary ( name ) ; loaded = true ; } catch ( Throwable e ) { loaded = false ; } return loaded ;
public class FeaturePainter { /** * The actual painting function . Draws the circles with the object ' s id . * @ param paintable * A { @ link org . geomajas . gwt . client . gfx . paintable . Text } object . * @ param group * The group where the object resides in ( optional ) . * @ param context * A MapCon...
if ( paintable != null ) { Feature feature = ( Feature ) paintable ; WorldViewTransformer worldViewTransformer = feature . getLayer ( ) . getMapModel ( ) . getMapView ( ) . getWorldViewTransformer ( ) ; Geometry geometry = worldViewTransformer . worldToPan ( feature . getGeometry ( ) ) ; ShapeStyle style = createStyleF...
public class LocalTranCoordImpl { /** * Enlists the provided < CODE > resource < / CODE > * object with the target < CODE > LocalTransactionCoordinator < / CODE > in order * that the resource be coordinated by the LTC . * The < code > resource < / code > is called to < code > start < / code > as part of the enlis...
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "enlist" , resource ) ; /* Rollup of MD19518 if ( ( _ current = = null ) | | ( _ current . globalTranExists ( ) ) ) IllegalStateException ise = new IllegalStateException ( " Cannot enlist Resource . A Global transaction is active . " ) ; FFDCFilter . processExcepti...
public class BDDFactory { /** * Returns the model count of a given BDD with a given number of unimportant variables . * @ param bdd the BDD * @ param unimportantVars the number of unimportant variables * @ return the model count */ public BigDecimal modelCount ( final BDD bdd , final int unimportantVars ) { } }
return modelCount ( bdd ) . divide ( BigDecimal . valueOf ( ( int ) Math . pow ( 2 , unimportantVars ) ) ) ;
public class MailAttrProcessor { /** * Added more information to the urlbuilder . * @ param urlBuilder an urlbuilder . * @ param name the name of the attribute . * @ param value the value . */ private void addEncodedValue ( final StringBuilder urlBuilder , final String name , String value ) { } }
if ( value != null ) { String encodedValue ; if ( ! "to" . equals ( name ) && ! urlBuilder . toString ( ) . endsWith ( "?" ) ) { urlBuilder . append ( '&' ) ; } try { encodedValue = URLEncoder . encode ( value , "utf-8" ) . replace ( "+" , "%20" ) ; } catch ( UnsupportedEncodingException e ) { LOG . error ( "UTF-8 enco...
public class SqlQuery { /** * Constructs a query with named arguments , using the properties / fields of given bean for resolving arguments . * @ see # namedQuery ( String , VariableResolver ) * @ see VariableResolver # forBean ( Object ) */ public static @ NotNull SqlQuery namedQuery ( @ NotNull @ SQL String sql ,...
return namedQuery ( sql , VariableResolver . forBean ( bean ) ) ;
public class Segment { /** * Reads the term for the entry at the given index . * @ param index The index for which to read the term . * @ return The term for the given index . * @ throws IllegalStateException if the segment is not open or { @ code index } is inconsistent */ public long term ( long index ) { } }
assertSegmentOpen ( ) ; checkRange ( index ) ; // Get the offset of the index within this segment . long offset = relativeOffset ( index ) ; // Look up the term for the offset in the term index . return termIndex . lookup ( offset ) ;
public class ScaleInfo { /** * Sets the scale value in pixel per map unit . * @ param pixelPerUnit * the scale value ( pix / map unit ) */ public void setPixelPerUnit ( double pixelPerUnit ) { } }
if ( pixelPerUnit < MINIMUM_PIXEL_PER_UNIT ) { pixelPerUnit = MINIMUM_PIXEL_PER_UNIT ; } if ( pixelPerUnit > MAXIMUM_PIXEL_PER_UNIT ) { pixelPerUnit = MAXIMUM_PIXEL_PER_UNIT ; } this . pixelPerUnit = pixelPerUnit ; setPixelPerUnitBased ( true ) ; postConstruct ( ) ;
public class RunnersApi { /** * Get a Stream of jobs that are being processed or were processed by specified Runner . * < pre > < code > GitLab Endpoint : GET / runners / : id / jobs < / code > < / pre > * @ param runnerId The ID of a runner * @ return a Stream of jobs that are being processed or were processed b...
return ( getJobs ( runnerId , null , getDefaultPerPage ( ) ) . stream ( ) ) ;
public class BasicUserProfile { /** * Return the authentication attribute with name . * @ param name authentication attribute name * @ return the authentication attribute with name */ public Object getAuthenticationAttribute ( final String name ) { } }
return ProfileHelper . getInternalAttributeHandler ( ) . restore ( this . authenticationAttributes . get ( name ) ) ;
public class InternalSARLParser { /** * $ ANTLR start synpred44 _ InternalSARL */ public final void synpred44_InternalSARL_fragment ( ) throws RecognitionException { } }
// InternalSARL . g : 13520:8 : ( ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) // InternalSARL . g : 13520:9 : ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) { // InternalSARL . g : 13520:9 : ( ( ) ( ( ( ru...
public class OHLCChart { /** * Add a series for a OHLC type chart using Lists * @ param seriesName * @ param xData the x - axis data * @ param openData the open data * @ param highData the high data * @ param lowData the low data * @ param closeData the close data * @ return A Series object that you can s...
DataType dataType = getDataType ( xData ) ; switch ( dataType ) { case Date : return addSeries ( seriesName , Utils . getDoubleArrayFromDateList ( xData ) , Utils . getDoubleArrayFromNumberList ( openData ) , Utils . getDoubleArrayFromNumberList ( highData ) , Utils . getDoubleArrayFromNumberList ( lowData ) , Utils . ...
public class A_CmsTreeTabDataPreloader { /** * Gets the common ancestor of two paths . < p > * @ param rootPath1 the first path * @ param rootPath2 the second path * @ return the common ancestor path */ private String getCommonAncestorPath ( String rootPath1 , String rootPath2 ) { } }
if ( rootPath1 == null ) { return rootPath2 ; } if ( rootPath2 == null ) { return rootPath1 ; } rootPath1 = CmsStringUtil . joinPaths ( "/" , rootPath1 , "/" ) ; rootPath2 = CmsStringUtil . joinPaths ( "/" , rootPath2 , "/" ) ; int minLength = Math . min ( rootPath1 . length ( ) , rootPath2 . length ( ) ) ; int i ; for...
public class SparseHashDoubleVector { /** * { @ inheritDoc } */ public void set ( int index , double value ) { } }
double old = vector . get ( index ) ; if ( value == 0 ) vector . remove ( index ) ; else vector . put ( index , value ) ; magnitude = - 1 ;
public class SQLCaster { /** * cast a Value to a correspondance CF Type * @ param item * @ return cf type * @ throws PageException */ public static Object toCFTypex ( SQLItem item ) throws PageException { } }
try { return _toCFTypex ( item ) ; } catch ( PageException e ) { if ( item . isNulls ( ) ) return item . getValue ( ) ; throw e ; }
public class NumberUtil { /** * 将16进制的String转化为Long * 当str为空或非数字字符串时抛NumberFormatException */ public static Long hexToLongObject ( @ NotNull String str ) { } }
// 统一行为 , 不要有时候抛NPE , 有时候抛NumberFormatException if ( str == null ) { throw new NumberFormatException ( "null" ) ; } return Long . decode ( str ) ;
public class FileSystemManager { /** * Gets the first writable directory that exists or can be created . * @ param directories The directories to try * @ return A File object that represents a writable directory . * @ throws FileNotFoundException Thrown if no directory can be written to . */ public static File ge...
File logDir = null ; for ( String directory : directories ) { if ( directory != null ) { try { logDir = ensureDirectoryWriteable ( new File ( directory ) ) ; } catch ( FileNotFoundException e ) { log . debug ( "Failed to get writeable directory: " + directory , e ) ; continue ; } break ; } } if ( logDir == null ) { thr...
public class Log { /** * Returns true if an error needs to be reported for a given * source name and pos . */ protected boolean shouldReport ( JavaFileObject file , int pos ) { } }
if ( file == null ) return true ; Pair < JavaFileObject , Integer > coords = new Pair < > ( file , pos ) ; boolean shouldReport = ! recorded . contains ( coords ) ; if ( shouldReport ) recorded . add ( coords ) ; return shouldReport ;
public class StandardBullhornData { /** * { @ inheritDoc } */ @ Override public < T extends QueryEntity > EntityIdBoundaries queryForIdBoundaries ( Class < T > entityClass ) { } }
return handleQueryForIdBoundaries ( entityClass ) ;
public class Distance { /** * Gets the Manhattan distance between two points . * @ param p IntPoint with X and Y axis coordinates . * @ param q IntPoint with X and Y axis coordinates . * @ return The Manhattan distance between x and y . */ public static double Manhattan ( IntPoint p , IntPoint q ) { } }
return Manhattan ( p . x , p . y , q . x , q . y ) ;
public class AuxiliaryTree { /** * returns Pair < node , foot > */ private Pair < Tree , Tree > copyHelper ( Tree node , Map < String , Tree > newNamesToNodes ) { } }
Tree clone ; Tree newFoot = null ; if ( node . isLeaf ( ) ) { if ( node == foot ) { // found the foot node ; pass it up . clone = node . treeFactory ( ) . newTreeNode ( node . label ( ) , new ArrayList < Tree > ( 0 ) ) ; newFoot = clone ; } else { clone = node . treeFactory ( ) . newLeaf ( node . label ( ) . labelFacto...
public class TrainModule { /** * Extract session data from { @ link StatsStorage } * @ param sid session ID * @ param ss { @ code StatsStorage } instance * @ return session data map */ private static Map < String , Object > sessionData ( String sid , StatsStorage ss ) { } }
Map < String , Object > dataThisSession = new HashMap < > ( ) ; List < String > workerIDs = ss . listWorkerIDsForSessionAndType ( sid , StatsListener . TYPE_ID ) ; int workerCount = ( workerIDs == null ? 0 : workerIDs . size ( ) ) ; List < Persistable > staticInfo = ss . getAllStaticInfos ( sid , StatsListener . TYPE_I...
public class ReferenceAccessController { /** * { @ inheritDoc } */ @ Override public boolean isAuthorized ( ClientApplication clientApplication , Action action , Context context ) { } }
boolean authorized = false ; if ( clientApplication != null && action != null && action . toString ( ) != null && action . toString ( ) . trim ( ) . length ( ) > 0 ) { for ( Role role : clientApplication . getRoles ( ) ) { // simple check to make sure that // the value of the action matches the value of one of the role...
public class NumberPath { /** * Method to construct the less than or equals expression for long * @ param value the long * @ return Expression */ public Expression < Long > lte ( long value ) { } }
String valueString = "'" + value + "'" ; return new Expression < Long > ( this , Operation . lte , valueString ) ;
public class BaseExtension { /** * Get the extension or create as needed * @ param extensionName * extension name * @ param tableName * table name * @ param columnName * column name * @ param definition * extension definition * @ param scopeType * extension scope type * @ return extension */ prote...
Extensions extension = get ( extensionName , tableName , columnName ) ; if ( extension == null ) { try { if ( ! extensionsDao . isTableExists ( ) ) { geoPackage . createExtensionsTable ( ) ; } extension = new Extensions ( ) ; extension . setTableName ( tableName ) ; extension . setColumnName ( columnName ) ; extension ...
public class aaapreauthenticationpolicy_vpnvserver_binding { /** * Use this API to fetch aaapreauthenticationpolicy _ vpnvserver _ binding resources of given name . */ public static aaapreauthenticationpolicy_vpnvserver_binding [ ] get ( nitro_service service , String name ) throws Exception { } }
aaapreauthenticationpolicy_vpnvserver_binding obj = new aaapreauthenticationpolicy_vpnvserver_binding ( ) ; obj . set_name ( name ) ; aaapreauthenticationpolicy_vpnvserver_binding response [ ] = ( aaapreauthenticationpolicy_vpnvserver_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class SDVariable { /** * Sum array reduction operation , optionally along specified dimensions . < br > * Note that if keepDims = true , the output variable has the same rank as the input variable , * with the reduced dimensions having size 1 . This can be useful for later broadcast operations ( such as subt...
return sameDiff . sum ( name , this , keepDims , dimensions ) ;
public class SherlockAccountAuthenticatorActivity { /** * Sends the result or a Constants . ERROR _ CODE _ CANCELED error if a result isn ' t present . */ public void finish ( ) { } }
if ( mAccountAuthenticatorResponse != null ) { // send the result bundle back if set , otherwise send an error . if ( mResultBundle != null ) { mAccountAuthenticatorResponse . onResult ( mResultBundle ) ; } else { mAccountAuthenticatorResponse . onError ( AccountManager . ERROR_CODE_CANCELED , "canceled" ) ; } mAccount...
public class DSet { /** * Compares the first comparable to the second . This is useful to avoid type safety warnings * when dealing with the keys of { @ link DSet . Entry } values . */ public static int compare ( Comparable < ? > c1 , Comparable < ? > c2 ) { } }
@ SuppressWarnings ( "unchecked" ) Comparable < Object > cc1 = ( Comparable < Object > ) c1 ; @ SuppressWarnings ( "unchecked" ) Comparable < Object > cc2 = ( Comparable < Object > ) c2 ; return cc1 . compareTo ( cc2 ) ;
public class MediaExceptionProcessor { /** * ( non - Javadoc ) * @ see * com . microsoft . windowsazure . services . media . entityoperations . EntityContract * # delete ( com . microsoft . windowsazure . services . media . entityoperations . * EntityDeleteOperation ) * @ return operation - id if any otherwis...
try { return service . delete ( deleter ) ; } catch ( UniformInterfaceException e ) { throw processCatch ( new ServiceException ( e ) ) ; } catch ( ClientHandlerException e ) { throw processCatch ( new ServiceException ( e ) ) ; }
public class CachingOnDiskSemanticSpace { /** * { @ inheritDoc } If the word is in the semantic space , its vector will be * temporarily loaded into memory so that subsequent calls will not need to * go to disk . As memory pressure increases , the vector will be discarded . * @ throws IOError if any { @ code IOEx...
Vector vector = wordToVector . get ( word ) ; if ( vector != null ) return Vectors . immutable ( vector ) ; Vector v = backingSpace . getVector ( word ) ; if ( v != null ) wordToVector . put ( word , v ) ; return v ;
public class InternalXtextParser { /** * InternalXtext . g : 2016:1 : entryRuleParameterReference returns [ EObject current = null ] : iv _ ruleParameterReference = ruleParameterReference EOF ; */ public final EObject entryRuleParameterReference ( ) throws RecognitionException { } }
EObject current = null ; EObject iv_ruleParameterReference = null ; try { // InternalXtext . g : 2016:59 : ( iv _ ruleParameterReference = ruleParameterReference EOF ) // InternalXtext . g : 2017:2 : iv _ ruleParameterReference = ruleParameterReference EOF { newCompositeNode ( grammarAccess . getParameterReferenceRule ...
public class PropertyManager { /** * Replaces variables like { ENVIRONMENT } with their correct values , also * handles clarifying obfuscated strings in the form * KEY = [ [ [ xxxxx ] ] ] */ private String replaceVariables ( String inString ) { } }
if ( inString == null || inString == "" ) return inString ; String outString = inString ; // Replace $ ENVIRONMENT with the default environment outString = stringReplace ( outString , "{ENVIRONMENT}" , defaultEnvironment ) ; // Go through the string and try to replace { . . . } escaped keys String currentToken = "" ; S...
public class SwapAnnuity { /** * Function to calculate an ( idealized ) single curve swap annuity for a given schedule and forward curve . * The discount curve used to calculate the annuity is calculated from the forward curve using classical * single curve interpretations of forwards and a default period length . ...
DiscountCurve discountCurve = new DiscountCurveFromForwardCurve ( forwardCurve . getName ( ) ) ; double evaluationTime = 0.0 ; // Consider only payment time > 0 return getSwapAnnuity ( evaluationTime , schedule , discountCurve , new AnalyticModelFromCurvesAndVols ( new Curve [ ] { forwardCurve , discountCurve } ) ) ;
public class Version { /** * < p > Deduces version information from Data Matrix dimensions . < / p > * @ param numRows Number of rows in modules * @ param numColumns Number of columns in modules * @ return Version for a Data Matrix Code of those dimensions * @ throws FormatException if dimensions do correspond ...
if ( ( numRows & 0x01 ) != 0 || ( numColumns & 0x01 ) != 0 ) { throw FormatException . getFormatInstance ( ) ; } for ( Version version : VERSIONS ) { if ( version . symbolSizeRows == numRows && version . symbolSizeColumns == numColumns ) { return version ; } } throw FormatException . getFormatInstance ( ) ;
public class Category { /** * Creates and defines all of the breadcrumbs for all of the categories . * @ param categories the categories to create breadcrumbs for */ public void createBreadcrumbs ( List < Category > categories ) { } }
categories . forEach ( category -> { category . setBreadcrumb ( getBreadcrumb ( ) + BREADCRUMB_DELIMITER + category . getDescription ( ) ) ; if ( ! Objects . equals ( category . getGroups ( ) , null ) ) { category . getGroups ( ) . forEach ( group -> group . addToBreadcrumb ( getBreadcrumb ( ) ) ) ; } if ( ! Objects . ...
public class TagsApi { /** * Returns a list of most frequently used tags for a user . * This method requires authentication with ' read ' permission . * @ return most frequently used tags for the calling user . * @ throws JinxException if there are any errors . * @ see < a href = " https : / / www . flickr . co...
Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.tags.getMostFrequentlyUsed" ) ; return jinx . flickrGet ( params , TagsForUser . class ) ;
public class Rollbar { /** * Record a debug error with human readable description . * @ param error the error * @ param description human readable description of error */ public void debug ( Throwable error , String description ) { } }
log ( error , null , description , Level . DEBUG ) ;
public class ProponoException { /** * Print stack trace for exception and for root cause exception if htere is one . * @ param s Writer to write to . */ @ Override public void printStackTrace ( final PrintWriter s ) { } }
super . printStackTrace ( s ) ; if ( null != mRootCause ) { s . println ( "--- ROOT CAUSE ---" ) ; mRootCause . printStackTrace ( s ) ; }
public class UResourceBundle { /** * < strong > [ icu ] < / strong > Creates a UResourceBundle , from which users can extract resources by using * their corresponding keys . < br > < br > * Note : Please use this API for loading non - ICU resources . Java security does not * allow loading of resources across jar ...
if ( baseName == null ) { baseName = ICUData . ICU_BASE_NAME ; } if ( locale == null ) { locale = ULocale . getDefault ( ) ; } return getBundleInstance ( baseName , locale . getBaseName ( ) , loader , false ) ;
public class Matrix3x2f { /** * / * ( non - Javadoc ) * @ see org . joml . Matrix3x2fc # positiveX ( org . joml . Vector2f ) */ public Vector2f positiveX ( Vector2f dir ) { } }
float s = m00 * m11 - m01 * m10 ; s = 1.0f / s ; dir . x = m11 * s ; dir . y = - m01 * s ; return dir . normalize ( dir ) ;
public class DSLSAMLAuthenticationProvider { /** * Profile for consumption of processed messages , must be set . * @ param consumer consumer */ @ Override @ Autowired ( required = false ) @ Qualifier ( "webSSOprofileConsumer" ) public void setConsumer ( WebSSOProfileConsumer consumer ) { } }
Assert . notNull ( consumer , "WebSSO Profile Consumer can't be null" ) ; this . consumer = consumer ;
public class HttpRequestHandlerAdapter { /** * parameter : channel - WebSockectEmulatedChannel */ public boolean isWebSocketClosing ( HttpRequest request ) { } }
Channel channel = getWebSocketChannel ( request ) ; if ( channel != null && channel . getParent ( ) != null ) { WebSocketCompositeChannel parent = ( WebSocketCompositeChannel ) channel . getParent ( ) ; if ( parent != null ) { return parent . getReadyState ( ) == ReadyState . CLOSED || parent . getReadyState ( ) == Rea...
public class Smb2CreateResponse { /** * { @ inheritDoc } * @ throws Smb2ProtocolDecodingException * @ see jcifs . internal . smb2 . ServerMessageBlock2 # readBytesWireFormat ( byte [ ] , int ) */ @ Override protected int readBytesWireFormat ( byte [ ] buffer , int bufferIndex ) throws SMBProtocolDecodingException {...
int start = bufferIndex ; int structureSize = SMBUtil . readInt2 ( buffer , bufferIndex ) ; if ( structureSize != 89 ) { throw new SMBProtocolDecodingException ( "Structure size is not 89" ) ; } this . oplockLevel = buffer [ bufferIndex + 2 ] ; this . openFlags = buffer [ bufferIndex + 3 ] ; bufferIndex += 4 ; this . c...
public class RuleBasedTimeZone { /** * { @ inheritDoc } */ @ Override public TimeZoneTransition getPreviousTransition ( long base , boolean inclusive ) { } }
complete ( ) ; if ( historicTransitions == null ) { return null ; } TimeZoneTransition result ; TimeZoneTransition tzt = historicTransitions . get ( 0 ) ; long tt = tzt . getTime ( ) ; if ( inclusive && tt == base ) { result = tzt ; } else if ( tt >= base ) { return null ; } else { int idx = historicTransitions . size ...
public class UsersApi { /** * Delete User Application Properties * Deletes a user & # 39 ; s application properties * @ param userId User Id ( required ) * @ param aid Application ID ( optional ) * @ return ApiResponse & lt ; PropertiesEnvelope & gt ; * @ throws ApiException If fail to call the API , e . g . ...
com . squareup . okhttp . Call call = deleteUserPropertiesValidateBeforeCall ( userId , aid , null , null ) ; Type localVarReturnType = new TypeToken < PropertiesEnvelope > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class OjbTagsHandler { /** * Returns the current definition on the indicated level . * @ param level The level * @ return The definition */ private DefBase getDefForLevel ( String level ) { } }
if ( LEVEL_CLASS . equals ( level ) ) { return _curClassDef ; } else if ( LEVEL_FIELD . equals ( level ) ) { return _curFieldDef ; } else if ( LEVEL_REFERENCE . equals ( level ) ) { return _curReferenceDef ; } else if ( LEVEL_COLLECTION . equals ( level ) ) { return _curCollectionDef ; } else if ( LEVEL_OBJECT_CACHE . ...
public class IdToObjectMap { /** * Returns an iterator with which to browse the values * @ return Iterator */ public Iterator iterator ( ) { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "iterator" ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "iterator" ) ; return map . values ( ) . iterator ( ) ;
public class Configuration { /** * Get the column override * @ param key schema and table * @ param column column * @ return overridden column */ public String getColumnOverride ( SchemaAndTable key , String column ) { } }
return nameMapping . getColumnOverride ( key , column ) . or ( column ) ;
public class DcosSpec { /** * A PUT request over the body value . * @ param key * @ param value * @ param service * @ throws Exception */ @ Then ( "^I add a new DCOS label with key '(.+?)' and value '(.+?)' to the service '(.+?)'?$" ) public void sendAppendRequest ( String key , String value , String service ) ...
commonspec . runCommandAndGetResult ( "touch " + service + ".json && dcos marathon app show " + service + " > /dcos/" + service + ".json" ) ; commonspec . runCommandAndGetResult ( "cat /dcos/" + service + ".json" ) ; String configFile = commonspec . getRemoteSSHConnection ( ) . getResult ( ) ; String myValue = commonsp...
public class BNFHeadersImpl { /** * @ see com . ibm . wsspi . genericbnf . HeaderStorage # setLimitOfTokenSize ( int ) */ @ Override public void setLimitOfTokenSize ( int size ) { } }
if ( 0 >= size ) { throw new IllegalArgumentException ( "Invalid limit on token size: " + size ) ; } this . limitTokenSize = size ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Limit on token size now: " + this . limitTokenSize ) ; }
public class WebDriverTool { /** * Finds all elements . Uses the internal { @ link WebElementFinder } . * @ param by * the { @ link By } used to locate the elements * @ return the list of elements */ @ Override public List < WebElement > findElements ( final By by ) { } }
return wef . by ( by ) . findAll ( ) ;
public class IndexingConfigurationImpl { /** * { @ inheritDoc } */ public void init ( Element config , QueryHandlerContext context , NamespaceMappings nsMappings ) throws Exception { } }
ism = context . getItemStateManager ( ) ; NamespaceAccessor nsResolver = new AdditionalNamespaceResolver ( getNamespaces ( config ) ) ; resolver = new LocationFactory ( nsResolver ) ; // new // ParsingNameResolver ( NameFactoryImpl . getInstance ( ) , // nsResolver ) ; NodeTypeDataManager ntReg = context . getNodeTypeD...
public class Widget { /** * Called when this { @ link Widget } has had line - of - sight focus for more than * { @ link # getLongFocusTimeout ( ) } milliseconds . Notifies all * { @ linkplain OnFocusListener # onLongFocus ( ) listeners } ; if none of the * listeners has completely handled the event , { @ link # o...
final List < OnFocusListener > focusListeners ; synchronized ( mFocusListeners ) { focusListeners = new ArrayList < > ( mFocusListeners ) ; } for ( OnFocusListener listener : focusListeners ) { if ( listener . onLongFocus ( this ) ) { return ; } } onLongFocus ( ) ; final boolean inFollowFocusGroup = isInFollowFocusGrou...
public class InviteUsersRequest { /** * The user email addresses to which to send the invite . * @ param userEmailList * The user email addresses to which to send the invite . */ public void setUserEmailList ( java . util . Collection < String > userEmailList ) { } }
if ( userEmailList == null ) { this . userEmailList = null ; return ; } this . userEmailList = new java . util . ArrayList < String > ( userEmailList ) ;
public class FilterImpl { /** * ( non - Javadoc ) * @ see com . impetus . kundera . classreading . Filter # accepts ( java . lang . String ) */ @ Override public final boolean accepts ( String filename ) { } }
if ( filename . endsWith ( ".class" ) ) { if ( filename . startsWith ( "/" ) ) { filename = filename . substring ( 1 ) ; } if ( ! ignoreScan ( filename . replace ( '/' , '.' ) ) ) { return true ; } } return false ;
public class LoggingConfiguration { /** * Kick start the blitz4j implementation . * @ param props * - The overriding < em > log4j < / em > properties if any . */ public void configure ( Properties props ) { } }
this . refreshCount . set ( 0 ) ; this . overrideProps . clear ( ) ; this . originalAsyncAppenderNameMap . clear ( ) ; // First try to load the log4j configuration file from the classpath String log4jConfigurationFile = System . getProperty ( PROP_LOG4J_CONFIGURATION ) ; NFHierarchy nfHierarchy = null ; // Make log4j u...
public class responderhtmlpage { /** * Use this API to fetch all the responderhtmlpage resources that are configured on netscaler . */ public static responderhtmlpage get ( nitro_service service ) throws Exception { } }
responderhtmlpage obj = new responderhtmlpage ( ) ; responderhtmlpage [ ] response = ( responderhtmlpage [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ;
public class Lockable { /** * Write - lock key and delete ; blocking . * Throws IAE if the key is already locked . */ public static void delete ( Key key ) { } }
Value val = DKV . get ( key ) ; if ( val == null ) return ; ( ( Lockable ) val . get ( ) ) . delete ( ) ;
public class RTMPProtocolEncoder { /** * Encode packet . * @ param packet * RTMP packet * @ return Encoded data */ public IoBuffer encodePacket ( Packet packet ) { } }
IoBuffer out = null ; Header header = packet . getHeader ( ) ; int channelId = header . getChannelId ( ) ; // log . trace ( " Channel id : { } " , channelId ) ; IRTMPEvent message = packet . getMessage ( ) ; if ( message instanceof ChunkSize ) { ChunkSize chunkSizeMsg = ( ChunkSize ) message ; ( ( RTMPConnection ) Red5...
public class Options { /** * Return the value of the named property . * @ param name String property name * @ return int value of property * @ throws OptionsException */ @ Override public int getIntProperty ( final String name ) throws OptionsException { } }
String val = getStringProperty ( name ) ; try { return Integer . valueOf ( val ) . intValue ( ) ; } catch ( Throwable t ) { throw new OptionsException ( "org.bedework.calenv.bad.option.value" ) ; }
public class Skip32 { /** * Applies the SKIP32 function on the provided value stored in buf and * modifies it inplace . This is a low - level function used by the encrypt and * decrypt functions . * @ param key * @ param buf * @ param encrypt */ public static void skip32 ( byte [ ] key , int [ ] buf , boolean...
int k ; /* round number */ int i ; /* round counter */ int kstep ; int wl , wr ; /* sort out direction */ if ( encrypt ) { kstep = 1 ; k = 0 ; } else { kstep = - 1 ; k = 23 ; } /* pack into words */ wl = ( buf [ 0 ] << 8 ) + buf [ 1 ] ; wr = ( buf [ 2 ] << 8 ) + buf [ 3 ] ; /* 24 feistel rounds , doubled up */ for ( i ...
public class ChemObjectIO { /** * { @ inheritDoc } */ @ Override public void addSettings ( Collection < IOSetting > settings ) { } }
for ( IOSetting setting : settings ) { if ( hasSetting ( setting . getName ( ) ) ) { try { getSetting ( setting . getName ( ) ) . setSetting ( setting . getSetting ( ) ) ; } catch ( CDKException ex ) { // setting value was invalid ( ignore as we already have a value for this setting // and we can ' t throw CDKException...