signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class OMVRBTree { /** * Returns the successor of the specified Entry , or null if no such . */ public static < K , V > OMVRBTreeEntry < K , V > successor ( final OMVRBTreeEntry < K , V > t ) { } }
if ( t == null ) return null ; OMVRBTreeEntry < K , V > p = null ; if ( t . getRight ( ) != null ) { p = t . getRight ( ) ; while ( p . getLeft ( ) != null ) p = p . getLeft ( ) ; } else { p = t . getParent ( ) ; OMVRBTreeEntry < K , V > ch = t ; while ( p != null && ch == p . getRight ( ) ) { ch = p ; p = p . getParen...
class CountSubstrings { /** * Function to calculate the number of non - empty substrings in a given string . * Args : * s ( str ) : Input string * Returns : * int : Count of non - empty substrings * Examples : * > > > count _ substrings ( ' abc ' ) * > > > count _ substrings ( ' abcd ' ) * 10 * > > > ...
int stringLength = s . length ( ) ; return ( stringLength * ( stringLength + 1 ) ) / 2 ;
public class CUstreamWaitValue_flags { /** * Returns the String identifying the given CUstreamWaitValue _ flags * @ param n The CUstreamWaitValue _ flags * @ return The String identifying the given CUstreamWaitValue _ flags */ public static String stringFor ( int n ) { } }
if ( n == 0 ) { return "CU_STREAM_WAIT_VALUE_GEQ" ; } String result = "" ; if ( ( n & CU_STREAM_WAIT_VALUE_EQ ) != 0 ) result += "CU_STREAM_WAIT_VALUE_EQ " ; if ( ( n & CU_STREAM_WAIT_VALUE_AND ) != 0 ) result += "CU_STREAM_WAIT_VALUE_AND " ; if ( ( n & CU_STREAM_WAIT_VALUE_NOR ) != 0 ) result += "CU_STREAM_WAIT_VALUE_...
public class MacroParametersUtils { /** * < p > extractParameter . < / p > * @ param name a { @ link java . lang . String } object . * @ param parameters a { @ link java . util . Map } object . * @ return a { @ link java . lang . String } object . */ public static String extractParameter ( String name , Map param...
Object value = parameters . get ( name ) ; return ( value != null ) ? xssEscape ( value . toString ( ) ) : "" ;
public class ModelUtils { /** * Gets the value of a property . * @ param holder a property holder ( not null ) * @ param propertyName a property name ( not null ) * @ return the property value , which can be null , or null if the property was not found */ public static String getPropertyValue ( AbstractBlockHolde...
BlockProperty p = holder . findPropertyBlockByName ( propertyName ) ; return p == null ? null : p . getValue ( ) ;
public class AWSGreengrassClient { /** * Lists the versions of a logger definition . * @ param listLoggerDefinitionVersionsRequest * @ return Result of the ListLoggerDefinitionVersions operation returned by the service . * @ throws BadRequestException * invalid request * @ sample AWSGreengrass . ListLoggerDef...
request = beforeClientExecution ( request ) ; return executeListLoggerDefinitionVersions ( request ) ;
public class DefaultQueryLogEntryCreator { /** * Write elapsed time . * < p > default : Time : 123, * The unit of time is determined by underlying { @ link net . ttddyy . dsproxy . proxy . Stopwatch } implementation . * ( milli vs nano seconds ) * @ param sb StringBuilder to write * @ param execInfo execution...
sb . append ( "Time:" ) ; sb . append ( execInfo . getElapsedTime ( ) ) ; sb . append ( ", " ) ;
public class ReflectionUtils { /** * Returns the field objects that are declared in the given class or any of * it ' s super types that have any of the given modifiers . The type hierarchy * is traversed upwards and all declared fields that match the given * modifiers are added to the result array . The elements ...
final Set < Field > fields = new TreeSet < Field > ( FIELD_NAME_AND_DECLARING_CLASS_COMPARATOR ) ; traverseHierarchy ( clazz , new TraverseTask < Field > ( ) { @ Override public Field run ( Class < ? > clazz ) { Field [ ] fieldArray = clazz . getDeclaredFields ( ) ; for ( int i = 0 ; i < fieldArray . length ; i ++ ) { ...
public class LinkGenerator { /** * Writes int array into stream . * @ param bytes int array * @ param outStream stream * @ throws IOException { @ link IOException } */ private void writeInts ( int [ ] bytes , OutputStream outStream ) throws IOException { } }
for ( int i = 0 ; i < bytes . length ; i ++ ) { byte curByte = ( byte ) bytes [ i ] ; outStream . write ( curByte ) ; }
public class HashPartition { /** * Gets the number of memory segments used by this partition , which includes build side * memory buffers and overflow memory segments . * @ return The number of occupied memory segments . */ public int getNumOccupiedMemorySegments ( ) { } }
// either the number of memory segments , or one for spilling final int numPartitionBuffers = this . partitionBuffers != null ? this . partitionBuffers . length : this . buildSideWriteBuffer . getNumOccupiedMemorySegments ( ) ; return numPartitionBuffers + numOverflowSegments ;
public class CachingOnlineUpdateUASparser { /** * This implementation uses a local properties file to keep the lastUpdate time and the local data file version */ @ Override protected synchronized void checkDataMaps ( ) throws IOException { } }
if ( lastUpdateCheck == 0 || lastUpdateCheck < System . currentTimeMillis ( ) - updateInterval ) { String versionOnServer = getVersionFromServer ( ) ; if ( currentVersion == null || versionOnServer . compareTo ( currentVersion ) > 0 ) { loadDataFromInternetAndSave ( ) ; loadDataFromFile ( getCacheFile ( ) ) ; currentVe...
public class FaceListsImpl { /** * Retrieve a face list ' s information . * @ param faceListId Id referencing a particular face list . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ ...
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( faceListId ) , serviceCallback ) ;
public class ApiClient { /** * Helper method to configure the OAuth accessCode / implicit flow parameters * @ param clientId OAuth2 client ID * @ param clientSecret OAuth2 client secret * @ param redirectURI OAuth2 redirect uri */ public void configureAuthorizationFlow ( String clientId , String clientSecret , St...
for ( Authentication auth : authentications . values ( ) ) { if ( auth instanceof OAuth ) { OAuth oauth = ( OAuth ) auth ; oauth . getTokenRequestBuilder ( ) . setClientId ( clientId ) . setClientSecret ( clientSecret ) . setRedirectURI ( redirectURI ) ; oauth . getAuthenticationRequestBuilder ( ) . setClientId ( clien...
public class TenantedAuthorizationFacetDefault { /** * Per { @ link # findApplicationUserNoCache ( String ) } , cached for the request using the { @ link QueryResultsCache } . */ protected ApplicationUser findApplicationUser ( final String userName ) { } }
return queryResultsCache . execute ( new Callable < ApplicationUser > ( ) { @ Override public ApplicationUser call ( ) throws Exception { return findApplicationUserNoCache ( userName ) ; } } , TenantedAuthorizationFacetDefault . class , "findApplicationUser" , userName ) ;
public class DataDecoder { /** * Decodes an encoded string from the given byte array . * @ param src source of encoded data * @ param srcOffset offset into encoded data * @ param valueRef decoded string is stored in element 0 , which may be null * @ return amount of bytes read from source * @ throws CorruptEn...
try { final int originalOffset = srcOffset ; int b = src [ srcOffset ++ ] & 0xff ; if ( b >= 0xf8 ) { valueRef [ 0 ] = null ; return 1 ; } int valueLength ; if ( b <= 0x7f ) { valueLength = b ; } else if ( b <= 0xbf ) { valueLength = ( ( b & 0x3f ) << 8 ) | ( src [ srcOffset ++ ] & 0xff ) ; } else if ( b <= 0xdf ) { va...
public class ProposalLineItemServiceLocator { /** * For the given interface , get the stub implementation . * If this service has no port for the given interface , * then ServiceException is thrown . */ public java . rmi . Remote getPort ( Class serviceEndpointInterface ) throws javax . xml . rpc . ServiceException...
try { if ( com . google . api . ads . admanager . axis . v201808 . ProposalLineItemServiceInterface . class . isAssignableFrom ( serviceEndpointInterface ) ) { com . google . api . ads . admanager . axis . v201808 . ProposalLineItemServiceSoapBindingStub _stub = new com . google . api . ads . admanager . axis . v201808...
public class ST_ClosestCoordinate { /** * Computes the closest coordinate ( s ) contained in the given geometry starting * from the given point , using the 2D distance . * @ param point Point * @ param geom Geometry * @ return The closest coordinate ( s ) contained in the given geometry starting from * the gi...
if ( point == null || geom == null ) { return null ; } double minDistance = Double . POSITIVE_INFINITY ; Coordinate pointCoordinate = point . getCoordinate ( ) ; Set < Coordinate > closestCoordinates = new HashSet < Coordinate > ( ) ; for ( Coordinate c : geom . getCoordinates ( ) ) { double distance = c . distance ( p...
public class PyGenerator { /** * Generate the given object . * @ param clazz the class . * @ param it the target for the generated content . * @ param context the context . */ protected void _generate ( SarlClass clazz , PyAppendable it , IExtraLanguageGeneratorContext context ) { } }
generateTypeDeclaration ( this . qualifiedNameProvider . getFullyQualifiedName ( clazz ) . toString ( ) , clazz . getName ( ) , clazz . isAbstract ( ) , getSuperTypes ( clazz . getExtends ( ) , clazz . getImplements ( ) ) , getTypeBuilder ( ) . getDocumentation ( clazz ) , true , clazz . getMembers ( ) , it , context ,...
public class CBLVersion { /** * This is information about this library build . */ public static String getVersionInfo ( ) { } }
String info = versionInfo . get ( ) ; if ( info == null ) { info = String . format ( Locale . ENGLISH , VERSION_INFO , BuildConfig . VERSION_NAME , getLibInfo ( ) , BuildConfig . BUILD_TIME , BuildConfig . BUILD_HOST , getSysInfo ( ) ) ; versionInfo . compareAndSet ( null , info ) ; } return info ;
public class WebcamHelper { /** * Consume the java . awt . BufferedImage from the webcam , all params required . * @ param image The image to process . * @ param processor Processor that handles the exchange . * @ param endpoint WebcamEndpoint receiving the exchange . */ public static void consumeBufferedImage ( ...
Validate . notNull ( image ) ; Validate . notNull ( processor ) ; Validate . notNull ( endpoint ) ; try { Exchange exchange = createOutOnlyExchangeWithBodyAndHeaders ( endpoint , image ) ; processor . process ( exchange ) ; } catch ( Exception e ) { exceptionHandler . handleException ( e ) ; }
public class ValidationSessionHolderImpl { /** * / * ( non - Javadoc ) * @ see nz . co . senanque . validationengine . ValidationSessionHolder # bind ( java . lang . Object ) */ @ Override public void bind ( Object context ) { } }
if ( m_validationEngine != null && context instanceof ValidationObject ) { m_validationSession = m_validationEngine . createSession ( ) ; m_validationSession . bind ( ( ValidationObject ) context ) ; }
public class AppServicePlansInner { /** * Get all apps that use a Hybrid Connection in an App Service Plan . * Get all apps that use a Hybrid Connection in an App Service Plan . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service plan . *...
ServiceResponse < Page < String > > response = listWebAppsByHybridConnectionSinglePageAsync ( resourceGroupName , name , namespaceName , relayName ) . toBlocking ( ) . single ( ) ; return new PagedList < String > ( response . body ( ) ) { @ Override public Page < String > nextPage ( String nextPageLink ) { return listW...
public class MappeableArrayContainer { /** * for use in inot range known to be nonempty */ private void negateRange ( final ShortBuffer buffer , final int startIndex , final int lastIndex , final int startRange , final int lastRange ) { } }
// compute the negation into buffer int outPos = 0 ; int inPos = startIndex ; // value here always > = valInRange , // until it is exhausted // n . b . , we can start initially exhausted . int valInRange = startRange ; for ( ; valInRange < lastRange && inPos <= lastIndex ; ++ valInRange ) { if ( ( short ) valInRange !=...
public class VariableAssigner { /** * { @ inheritDoc } */ @ Override public void assign ( final ICmdLineArg < ? > arg , final Object target ) throws ParseException { } }
if ( arg == null ) return ; if ( target == null ) return ; final String errMsg = "expected: " + arg . getValue ( ) . getClass ( ) . getName ( ) + " " + arg . getVariable ( ) + " on " + target . getClass ( ) . getName ( ) ; final Field field = findFieldInAnyParentOrMyself ( arg , target . getClass ( ) , errMsg ) ; assig...
public class InstanceEntryMarshaller { /** * Marshall the given parameter object . */ public void marshall ( InstanceEntry instanceEntry , ProtocolMarshaller protocolMarshaller ) { } }
if ( instanceEntry == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( instanceEntry . getSourceName ( ) , SOURCENAME_BINDING ) ; protocolMarshaller . marshall ( instanceEntry . getInstanceType ( ) , INSTANCETYPE_BINDING ) ; protocolMarshalle...
public class StorageAccountCredentialsInner { /** * Creates or updates the storage account credential . * @ param deviceName The device name . * @ param name The storage account credential name . * @ param resourceGroupName The resource group name . * @ param storageAccountCredential The storage account credent...
return createOrUpdateWithServiceResponseAsync ( deviceName , name , resourceGroupName , storageAccountCredential ) . map ( new Func1 < ServiceResponse < StorageAccountCredentialInner > , StorageAccountCredentialInner > ( ) { @ Override public StorageAccountCredentialInner call ( ServiceResponse < StorageAccountCredenti...
public class TwoDropDownChoicesPanel { /** * Factory method for creating the new child { @ link DropDownChoice } . This * method is invoked in the constructor from the derived classes and can be * overridden so users can provide their own version of a new child * { @ link DropDownChoice } . * @ param id * the...
final DropDownChoice < T > cc = new LocalisedDropDownChoice < > ( id , model , choices , renderer ) ; cc . setOutputMarkupId ( true ) ; return cc ;
public class Provider { /** * Returns an unmodifiable Set view of the property entries contained * in this Provider . * @ see java . util . Map . Entry * @ since 1.2 */ public synchronized Set < Map . Entry < Object , Object > > entrySet ( ) { } }
checkInitialized ( ) ; if ( entrySet == null ) { if ( entrySetCallCount ++ == 0 ) // Initial call entrySet = Collections . unmodifiableMap ( this ) . entrySet ( ) ; else return super . entrySet ( ) ; // Recursive call } // This exception will be thrown if the implementation of // Collections . unmodifiableMap . entrySe...
public class PrintWriter { /** * Closes the stream and releases any system resources associated * with it . Closing a previously closed stream has no effect . * @ see # checkError ( ) */ public void close ( ) { } }
try { synchronized ( lock ) { if ( out == null ) return ; out . close ( ) ; out = null ; } } catch ( IOException x ) { trouble = true ; }
public class NetworkServiceDescriptorAgent { /** * Update a specific VirtualNetworkFunctionDescriptor that is contained in a particular * NetworkServiceDescriptor . * @ param idNSD the ID of the NetworkServiceRecord containing the VirtualNetworkFunctionDescriptor * @ param idVfn the ID of the VNF Descriptor that ...
String url = idNSD + "/vnfdescriptors" + "/" + idVfn ; return ( VirtualNetworkFunctionDescriptor ) requestPut ( url , virtualNetworkFunctionDescriptor ) ;
public class HtmlDocletWriter { /** * Get the link for the given member . * @ param context the id of the context where the link will be added * @ param element the member being linked to * @ param label the label for the link * @ return a content tree for the element link */ public Content getDocLink ( LinkInf...
return getDocLink ( context , utils . getEnclosingTypeElement ( element ) , element , new StringContent ( label ) ) ;
public class PeriodFormatterBuilder { /** * Append a separator , which is output if fields are printed both before * and after the separator . * This method changes the separator depending on whether it is the last separator * to be output . * For example , < code > builder . appendDays ( ) . appendSeparator ( ...
return appendSeparator ( text , finalText , null , true , true ) ;
public class InsightResultsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( InsightResults insightResults , ProtocolMarshaller protocolMarshaller ) { } }
if ( insightResults == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( insightResults . getInsightArn ( ) , INSIGHTARN_BINDING ) ; protocolMarshaller . marshall ( insightResults . getGroupByAttribute ( ) , GROUPBYATTRIBUTE_BINDING ) ; protoc...
public class JedisRedisClient { /** * { @ inheritDoc } */ @ Override public Set < String > setMembers ( String setName ) { } }
Set < String > result = redisClient . smembers ( setName ) ; return result != null ? result : new HashSet < String > ( ) ;
public class ByteUtil { /** * Converts from ByteSequence to Bytes . If the ByteSequence has a backing array , that array ( and * the buffer ' s offset and limit ) are used . Otherwise , a new backing array is created . * @ param bs ByteSequence * @ return Bytes object */ public static Bytes toBytes ( ByteSequence...
if ( bs . length ( ) == 0 ) { return Bytes . EMPTY ; } if ( bs . isBackedByArray ( ) ) { return Bytes . of ( bs . getBackingArray ( ) , bs . offset ( ) , bs . length ( ) ) ; } else { return Bytes . of ( bs . toArray ( ) , 0 , bs . length ( ) ) ; }
public class BundleAdjustmentProjectiveResidualFunction { /** * projection from 3D coordinates */ private void project3 ( double [ ] output ) { } }
int observationIndex = 0 ; for ( int viewIndex = 0 ; viewIndex < structure . views . length ; viewIndex ++ ) { SceneStructureProjective . View view = structure . views [ viewIndex ] ; SceneObservations . View obsView = observations . views [ viewIndex ] ; for ( int i = 0 ; i < obsView . size ( ) ; i ++ ) { obsView . ge...
public class ModelSqlUtils { /** * 获取属性的getter方法 * @ param clazz * @ param f * @ return */ private static < T > Method getGetter ( Class < T > clazz , Field f ) { } }
String getterName = "get" + StringUtils . capitalize ( f . getName ( ) ) ; Method getter = null ; try { getter = clazz . getMethod ( getterName ) ; } catch ( Exception e ) { logger . debug ( getterName + " doesn't exist!" , e ) ; } return getter ;
public class MpJwtAppSetupUtils { public void deployMicroProfileApp ( LibertyServer server ) throws Exception { } }
List < String > classList = createAppClassList ( "com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjection.ApplicationScoped.Instance.MicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjection.NotScoped.MicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjection.RequestScoped.MicroProfileApp" , "com...
public class ActionSyncTask { /** * Run to doing something */ @ Override public void run ( ) { } }
if ( ! mDone ) { synchronized ( this ) { if ( ! mDone ) { call ( ) ; mDone = true ; try { this . notifyAll ( ) ; } catch ( Exception ignored ) { } } } }
public class CmdMethod { /** * Returns a single line description of the command */ @ Override public String getUsage ( ) { } }
String commandName = name ; Class < ? > declaringClass = method . getDeclaringClass ( ) ; Map < String , Cmd > commands = Commands . get ( declaringClass ) ; if ( commands . size ( ) == 1 && commands . values ( ) . iterator ( ) . next ( ) instanceof CmdGroup ) { final CmdGroup cmdGroup = ( CmdGroup ) commands . values ...
public class BitmapContainer { /** * Find the index of the next set bit greater or equal to i , returns - 1 if none found . * @ param i starting index * @ return index of the next set bit */ public int nextSetBit ( final int i ) { } }
int x = i >> 6 ; long w = bitmap [ x ] ; w >>>= i ; if ( w != 0 ) { return i + numberOfTrailingZeros ( w ) ; } for ( ++ x ; x < bitmap . length ; ++ x ) { if ( bitmap [ x ] != 0 ) { return x * 64 + numberOfTrailingZeros ( bitmap [ x ] ) ; } } return - 1 ;
public class ApplicationSecurityGroupsInner { /** * Gets information about the specified application security group . * @ param resourceGroupName The name of the resource group . * @ param applicationSecurityGroupName The name of the application security group . * @ param serviceCallback the async ServiceCallback...
return ServiceFuture . fromResponse ( getByResourceGroupWithServiceResponseAsync ( resourceGroupName , applicationSecurityGroupName ) , serviceCallback ) ;
public class RegistrationRequest { /** * Create an object from a registration request formatted as a json string . */ public static RegistrationRequest fromJson ( Map < String , Object > raw ) throws JsonException { } }
// If we could , we ' d just get Json to coerce this for us , but that would lead to endless // recursion as the first thing it would do would be to call this very method . * sigh * Json json = new Json ( ) ; RegistrationRequest request = new RegistrationRequest ( ) ; if ( raw . get ( "name" ) instanceof String ) { req...
public class DocletInvoker { /** * Return the language version supported by this doclet . * If the method does not exist in the doclet , assume version 1.1. */ public LanguageVersion languageVersion ( ) { } }
try { Object retVal ; String methodName = "languageVersion" ; Class < ? > [ ] paramTypes = new Class < ? > [ 0 ] ; Object [ ] params = new Object [ 0 ] ; try { retVal = invoke ( methodName , JAVA_1_1 , paramTypes , params ) ; } catch ( DocletInvokeException exc ) { return JAVA_1_1 ; } if ( retVal instanceof LanguageVer...
public class HttpBasicAuthCredentials { /** * Gets the encoded representation of the basic authentication credentials * for use in an HTTP Authorization header . * @ return String */ public String getHeader ( ) { } }
String authPair = username + ':' + apiKey ; return "Basic " + Base64 . getEncoder ( ) . encodeToString ( authPair . getBytes ( ) ) ;
public class AmazonIdentityManagementClient { /** * Sets the status of a service - specific credential to < code > Active < / code > or < code > Inactive < / code > . * Service - specific credentials that are inactive cannot be used for authentication to the service . This operation * can be used to disable a user ...
request = beforeClientExecution ( request ) ; return executeUpdateServiceSpecificCredential ( request ) ;
public class Ray2 { /** * Returns the parameter of the ray when it intersects the supplied point , or * { @ link Float # MAX _ VALUE } if there is no such intersection . */ protected double getIntersection ( IVector pt ) { } }
if ( Math . abs ( direction . x ) > Math . abs ( direction . y ) ) { double t = ( pt . x ( ) - origin . x ) / direction . x ; return ( t >= 0f && origin . y + t * direction . y == pt . y ( ) ) ? t : Float . MAX_VALUE ; } else { double t = ( pt . y ( ) - origin . y ) / direction . y ; return ( t >= 0f && origin . x + t ...
public class Train { /** * save the embedded training set */ private File saveExampleSet ( ExampleSet outputSet , ZipModel model ) throws IOException { } }
logger . info ( "save the embedded training set" ) ; File tmp = File . createTempFile ( "train" , null ) ; tmp . deleteOnExit ( ) ; // File tmp = new File ( " examples / train " ) ; BufferedWriter out = new BufferedWriter ( new FileWriter ( tmp ) ) ; outputSet . write ( out ) ; out . close ( ) ; // add the example set ...
public class ExecutionEnvironment { /** * - - - - - File Input Format - - - - - */ public < X > DataSource < X > readFile ( FileInputFormat < X > inputFormat , String filePath ) { } }
if ( inputFormat == null ) { throw new IllegalArgumentException ( "InputFormat must not be null." ) ; } if ( filePath == null ) { throw new IllegalArgumentException ( "The file path must not be null." ) ; } inputFormat . setFilePath ( new Path ( filePath ) ) ; try { return createInput ( inputFormat , TypeExtractor . ge...
public class BaseProfile { /** * generate code * @ param def Definition */ @ Override public void generate ( Definition def ) { } }
generatePackageInfo ( def , "main" , null ) ; generateRaCode ( def ) ; generateOutboundCode ( def ) ; generateInboundCode ( def ) ; generateTestCode ( def ) ; switch ( def . getBuild ( ) ) { case "ivy" : generateAntIvyXml ( def , def . getOutputDir ( ) ) ; break ; case "maven" : generateMavenXml ( def , def . getOutput...
public class PrintView { /** * Creates an application - modal dialog and shows it after adding the print * view to it . * @ param owner * the owner window of the dialog */ public void show ( Window owner ) { } }
InvalidationListener viewTypeListener = obs -> loadDropDownValues ( getDate ( ) ) ; if ( dialog != null ) { dialog . show ( ) ; } else { TimeRangeView timeRange = getSettingsView ( ) . getTimeRangeView ( ) ; Scene scene = new Scene ( this ) ; dialog = new Stage ( ) ; dialog . initOwner ( owner ) ; dialog . setScene ( s...
public class Vector { /** * Gets the angle between this vector and another in radians . * @ param other The other vector * @ return angle in radians */ public float angle ( Vector other ) { } }
double dot = dot ( other ) / ( length ( ) * other . length ( ) ) ; return ( float ) Math . acos ( dot ) ;
public class MetricInfo { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */ public boolean isSet ( _Fields field ) { } }
if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case METRICS : return is_set_metrics ( ) ; } throw new IllegalStateException ( ) ;
public class KeyValueAuthHandler { /** * Handles an incoming SASL list mechanisms response and dispatches the next SASL AUTH step . * @ param ctx the handler context . * @ param msg the incoming message to investigate . * @ throws Exception if something goes wrong during negotiation . */ private void handleListMe...
String remote = ctx . channel ( ) . remoteAddress ( ) . toString ( ) ; String [ ] supportedMechanisms = msg . content ( ) . toString ( CharsetUtil . UTF_8 ) . split ( " " ) ; if ( supportedMechanisms . length == 0 ) { throw new AuthenticationException ( "Received empty SASL mechanisms list from server: " + remote ) ; }...
public class ElemLiteralResult { /** * Get a literal result attribute by name . * @ param namespaceURI Namespace URI of attribute node to get * @ param localName Local part of qualified name of attribute node to get * @ return literal result attribute ( AVT ) */ public AVT getLiteralResultAttributeNS ( String nam...
if ( null != m_avts ) { int nAttrs = m_avts . size ( ) ; for ( int i = ( nAttrs - 1 ) ; i >= 0 ; i -- ) { AVT avt = ( AVT ) m_avts . get ( i ) ; if ( avt . getName ( ) . equals ( localName ) && avt . getURI ( ) . equals ( namespaceURI ) ) { return avt ; } } // end for } return null ;
public class StringMan { /** * Returns the specified string value if input is null , otherwise returns the original input * string untouched . * @ param input * String to be evaluated * @ param value * String to substitute if input is null */ public static String getNullAsValue ( String input , String value )...
return ( input == null ) ? value : input ;
public class ApiConnectionImpl { /** * Create a new API connection to the give device on the supplied port * @ param fact The socket factory used to construct the connection socket . * @ param host The host to which to connect . * @ param port The TCP port to use . * @ param timeOut The connection timeout * @...
ApiConnectionImpl con = new ApiConnectionImpl ( ) ; con . open ( host , port , fact , timeOut ) ; return con ;
public class Point3dfx { /** * Convert the given tuple to a real Point3dfx . * < p > If the given tuple is already a Point3dfx , it is replied . * @ param tuple the tuple . * @ return the Point3dfx . * @ since 14.0 */ public static Point3dfx convert ( Tuple3D < ? > tuple ) { } }
if ( tuple instanceof Point3dfx ) { return ( Point3dfx ) tuple ; } return new Point3dfx ( tuple . getX ( ) , tuple . getY ( ) , tuple . getZ ( ) ) ;
public class Streams { /** * Create a CompletableFuture containing a List materialized from a Stream * @ param stream To convert into an Optional * @ return CompletableFuture with a List of values */ public final static < T > CompletableFuture < List < T > > streamToCompletableFuture ( final Stream < T > stream ) {...
return CompletableFuture . completedFuture ( stream . collect ( Collectors . toList ( ) ) ) ;
public class ValidationUtils { /** * Returns all validation constraints that are defined by Java annotation in the core classes . * @ return a map of all core types to all core annotated constraints . See JSR - 303. */ public static Map < String , Map < String , Map < String , Map < String , ? > > > > getCoreValidati...
if ( CORE_CONSTRAINTS . isEmpty ( ) ) { for ( Map . Entry < String , Class < ? extends ParaObject > > e : ParaObjectUtils . getCoreClassesMap ( ) . entrySet ( ) ) { String type = e . getKey ( ) ; List < Field > fieldlist = Utils . getAllDeclaredFields ( e . getValue ( ) ) ; for ( Field field : fieldlist ) { Annotation ...
public class Utils { /** * Calculate the scaled residual * < br > | | Ax - b | | _ oo / ( | | A | | _ oo . | | x | | _ oo + | | b | | _ oo ) , with * < br > | | x | | _ oo = max ( | | x [ i ] | | ) */ public static double calculateScaledResidual ( DoubleMatrix2D A , DoubleMatrix1D x , DoubleMatrix1D b ) { } }
double residual = - Double . MAX_VALUE ; double nix = Algebra . DEFAULT . normInfinity ( x ) ; double nib = Algebra . DEFAULT . normInfinity ( b ) ; if ( Double . compare ( nix , 0. ) == 0 && Double . compare ( nib , 0. ) == 0 ) { return 0 ; } else { double num = Algebra . DEFAULT . normInfinity ( ColtUtils . zMult ( A...
public class CallOptions { /** * Returns a new { @ code CallOptions } with a { @ code ClientStreamTracerFactory } in addition to * the existing factories . * < p > This method doesn ' t replace existing factories , or try to de - duplicate factories . */ @ ExperimentalApi ( "https://github.com/grpc/grpc-java/issues...
CallOptions newOptions = new CallOptions ( this ) ; ArrayList < ClientStreamTracer . Factory > newList = new ArrayList < > ( streamTracerFactories . size ( ) + 1 ) ; newList . addAll ( streamTracerFactories ) ; newList . add ( factory ) ; newOptions . streamTracerFactories = Collections . unmodifiableList ( newList ) ;...
public class nstimeout { /** * Use this API to unset the properties of nstimeout resource . * Properties that need to be unset are specified in args array . */ public static base_response unset ( nitro_service client , nstimeout resource , String [ ] args ) throws Exception { } }
nstimeout unsetresource = new nstimeout ( ) ; return unsetresource . unset_resource ( client , args ) ;
public class AbstractHazelcastCachingProvider { /** * from which Config objects can be initialized */ protected boolean isConfigLocation ( URI location ) { } }
String scheme = location . getScheme ( ) ; if ( scheme == null ) { // interpret as place holder try { String resolvedPlaceholder = getProperty ( location . getRawSchemeSpecificPart ( ) ) ; if ( resolvedPlaceholder == null ) { return false ; } location = new URI ( resolvedPlaceholder ) ; scheme = location . getScheme ( ...
public class HtmlBuilder { /** * Add attribute . * @ param name Attribute name * @ param value Attribute value */ public T attr ( String name , String value ) throws IOException { } }
if ( value != null ) { writer . write ( ' ' ) ; writer . write ( name ) ; writer . write ( "=\"" ) ; writer . write ( value ) ; writer . write ( '\"' ) ; } return ( T ) this ;
public class EditText { /** * Gives the text a shadow of the specified blur radius and color , the specified distance from * its drawn position . < p > The text shadow produced does not interact with the properties on * view that are responsible for real time shadows , { @ link View # getElevation ( ) elevation } a...
getView ( ) . setShadowLayer ( radius , dx , dy , color ) ;
public class NioGroovyMethods { /** * Deletes a directory with all contained files and subdirectories . * < p > The method returns * < ul > * < li > true , when deletion was successful < / li > * < li > true , when it is called for a non existing directory < / li > * < li > false , when it is called for a fil...
if ( ! Files . exists ( self ) ) return true ; if ( ! Files . isDirectory ( self ) ) return false ; // delete contained files try ( DirectoryStream < Path > stream = Files . newDirectoryStream ( self ) ) { for ( Path path : stream ) { if ( Files . isDirectory ( path ) ) { if ( ! deleteDir ( path ) ) { return false ; } ...
public class ProtoUtils { /** * Produce a metadata marshaller for a protobuf type . * @ since 1.13.0 */ @ ExperimentalApi ( "https://github.com/grpc/grpc-java/issues/4477" ) public static < T extends Message > Metadata . BinaryMarshaller < T > metadataMarshaller ( T instance ) { } }
return ProtoLiteUtils . metadataMarshaller ( instance ) ;
public class SpiderService { /** * Return the column name used to store the given value for the given link . The column * name uses the format : * < pre > * ~ { link name } / { object ID } * < / pre > * This method should be used for unsharded links or link values to that refer to an * object whose shard nu...
assert linkDef . isLinkField ( ) ; StringBuilder buffer = new StringBuilder ( ) ; buffer . append ( "~" ) ; buffer . append ( linkDef . getName ( ) ) ; buffer . append ( "/" ) ; buffer . append ( objID ) ; return buffer . toString ( ) ;
public class CmsSitemapView { /** * Opens all sitemap tree items on a path , except the last one . < p > * @ param path the path for which all intermediate sitemap items should be opened */ private void openItemsOnPath ( String path ) { } }
List < CmsSitemapTreeItem > itemsOnPath = getItemsOnPath ( path ) ; for ( CmsSitemapTreeItem item : itemsOnPath ) { item . setOpen ( true ) ; }
public class StringUtils { /** * 将目标字符串重复count次返回 * @ param str 目标字符串 * @ param count 次数 * @ return 目标字符串重复count次结果 , 例如目标字符串是test , count是2 , 则返回testtest , 如果count是3则返回testtesttest */ public static String copy ( String str , int count ) { } }
if ( str == null ) { throw new NullPointerException ( "原始字符串不能为null" ) ; } if ( count <= 0 ) { throw new IllegalArgumentException ( "次数必须大于0" ) ; } if ( count == 1 ) { return str ; } if ( count == 2 ) { return str + str ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < count ; i ++ ) { sb . append ( ...
public class ExtendedProperties { /** * Loads properties from the specified stream . The caller of this method is responsible for * closing the stream . * @ param is * The input stream * @ param encoding * The encoding */ public void load ( final InputStream is , final String encoding ) throws IOException { }...
load ( new InputStreamReader ( is , encoding ) ) ;
public class V8ScriptRunner { /** * Recursively convert a V8 array to a list and release it * @ param arr the array to convert * @ return the list */ private List < Object > convertArray ( V8Array arr ) { } }
List < Object > l = new ArrayList < > ( ) ; for ( int i = 0 ; i < arr . length ( ) ; ++ i ) { Object o = arr . get ( i ) ; if ( o instanceof V8Array ) { o = convert ( ( V8Array ) o , List . class ) ; } else if ( o instanceof V8Object ) { o = convert ( ( V8Object ) o , Map . class ) ; } l . add ( o ) ; } return l ;
public class SegmentKeyCache { /** * Updates the tail cache for with the contents of the given { @ link TableKeyBatch } . * Each { @ link TableKeyBatch . Item } is updated only if no previous entry exists with its { @ link TableKeyBatch . Item # getHash ( ) } * or if its { @ link TableKeyBatch . Item # getOffset ( ...
val result = new ArrayList < Long > ( batch . getItems ( ) . size ( ) ) ; synchronized ( this ) { for ( TableKeyBatch . Item item : batch . getItems ( ) ) { long itemOffset = batchOffset + item . getOffset ( ) ; CacheBucketOffset existingOffset = get ( item . getHash ( ) , generation ) ; if ( existingOffset == null || ...
public class IonWriterSystemBinary { /** * Empty our buffers , assuming it is safe to do so . * This is called by { @ link # flush ( ) } and { @ link # finish ( ) } . */ private void writeAllBufferedData ( ) throws IOException { } }
writeBytes ( _user_output_stream ) ; clearFieldName ( ) ; clearAnnotations ( ) ; _in_struct = false ; _patch_count = 0 ; _patch_symbol_table_count = 0 ; _top = 0 ; try { _writer . setPosition ( 0 ) ; _writer . truncate ( ) ; } catch ( IOException e ) { throw new IonException ( e ) ; }
public class InMemoryCacheEntry { /** * / * ( non - Javadoc ) * @ see com . gistlabs . mechanize . cache . InMemoryCacheEntry # isCacheable ( ) */ @ Override public boolean isCacheable ( ) { } }
boolean supportsConditionals = has ( "Last-Modified" , this . response ) || has ( "ETag" , this . response ) ; boolean isCacheable = has ( "Cache-Control" , "s-maxage" , this . response ) || has ( "Cache-Control" , "max-age" , this . response ) || has ( "Expires" , this . response ) ; return supportsConditionals || isC...
public class BasePostprocessor { /** * Clients should override this method if the post - processing cannot be done in place . If the * post - processing can be done in place , clients should override the { @ link # process ( Bitmap ) } * method . * < p > The provided destination bitmap is of the same size as the ...
internalCopyBitmap ( destBitmap , sourceBitmap ) ; process ( destBitmap ) ;
public class PlayerPlaylist { /** * Add all tracks at the end of the playlist . * @ param tracks tracks to add . */ public void addAll ( List < SoundCloudTrack > tracks ) { } }
for ( SoundCloudTrack track : tracks ) { add ( mSoundCloudPlaylist . getTracks ( ) . size ( ) , track ) ; }
public class Member { /** * Issue a deploy request on behalf of this member * @ param deployRequest { @ link DeployRequest } * @ return { @ link ChainCodeResponse } response to chain code deploy transaction * @ throws ChainCodeException if the deployment fails . */ public ChainCodeResponse deploy ( DeployRequest ...
logger . debug ( "Member.deploy" ) ; if ( getChain ( ) . getPeers ( ) . isEmpty ( ) ) { throw new NoValidPeerException ( String . format ( "chain %s has no peers" , getChain ( ) . getName ( ) ) ) ; } TransactionContext tcxt = this . newTransactionContext ( null ) ; return tcxt . deploy ( deployRequest ) ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public FinishingOperationFOpType createFinishingOperationFOpTypeFromString ( EDataType eDataType , String initialValue ) { } }
FinishingOperationFOpType result = FinishingOperationFOpType . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class XmpReader { /** * Determine if there is an extended XMP section based on the standard XMP part . * The xmpNote : HasExtendedXMP attribute contains the GUID of the Extended XMP chunks . */ @ Nullable private static String getExtendedXMPGUID ( @ NotNull Metadata metadata ) { } }
final Collection < XmpDirectory > xmpDirectories = metadata . getDirectoriesOfType ( XmpDirectory . class ) ; for ( XmpDirectory directory : xmpDirectories ) { final XMPMeta xmpMeta = directory . getXMPMeta ( ) ; try { final XMPIterator itr = xmpMeta . iterator ( SCHEMA_XMP_NOTES , null , null ) ; if ( itr == null ) co...
public class ODatabaseFactory { /** * Closes all open databases . */ public synchronized void shutdown ( ) { } }
if ( instances . size ( ) > 0 ) { OLogManager . instance ( ) . debug ( null , "Found %d databases opened during OrientDB shutdown. Assure to always close database instances after usage" , instances . size ( ) ) ; for ( ODatabaseComplex < ? > db : new HashSet < ODatabaseComplex < ? > > ( instances . keySet ( ) ) ) { if ...
public class QueryBuilder { /** * Perform an inner join between the already defined source with the " _ _ ALL _ NODES " table using the supplied alias . * @ param alias the alias for the " _ _ ALL _ NODES " table ; may not be null * @ return the component that must be used to complete the join specification ; never...
// Expect there to be a source already . . . return new JoinClause ( namedSelector ( AllNodes . ALL_NODES_NAME + " AS " + alias ) , JoinType . INNER ) ;
public class AbstractFixture { /** * < p > invoke . < / p > * @ param method a { @ link java . lang . reflect . Method } object . * @ return a { @ link java . lang . Object } object . */ protected Object invoke ( Method method ) { } }
try { return method . invoke ( target ) ; } catch ( Exception e ) { return null ; }
public class BuildState { /** * Lookup a module from a name . Create the module if it does * not exist yet . */ public Module lookupModule ( String mod ) { } }
Module m = modules . get ( mod ) ; if ( m == null ) { m = new Module ( mod , "???" ) ; modules . put ( mod , m ) ; } return m ;
public class ImageBuilder { /** * Build a web image with its url parameters . * @ param jrImage the web image params * @ return the JavaFX image object */ private Image buildWebImage ( final WebImage jrImage ) { } }
final String url = jrImage . getUrl ( ) ; Image image = null ; if ( url == null || url . isEmpty ( ) ) { LOGGER . error ( "Image : {} not found !" , url ) ; } else { image = new Image ( url ) ; } return image ;
public class PrimaveraPMFileWriter { /** * Map the currency separator character to a symbol name . * @ param c currency separator character * @ return symbol name */ private String getSymbolName ( char c ) { } }
String result = null ; switch ( c ) { case ',' : { result = "Comma" ; break ; } case '.' : { result = "Period" ; break ; } } return result ;
public class DateFormat { /** * Formats a Date into a date / time string . * @ param date a Date to be formatted into a date / time string . * @ param toAppendTo the string buffer for the returning date / time string . * @ param fieldPosition keeps track of the position of the field * within the returned string...
// Use our Calendar object calendar . setTime ( date ) ; return format ( calendar , toAppendTo , fieldPosition ) ;
public class SimpleDateTimeTextProvider { private Object findStore ( TemporalField field , Locale locale ) { } }
Entry < TemporalField , Locale > key = createEntry ( field , locale ) ; Object store = cache . get ( key ) ; if ( store == null ) { store = createStore ( field , locale ) ; cache . putIfAbsent ( key , store ) ; store = cache . get ( key ) ; } return store ;
public class SQLErrorCodesFactory { /** * 获取数据库名称 * @ param dataSource * @ return * @ throws MetaDataAccessException */ private String fetchDatabaseProductName ( DataSource dataSource ) throws MetaDataAccessException { } }
Connection conn = null ; try { conn = DataSourceUtils . getConnection ( dataSource ) ; DatabaseMetaData metaData = conn . getMetaData ( ) ; return metaData . getDatabaseProductName ( ) ; } catch ( CannotGetJdbcConnectionException ex ) { throw new MetaDataAccessException ( "Could not get Connection for extracting meta d...
public class Emitter { /** * Checks if there is a valid markdown link definition . * @ param aOut * The StringBuilder containing the generated output . * @ param sIn * Input String . * @ param nStart * Starting position . * @ param eToken * Either LINK or IMAGE . * @ return The new position or - 1 if ...
boolean bIsAbbrev = false ; int nPos = nStart + ( eToken == EMarkToken . LINK ? 1 : 2 ) ; final StringBuilder aTmp = new StringBuilder ( ) ; aTmp . setLength ( 0 ) ; nPos = MarkdownHelper . readMdLinkId ( aTmp , sIn , nPos ) ; if ( nPos < nStart ) return - 1 ; final String sName = aTmp . toString ( ) ; String sLink = n...
public class SDBaseOps { /** * Matrix multiply a batch of matrices . matricesA and matricesB have to be arrays of same * length and each pair taken from these sets has to have dimensions ( M , N ) and ( N , K ) , * respectively . If transposeA is true , matrices from matricesA will have shape ( N , M ) instead . ...
validateSameType ( "batchMmul" , true , matricesA ) ; validateSameType ( "batchMmul" , true , matricesB ) ; SDVariable [ ] result = f ( ) . batchMmul ( matricesA , matricesB , transposeA , transposeB ) ; return updateVariableNamesAndReferences ( result , names ) ;
public class SavedAuthenticationImpl { /** * Set the { @ link org . geomajas . security . Authorization } s which apply for this authentication . * They are included here in serialized form . * @ param authorizations array of authentications */ public void setAuthorizations ( BaseAuthorization [ ] authorizations ) ...
BaseAuthorization ba = null ; try { this . authorizations = new byte [ authorizations . length ] [ ] ; for ( int i = 0 ; i < authorizations . length ; i ++ ) { ba = authorizations [ i ] ; ByteArrayOutputStream baos = new ByteArrayOutputStream ( 256 ) ; JBossObjectOutputStream serialize = new JBossObjectOutputStream ( b...
public class CoderResult { /** * Gets a < code > CoderResult < / code > object indicating an unmappable * character error . * @ param length * the length of the input unit sequence denoting the unmappable * character . * @ return a < code > CoderResult < / code > object indicating an unmappable * character ...
if ( length > 0 ) { Integer key = Integer . valueOf ( length ) ; synchronized ( _unmappableErrors ) { CoderResult r = _unmappableErrors . get ( key ) ; if ( r == null ) { r = new CoderResult ( TYPE_UNMAPPABLE_CHAR , length ) ; _unmappableErrors . put ( key , r ) ; } return r ; } } throw new IllegalArgumentException ( "...
public class RemoveAttributesActivity { /** * A list of 1-50 attributes to remove from the message . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setAttributes ( java . util . Collection ) } or { @ link # withAttributes ( java . util . Collection ) } if yo...
if ( this . attributes == null ) { setAttributes ( new java . util . ArrayList < String > ( attributes . length ) ) ; } for ( String ele : attributes ) { this . attributes . add ( ele ) ; } return this ;
public class KeyWrapper { /** * Convenience method to unwrap a public - private key pain in a single call . * @ param wrappedPrivateKey The wrapped key , base - 64 encoded , as returned by * { @ link # wrapPrivateKey ( PrivateKey ) } . * @ param encodedPublicKey The public key , base - 64 encoded , as returned by...
PrivateKey privateKey = unwrapPrivateKey ( wrappedPrivateKey ) ; PublicKey publicKey = decodePublicKey ( encodedPublicKey ) ; return new KeyPair ( publicKey , privateKey ) ;
public class FieldTypeHelper { /** * In some circumstances MS Project refers to the text version of a field ( e . g . Start Text rather than Star ) when we * actually need to process the non - text version of the field . This method performs that mapping . * @ param field field to mapped * @ return mapped field *...
if ( field != null && field . getFieldTypeClass ( ) == FieldTypeClass . TASK ) { TaskField taskField = ( TaskField ) field ; switch ( taskField ) { case START_TEXT : { field = TaskField . START ; break ; } case FINISH_TEXT : { field = TaskField . FINISH ; break ; } case DURATION_TEXT : { field = TaskField . DURATION ; ...
public class ResourceRepositoryBase { /** * Forwards to { @ link # findAll ( QuerySpec ) } * @ param id * of the resource * @ param querySpec * for field and relation inclusion * @ return resource */ @ Override public T findOne ( I id , QuerySpec querySpec ) { } }
RegistryEntry entry = resourceRegistry . findEntry ( resourceClass ) ; String idName = entry . getResourceInformation ( ) . getIdField ( ) . getUnderlyingName ( ) ; QuerySpec idQuerySpec = querySpec . duplicate ( ) ; idQuerySpec . addFilter ( new FilterSpec ( Arrays . asList ( idName ) , FilterOperator . EQ , id ) ) ; ...
public class ContentSpecParser { /** * Process the contents of a content specification and parse it into a ContentSpec object . * @ param parserData * @ param processProcesses If processes should be processed to populate the relationships . * @ return True if the contents were processed successfully otherwise fal...
parserData . setCurrentLevel ( parserData . getContentSpec ( ) . getBaseLevel ( ) ) ; boolean error = false ; while ( parserData . getLines ( ) . peek ( ) != null ) { parserData . setLineCount ( parserData . getLineCount ( ) + 1 ) ; // Process the content specification and print an error message if an error occurs try ...
public class RegistriesInner { /** * Regenerates one of the login credentials for the specified container registry . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param name Specifies name of the...
return regenerateCredentialWithServiceResponseAsync ( resourceGroupName , registryName , name ) . map ( new Func1 < ServiceResponse < RegistryListCredentialsResultInner > , RegistryListCredentialsResultInner > ( ) { @ Override public RegistryListCredentialsResultInner call ( ServiceResponse < RegistryListCredentialsRes...