idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
8,800
SchemaFuture installHandlers ( XMLReader in , SchemaReceiverImpl sr ) { Handler h = new Handler ( sr ) ; in . setContentHandler ( h ) ; return h ; }
Installs the schema handler on the reader .
41
9
8,801
private Mode getModeAttribute ( Attributes attributes , String localName ) { return lookupCreateMode ( attributes . getValue ( "" , localName ) ) ; }
Get the mode specified by an attribute from no namespace .
32
11
8,802
private Mode lookupCreateMode ( String name ) { if ( name == null ) return null ; name = name . trim ( ) ; Mode mode = ( Mode ) modeMap . get ( name ) ; if ( mode == null ) { mode = new Mode ( name , defaultBaseMode ) ; modeMap . put ( name , mode ) ; } return mode ; }
Gets a mode with the given name from the mode map . If not present then it creates a new mode extending the default base mode .
75
28
8,803
private Date _advanceToNextDayOfWeekIfNecessary ( final Date aFireTime , final boolean forceToAdvanceNextDay ) { // a. Advance or adjust to next dayOfWeek if need to first, starting next // day with startTimeOfDay. Date fireTime = aFireTime ; final TimeOfDay sTimeOfDay = getStartTimeOfDay ( ) ; final Date fireTimeStart...
Given fireTime time determine if it is on a valid day of week . If so simply return it unaltered if not advance to the next valid week day and set the time of day to the start time of day
475
44
8,804
@ Nonnull public static IScheduler getScheduler ( final boolean bStartAutomatically ) { try { // Don't try to use a name - results in NPE final IScheduler aScheduler = s_aSchedulerFactory . getScheduler ( ) ; if ( bStartAutomatically && ! aScheduler . isStarted ( ) ) aScheduler . start ( ) ; return aScheduler ; } catch...
Get the underlying Quartz scheduler
141
6
8,805
@ Nonnull public static SchedulerMetaData getSchedulerMetaData ( ) { try { // Get the scheduler without starting it return s_aSchedulerFactory . getScheduler ( ) . getMetaData ( ) ; } catch ( final SchedulerException ex ) { throw new IllegalStateException ( "Failed to get scheduler metadata" , ex ) ; } }
Get the metadata of the scheduler . The state of the scheduler is not changed within this method .
81
21
8,806
public void setCronExpression ( @ Nonnull final String expression ) throws ParseException { final CronExpression newExp = new CronExpression ( expression ) ; setCronExpression ( newExp ) ; }
Sets the cron expression for the calendar to a new value
46
13
8,807
public static < T extends Key < T > > GroupMatcher < T > groupEquals ( final String compareTo ) { return new GroupMatcher <> ( compareTo , StringOperatorName . EQUALS ) ; }
Create a GroupMatcher that matches groups equaling the given string .
47
14
8,808
public static < T extends Key < T > > GroupMatcher < T > groupStartsWith ( final String compareTo ) { return new GroupMatcher <> ( compareTo , StringOperatorName . STARTS_WITH ) ; }
Create a GroupMatcher that matches groups starting with the given string .
51
14
8,809
public static < T extends Key < T > > GroupMatcher < T > groupEndsWith ( final String compareTo ) { return new GroupMatcher <> ( compareTo , StringOperatorName . ENDS_WITH ) ; }
Create a GroupMatcher that matches groups ending with the given string .
51
14
8,810
public static < T extends Key < T > > GroupMatcher < T > groupContains ( final String compareTo ) { return new GroupMatcher <> ( compareTo , StringOperatorName . CONTAINS ) ; }
Create a GroupMatcher that matches groups containing the given string .
48
13
8,811
public static < U extends Key < U > > KeyMatcher < U > keyEquals ( final U compareTo ) { return new KeyMatcher <> ( compareTo ) ; }
Create a KeyMatcher that matches Keys that equal the given key .
39
14
8,812
public static < T > T instantiate ( Class < T > clazz , CRestConfig crestConfig ) throws InvocationTargetException , IllegalAccessException , InstantiationException , NoSuchMethodException { try { return accessible ( clazz . getDeclaredConstructor ( CRestConfig . class ) ) . newInstance ( crestConfig ) ; } catch ( NoSu...
Instanciate the given component class passing the CRestConfig to the constructor if available otherwise uses the default empty constructor .
102
25
8,813
public Object doReverseOne ( JTransfo jTransfo , Object domainObject , SyntheticField toField , Class < ? > toType , String ... tags ) throws JTransfoException { return jTransfo . convertTo ( domainObject , jTransfo . getToSubType ( toType , domainObject ) , tags ) ; }
Do the actual reverse conversion of one object .
73
9
8,814
public void addJobChainLink ( final JobKey firstJob , final JobKey secondJob ) { ValueEnforcer . notNull ( firstJob , "FirstJob" ) ; ValueEnforcer . notNull ( firstJob . getName ( ) , "FirstJob.Name" ) ; ValueEnforcer . notNull ( secondJob , "SecondJob" ) ; ValueEnforcer . notNull ( secondJob . getName ( ) , "SecondJob...
Add a chain mapping - when the Job identified by the first key completes the job identified by the second key will be triggered .
114
25
8,815
private void checkM ( ) throws DatatypeException , IOException { if ( context . length ( ) == 0 ) { appendToContext ( current ) ; } current = reader . read ( ) ; appendToContext ( current ) ; skipSpaces ( ) ; checkArg ( ' ' , "x coordinate" ) ; skipCommaSpaces ( ) ; checkArg ( ' ' , "y coordinate" ) ; boolean expectNum...
Checks an M command .
112
6
8,816
private void checkC ( ) throws DatatypeException , IOException { if ( context . length ( ) == 0 ) { appendToContext ( current ) ; } current = reader . read ( ) ; appendToContext ( current ) ; skipSpaces ( ) ; boolean expectNumber = true ; for ( ; ; ) { switch ( current ) { default : if ( expectNumber ) reportNonNumber ...
Checks a C command .
276
6
8,817
public boolean before ( final TimeOfDay timeOfDay ) { if ( timeOfDay . m_nHour > m_nHour ) return true ; if ( timeOfDay . m_nHour < m_nHour ) return false ; if ( timeOfDay . m_nMinute > m_nMinute ) return true ; if ( timeOfDay . m_nMinute < m_nMinute ) return false ; if ( timeOfDay . m_nSecond > m_nSecond ) return true...
Determine with this time of day is before the given time of day .
140
16
8,818
@ Nullable public Date getTimeOfDayForDate ( final Date dateTime ) { if ( dateTime == null ) return null ; final Calendar cal = PDTFactory . createCalendar ( ) ; cal . setTime ( dateTime ) ; cal . set ( Calendar . HOUR_OF_DAY , m_nHour ) ; cal . set ( Calendar . MINUTE , m_nMinute ) ; cal . set ( Calendar . SECOND , m_...
Return a date with time of day reset to this object values . The millisecond value will be zero .
122
21
8,819
public Document parse ( InputSource inputsource ) throws SAXException , IOException { return verify ( _WrappedBuilder . parse ( inputsource ) ) ; }
Parses the given InputSource and validates the resulting DOM .
33
14
8,820
public Document parse ( File file ) throws SAXException , IOException { return verify ( _WrappedBuilder . parse ( file ) ) ; }
Parses the given File and validates the resulting DOM .
30
13
8,821
public Document parse ( InputStream strm ) throws SAXException , IOException { return verify ( _WrappedBuilder . parse ( strm ) ) ; }
Parses the given InputStream and validates the resulting DOM .
33
14
8,822
public Document parse ( String url ) throws SAXException , IOException { return verify ( _WrappedBuilder . parse ( url ) ) ; }
Parses the given url and validates the resulting DOM .
30
13
8,823
private int convertNonNegativeInteger ( String str ) { str = str . trim ( ) ; DecimalDatatype decimal = new DecimalDatatype ( ) ; if ( ! decimal . lexicallyAllows ( str ) ) return - 1 ; // Canonicalize the value str = decimal . getValue ( str , null ) . toString ( ) ; // Reject negative and fractional numbers if ( str ...
Return Integer . MAX_VALUE for values that are too big
150
12
8,824
private void checkItem ( Element root , Deque < Element > parents ) throws SAXException { Deque < Element > pending = new ArrayDeque < Element > ( ) ; Set < Element > memory = new HashSet < Element > ( ) ; memory . add ( root ) ; for ( Element child : root . children ) { pending . push ( child ) ; } if ( root . itemRef...
Check itemref constraints .
399
5
8,825
public static < T > ContractCondition < T > condition ( final Predicate < T > condition , final Function < T , String > describer ) { return ContractCondition . of ( condition , describer ) ; }
Construct a predicate from the given predicate function and describer .
44
12
8,826
static int compare ( final Date nextFireTime1 , final int priority1 , final TriggerKey key1 , final Date nextFireTime2 , final int priority2 , final TriggerKey key2 ) { if ( nextFireTime1 != null || nextFireTime2 != null ) { if ( nextFireTime1 == null ) return 1 ; if ( nextFireTime2 == null ) return - 1 ; if ( nextFire...
This static method exists for comparator in TC clustered quartz
152
11
8,827
@ Override public List < Connector > getSipConnectors ( ) { List < Connector > connectors = new ArrayList < Connector > ( ) ; Connector [ ] conns = service . findConnectors ( ) ; for ( Connector conn : conns ) { if ( conn . getProtocolHandler ( ) instanceof SipProtocolHandler ) { connectors . add ( conn ) ; } } return ...
Return the SipConnectors
91
6
8,828
void perform ( SectionState state ) throws SAXException { final ModeUsage modeUsage = getModeUsage ( ) ; state . reject ( ) ; state . addChildMode ( modeUsage , null ) ; state . addAttributeValidationModeUsage ( modeUsage ) ; }
Perform this action on the session state .
56
9
8,829
public Object getAttribute ( String key ) { Object result ; if ( attributes == null ) { result = null ; } else { result = attributes . get ( key ) ; } return result ; }
Gets an attribute attached to a call . Attributes are arbitrary contextual objects attached to a call .
40
19
8,830
private int reverseIndex ( int k ) { if ( reverseIndexMap == null ) { reverseIndexMap = new int [ attributes . getLength ( ) ] ; for ( int i = 0 , len = indexSet . size ( ) ; i < len ; i ++ ) reverseIndexMap [ indexSet . get ( i ) ] = i + 1 ; } return reverseIndexMap [ k ] - 1 ; }
Gets the index in the filtered set for a given real index . If the reverseIndexMap is not computed it computes it otherwise it just uses the previously computed map .
85
35
8,831
public String getURI ( int index ) { if ( index < 0 || index >= indexSet . size ( ) ) return null ; return attributes . getURI ( indexSet . get ( index ) ) ; }
Get the URI for the index - th attribute .
43
10
8,832
public String getLocalName ( int index ) { if ( index < 0 || index >= indexSet . size ( ) ) return null ; return attributes . getLocalName ( indexSet . get ( index ) ) ; }
Get the local name for the index - th attribute .
45
11
8,833
public String getQName ( int index ) { if ( index < 0 || index >= indexSet . size ( ) ) return null ; return attributes . getQName ( indexSet . get ( index ) ) ; }
Get the QName for the index - th attribute .
45
11
8,834
public String getType ( int index ) { if ( index < 0 || index >= indexSet . size ( ) ) return null ; return attributes . getType ( indexSet . get ( index ) ) ; }
Get the type for the index - th attribute .
43
10
8,835
public String getValue ( int index ) { if ( index < 0 || index >= indexSet . size ( ) ) return null ; return attributes . getValue ( indexSet . get ( index ) ) ; }
Get the value for the index - th attribute .
43
10
8,836
public String getType ( String uri , String localName ) { return attributes . getType ( getRealIndex ( uri , localName ) ) ; }
Get the type of the attribute .
33
7
8,837
public String getValue ( String uri , String localName ) { return attributes . getValue ( getRealIndex ( uri , localName ) ) ; }
Get the value of the attribute .
33
7
8,838
void perform ( SectionState state ) { state . addChildMode ( getModeUsage ( ) , null ) ; state . addAttributeValidationModeUsage ( getModeUsage ( ) ) ; }
Perform this action on the section state .
40
9
8,839
@ Nonnull public CalendarIntervalScheduleBuilder withIntervalInSeconds ( final int intervalInSeconds ) { _validateInterval ( intervalInSeconds ) ; m_nInterval = intervalInSeconds ; m_eIntervalUnit = EIntervalUnit . SECOND ; return this ; }
Specify an interval in the IntervalUnit . SECOND that the produced Trigger will repeat at .
67
20
8,840
@ Nonnull public CalendarIntervalScheduleBuilder withIntervalInMinutes ( final int intervalInMinutes ) { _validateInterval ( intervalInMinutes ) ; m_nInterval = intervalInMinutes ; m_eIntervalUnit = EIntervalUnit . MINUTE ; return this ; }
Specify an interval in the IntervalUnit . MINUTE that the produced Trigger will repeat at .
67
20
8,841
@ Nonnull public CalendarIntervalScheduleBuilder withIntervalInHours ( final int intervalInHours ) { _validateInterval ( intervalInHours ) ; m_nInterval = intervalInHours ; m_eIntervalUnit = EIntervalUnit . HOUR ; return this ; }
Specify an interval in the IntervalUnit . HOUR that the produced Trigger will repeat at .
63
20
8,842
@ Nonnull public CalendarIntervalScheduleBuilder withIntervalInDays ( final int intervalInDays ) { _validateInterval ( intervalInDays ) ; m_nInterval = intervalInDays ; m_eIntervalUnit = EIntervalUnit . DAY ; return this ; }
Specify an interval in the IntervalUnit . DAY that the produced Trigger will repeat at .
62
19
8,843
@ Nonnull public CalendarIntervalScheduleBuilder withIntervalInWeeks ( final int intervalInWeeks ) { _validateInterval ( intervalInWeeks ) ; m_nInterval = intervalInWeeks ; m_eIntervalUnit = EIntervalUnit . WEEK ; return this ; }
Specify an interval in the IntervalUnit . WEEK that the produced Trigger will repeat at .
66
19
8,844
@ Nonnull public CalendarIntervalScheduleBuilder withIntervalInMonths ( final int intervalInMonths ) { _validateInterval ( intervalInMonths ) ; m_nInterval = intervalInMonths ; m_eIntervalUnit = EIntervalUnit . MONTH ; return this ; }
Specify an interval in the IntervalUnit . MONTH that the produced Trigger will repeat at .
67
20
8,845
@ Nonnull public CalendarIntervalScheduleBuilder withIntervalInYears ( final int intervalInYears ) { _validateInterval ( intervalInYears ) ; m_nInterval = intervalInYears ; m_eIntervalUnit = EIntervalUnit . YEAR ; return this ; }
Specify an interval in the IntervalUnit . YEAR that the produced Trigger will repeat at .
62
19
8,846
static int checkResult ( int result ) { if ( exceptionsEnabled && result != cusolverStatus . CUSOLVER_STATUS_SUCCESS ) { throw new CudaException ( cusolverStatus . stringFor ( result ) ) ; } return result ; }
If the given result is not cusolverStatus . CUSOLVER_STATUS_SUCCESS and exceptions have been enabled this method will throw a CudaException with an error message that corresponds to the given result code . Otherwise the given result is simply returned .
57
55
8,847
public NonBlockingProperties getPropertyGroup ( final String sPrefix , final boolean bStripPrefix , final String [ ] excludedPrefixes ) { final NonBlockingProperties group = new NonBlockingProperties ( ) ; String prefix = sPrefix ; if ( ! prefix . endsWith ( "." ) ) prefix += "." ; for ( final String key : m_aProps . k...
Get all properties that start with the given prefix .
231
10
8,848
public void partialDeserialize ( TBase < ? , ? > base , DBObject dbObject , TFieldIdEnum ... fieldIds ) throws TException { try { protocol_ . setDBOject ( dbObject ) ; protocol_ . setBaseObject ( base ) ; protocol_ . setFieldIdsFilter ( base , fieldIds ) ; base . read ( protocol_ ) ; } finally { protocol_ . reset ( ) ;...
Deserialize only a single Thrift object from a byte record .
95
14
8,849
public Verifier newVerifier ( String uri ) throws VerifierConfigurationException , SAXException , IOException { return compileSchema ( uri ) . newVerifier ( ) ; }
parses a schema at the specified location and returns a Verifier object that validates documents by using that schema .
40
24
8,850
public Verifier newVerifier ( File file ) throws VerifierConfigurationException , SAXException , IOException { return compileSchema ( file ) . newVerifier ( ) ; }
parses a schema from the specified file and returns a Verifier object that validates documents by using that schema .
38
24
8,851
public Verifier newVerifier ( InputSource source ) throws VerifierConfigurationException , SAXException , IOException { return compileSchema ( source ) . newVerifier ( ) ; }
parses a schema from the specified InputSource and returns a Verifier object that validates documents by using that schema .
39
25
8,852
public static VerifierFactory newInstance ( String language , ClassLoader classLoader ) throws VerifierConfigurationException { Iterator itr = providers ( VerifierFactoryLoader . class , classLoader ) ; while ( itr . hasNext ( ) ) { VerifierFactoryLoader loader = ( VerifierFactoryLoader ) itr . next ( ) ; try { Verifie...
Creates a new instance of a VerifierFactory for the specified schema language .
128
16
8,853
@ Override public void deleteUnpackedWAR ( StandardContext standardContext ) { File unpackDir = new File ( standardHost . getAppBase ( ) , standardContext . getPath ( ) . substring ( 1 ) ) ; if ( unpackDir . exists ( ) ) { ExpandWar . deleteDir ( unpackDir ) ; } }
Make sure an the unpacked WAR is not left behind you would think Tomcat would cleanup an unpacked WAR but it doesn t
72
26
8,854
public boolean sameValue ( Object value1 , Object value2 ) { return ( ( BigDecimal ) value1 ) . compareTo ( ( BigDecimal ) value2 ) == 0 ; }
BigDecimal . equals considers objects distinct if they have the different scales but the same mathematical value . Similarly for hashCode .
40
25
8,855
public void addSchema ( String uri , IslandSchema s ) { if ( schemata . containsKey ( uri ) ) throw new IllegalArgumentException ( ) ; schemata . put ( uri , s ) ; }
adds a new IslandSchema .
51
8
8,856
public String generateNonce ( ) { // Get the time of day and run MD5 over it. Date date = new Date ( ) ; long time = date . getTime ( ) ; Random rand = new Random ( ) ; long pad = rand . nextLong ( ) ; String nonceString = ( Long . valueOf ( time ) ) . toString ( ) + ( Long . valueOf ( pad ) ) . toString ( ) ; byte mdb...
Generate the challenge string .
136
6
8,857
public static String formatException ( final Exception e ) { final StringBuilder sb = new StringBuilder ( ) ; Throwable t = e ; while ( t != null ) { sb . append ( t . getMessage ( ) ) . append ( "\n" ) ; t = t . getCause ( ) ; } return sb . toString ( ) ; }
Formats the given exception in a multiline error message with all causes .
76
16
8,858
public DailyTimeIntervalScheduleBuilder onDaysOfTheWeek ( final Set < DayOfWeek > onDaysOfWeek ) { ValueEnforcer . notEmpty ( onDaysOfWeek , "OnDaysOfWeek" ) ; m_aDaysOfWeek = onDaysOfWeek ; return this ; }
Set the trigger to fire on the given days of the week .
63
13
8,859
public DailyTimeIntervalScheduleBuilder endingDailyAfterCount ( final int count ) { ValueEnforcer . isGT0 ( count , "Count" ) ; if ( m_aStartTimeOfDay == null ) throw new IllegalArgumentException ( "You must set the startDailyAt() before calling this endingDailyAfterCount()!" ) ; final Date today = new Date ( ) ; final...
Calculate and set the endTimeOfDay using count interval and starTimeOfDay . This means that these must be set before this method is call .
655
32
8,860
protected void onValidMarkup ( AppendingStringBuffer responseBuffer , ValidationReport report ) { IRequestablePage responsePage = getResponsePage ( ) ; DocType doctype = getDocType ( responseBuffer ) ; log . info ( "Markup for {} is valid {}" , responsePage != null ? responsePage . getClass ( ) . getName ( ) : "<unable...
Called when the validated markup does not contain any errors .
184
12
8,861
protected void onInvalidMarkup ( AppendingStringBuffer responseBuffer , ValidationReport report ) { String head = report . getHeadMarkup ( ) ; String body = report . getBodyMarkup ( ) ; int indexOfHeadClose = responseBuffer . lastIndexOf ( "</head>" ) ; responseBuffer . insert ( indexOfHeadClose , head ) ; int indexOfB...
Called when the validated markup contains errors .
109
9
8,862
< T > Class < T > loadClass ( String name ) throws ClassNotFoundException { ClassLoader cl = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( null == cl ) { cl = ToHelper . class . getClassLoader ( ) ; } return ( Class < T > ) cl . loadClass ( name ) ; }
Load class with given name from the correct class loader .
74
11
8,863
List < Field > getFields ( Class < ? > clazz ) { List < Field > result = new ArrayList <> ( ) ; Set < String > fieldNames = new HashSet <> ( ) ; Class < ? > searchType = clazz ; while ( ! Object . class . equals ( searchType ) && searchType != null ) { Field [ ] fields = searchType . getDeclaredFields ( ) ; for ( Field...
Find all declared fields of a class . Fields which are hidden by a child class are not included .
161
20
8,864
Method getMethod ( Class < ? > type , Class < ? > returnType , String name , Class < ? > ... parameters ) { Method method = null ; try { // first try for public methods method = type . getMethod ( name , parameters ) ; if ( null != returnType && ! returnType . isAssignableFrom ( method . getReturnType ( ) ) ) { method ...
Get method with given name and parameters and given return type .
144
12
8,865
protected static void triggerCustomExceptionHandler ( @ Nonnull final Throwable t , @ Nullable final String sJobClassName , @ Nonnull final IJob aJob ) { exceptionCallbacks ( ) . forEach ( x -> x . onScheduledJobException ( t , sJobClassName , aJob ) ) ; }
Called when an exception of the specified type occurred
69
10
8,866
public static Response toResponse ( Response . Status status , String wwwAuthHeader ) { Response . ResponseBuilder rb = Response . status ( status ) ; if ( wwwAuthHeader != null ) { rb . header ( "WWW-Authenticate" , wwwAuthHeader ) ; } return rb . build ( ) ; }
Maps this exception to a response object .
68
8
8,867
public void execute ( final FifoTask < E > task ) throws InterruptedException { final int id ; synchronized ( this ) { id = idCounter ++ ; taskMap . put ( id , task ) ; while ( activeCounter >= maxThreads ) { wait ( ) ; } activeCounter ++ ; } this . threadPoolExecutor . execute ( new Runnable ( ) { public void run ( ) ...
Executes the submitted task . If the maximum number of pooled threads is in use this method blocks until one of a them is available .
243
27
8,868
public static String executeProcess ( Map < String , String > env , File workingFolder , String ... command ) throws ProcessException , InterruptedException { ProcessBuilder pb = new ProcessBuilder ( command ) ; if ( workingFolder != null ) { pb . directory ( workingFolder ) ; } if ( env != null ) { pb . environment ( ...
Executes a native process with small stdout and stderr payloads
265
15
8,869
public static int cusolverRfGetMatrixFormat ( cusolverRfHandle handle , int [ ] format , int [ ] diag ) { return checkResult ( cusolverRfGetMatrixFormatNative ( handle , format , diag ) ) ; }
CUSOLVERRF set and get input format
56
10
8,870
public static int cusolverRfSetNumericProperties ( cusolverRfHandle handle , double zero , double boost ) { return checkResult ( cusolverRfSetNumericPropertiesNative ( handle , zero , boost ) ) ; }
CUSOLVERRF set and get numeric properties
54
10
8,871
public static int cusolverRfSetAlgs ( cusolverRfHandle handle , int factAlg , int solveAlg ) { return checkResult ( cusolverRfSetAlgsNative ( handle , factAlg , solveAlg ) ) ; }
CUSOLVERRF choose the triangular solve algorithm
58
10
8,872
public static int cusolverRfSetupHost ( int n , int nnzA , Pointer h_csrRowPtrA , Pointer h_csrColIndA , Pointer h_csrValA , int nnzL , Pointer h_csrRowPtrL , Pointer h_csrColIndL , Pointer h_csrValL , int nnzU , Pointer h_csrRowPtrU , Pointer h_csrColIndU , Pointer h_csrValU , Pointer h_P , Pointer h_Q , /** Output */...
CUSOLVERRF setup of internal structures from host or device memory
249
14
8,873
public static int cusolverRfBatchSetupHost ( int batchSize , int n , int nnzA , Pointer h_csrRowPtrA , Pointer h_csrColIndA , Pointer h_csrValA_array , int nnzL , Pointer h_csrRowPtrL , Pointer h_csrColIndL , Pointer h_csrValL , int nnzU , Pointer h_csrRowPtrU , Pointer h_csrColIndU , Pointer h_csrValU , Pointer h_P , ...
CUSOLVERRF - batch setup of internal structures from host
270
13
8,874
public static RegexPathTemplate create ( String urlTemplate ) { StringBuffer baseUrl = new StringBuffer ( ) ; Map < String , PathTemplate > templates = new HashMap < String , PathTemplate > ( ) ; CurlyBraceTokenizer t = new CurlyBraceTokenizer ( urlTemplate ) ; while ( t . hasNext ( ) ) { String tok = t . next ( ) ; if...
Creates a regex path template for the given URI template
416
11
8,875
public void addValidator ( Schema schema , ModeUsage modeUsage ) { // adds the schema to this section schemas schemas . addElement ( schema ) ; // creates the validator Validator validator = createValidator ( schema ) ; // adds the validator to this section validators validators . addElement ( validator ) ; // add the ...
Adds a validator .
213
5
8,876
public static void writeStringToFile ( File file , String data , String charset ) throws IOException { FileOutputStream fos = openOutputStream ( file , false ) ; fos . write ( data . getBytes ( charset ) ) ; fos . close ( ) ; }
Writes a String to a file creating the file if it does not exist .
60
16
8,877
public static Thread pipeAsynchronously ( final InputStream is , final ErrorHandler errorHandler , final boolean closeResources , final OutputStream ... os ) { Thread t = new Thread ( ) { @ Override public void run ( ) { try { pipeSynchronously ( is , closeResources , os ) ; } catch ( Throwable th ) { if ( errorHandler...
Asynchronous writing from is to os
113
7
8,878
public static File createFile ( String filePath ) throws IOException { boolean isDirectory = filePath . endsWith ( "/" ) || filePath . endsWith ( "\\" ) ; String formattedFilePath = formatFilePath ( filePath ) ; File f = new File ( formattedFilePath ) ; if ( f . exists ( ) ) { return f ; } if ( isDirectory ) { f . mkdi...
Creates a file in the specified path . Creates also any necessary folder needed to achieve the file level of nesting .
185
24
8,879
public boolean compete ( NamespaceSpecification other ) { // if no wildcard for other then we check coverage if ( "" . equals ( other . wildcard ) ) { return covers ( other . ns ) ; } // split the namespaces at wildcards String [ ] otherParts = split ( other . ns , other . wildcard ) ; // if the given namepsace specifi...
Check if this namespace specification competes with another namespace specification .
326
12
8,880
static private boolean matchPrefix ( String s1 , String s2 ) { return s1 . startsWith ( s2 ) || s2 . startsWith ( s1 ) ; }
Checks with either of the strings starts with the other .
38
12
8,881
public boolean covers ( String uri ) { // any namspace covers only the any namespace uri // no wildcard ("") requires equality between namespaces. if ( ANY_NAMESPACE . equals ( ns ) || "" . equals ( wildcard ) ) { return ns . equals ( uri ) ; } String [ ] parts = split ( ns , wildcard ) ; // no wildcard if ( parts . le...
Checks if a namespace specification covers a specified URI . any namespace pattern covers only the any namespace uri .
321
22
8,882
@ Override public void reloadContext ( ) throws DeploymentException { Archive < ? > archive = mssContainer . getArchive ( ) ; deployableContainer . undeploy ( archive ) ; deployableContainer . deploy ( archive ) ; }
Context related methods
50
3
8,883
private Mode resolve ( Mode mode ) { if ( mode == Mode . CURRENT ) { return currentMode ; } // For an action that does not specify the useMode attribute // we create an anonymous next mode that becomes defined if we // have a nested mode element inside the action. // If we do not have a nested mode then the anonymous m...
Resolves the Mode . CURRENT to the currentMode for this mode usage . If Mode . CURRENT is not passed as argument then the same mode is returned with the exception of an anonymous mode that is not defined when we get also the current mode .
118
51
8,884
int getAttributeProcessing ( ) { if ( attributeProcessing == - 1 ) { attributeProcessing = resolve ( mode ) . getAttributeProcessing ( ) ; if ( modeMap != null ) { for ( Enumeration e = modeMap . values ( ) ; e . hasMoreElements ( ) && attributeProcessing != Mode . ATTRIBUTE_PROCESSING_FULL ; ) attributeProcessing = Ma...
Get the maximum attribute processing value from the default mode and from all the modes specified in the contexts .
126
20
8,885
public String getMergedJsonFile ( final VFS vfs , final ResourceResolver resolver , final String in ) throws IOException { final VFile file = vfs . find ( "/__temp__json__input" ) ; final List < Resource > resources = getJsonSourceFiles ( resolver . resolve ( in ) ) ; // Hack which tries to replace all non-js sources w...
Returns a merged temporary file with all contents listed in the given json file paths .
335
16
8,886
private boolean isUniqueFileResolved ( final Set < String > alreadyHandled , final String s ) { return this . uniqueFiles && alreadyHandled . contains ( s ) ; }
Examines a source file whether it is already resolved when it should be unique .
38
16
8,887
public Class < ? > getDomainClass ( Class < ? > toClass ) { Class < ? > declaredClass = getDeclaredDomainClass ( toClass ) ; return classReplacer . replaceClass ( declaredClass ) ; }
Get domain class for transfer object .
47
7
8,888
public boolean validate ( InputSource in ) throws SAXException , IOException { if ( schema == null ) throw new IllegalStateException ( "cannot validate without schema" ) ; if ( validator == null ) validator = schema . createValidator ( instanceProperties ) ; if ( xr == null ) { xr = ResolverFactory . createResolver ( i...
Validates a document against the currently loaded schema . This can be called multiple times in order to validate multiple documents .
191
23
8,889
public TypeMirror getOperatorKind ( TypeMirror leftMirror , TypeMirror rightMirror , TokenType . BinaryOperator operator ) { if ( leftMirror == null || rightMirror == null ) return null ; TypeKind leftKind = leftMirror . getKind ( ) ; TypeKind rightKind = rightMirror . getKind ( ) ; if ( isString ( leftMirror ) ) retur...
rules for this method are found here
670
7
8,890
void perform ( ContentHandler handler , SectionState state ) { final ModeUsage modeUsage = getModeUsage ( ) ; if ( handler != null ) state . addActiveHandler ( handler , modeUsage ) ; else state . addAttributeValidationModeUsage ( modeUsage ) ; state . addChildMode ( modeUsage , handler ) ; }
Performs this action on the section state .
69
9
8,891
public Token getNextToken ( ) { Token specialToken = null ; Token matchedToken ; int curPos = 0 ; EOFLoop : for ( ; ; ) { try { curChar = input_stream . BeginToken ( ) ; } catch ( EOFException e ) { jjmatchedKind = 0 ; matchedToken = jjFillToken ( ) ; matchedToken . specialToken = specialToken ; return matchedToken ; }...
Get the next Token .
745
5
8,892
@ Override public String filter ( String value , String previousValue ) { if ( previousValue != null && value . length ( ) > previousValue . length ( ) ) return value ; return value . equals ( "0" ) || value . equals ( "0.0" ) ? "" : value ; }
The default filter removes the display of 0 or 0 . 0 if the user has erased the text . This is to prevent a number being shown when the user tries to erase it .
64
36
8,893
public String ipToString ( long ip ) { // if ip is bigger than 255.255.255.255 or smaller than 0.0.0.0 if ( ip > 4294967295l || ip < 0 ) { throw new IllegalArgumentException ( "invalid ip" ) ; } val ipAddress = new StringBuilder ( ) ; for ( int i = 3 ; i >= 0 ; i -- ) { int shift = i * 8 ; ipAddress . append ( ( ip & (...
Returns the 32bit dotted format of the provided long ip .
142
12
8,894
void outputComplementDirect ( StringBuffer buf ) { if ( ! surrogatesDirect && getContainsBmp ( ) == NONE ) buf . append ( "[\u0000-\uFFFF]" ) ; else { buf . append ( "[^" ) ; inClassOutputDirect ( buf ) ; buf . append ( ' ' ) ; } }
must not call if containsBmp == ALL && !surrogatesDirect
73
15
8,895
public Object doConvertOne ( JTransfo jTransfo , Object toObject , Class < ? > domainObjectType , String ... tags ) throws JTransfoException { return jTransfo . convertTo ( toObject , domainObjectType , tags ) ; }
Do the actual conversion of one object .
55
8
8,896
public static URIResolver createSAXURIResolver ( Resolver resolver ) { final SAXResolver saxResolver = new SAXResolver ( resolver ) ; return new URIResolver ( ) { public Source resolve ( String href , String base ) throws TransformerException { try { return saxResolver . resolve ( href , base ) ; } catch ( SAXException...
Creates a URIResolver that returns a SAXSource .
117
14
8,897
public void addConverters ( Converter converter , String ... tags ) { for ( String tag : tags ) { if ( tag . startsWith ( "!" ) ) { notConverters . put ( tag . substring ( 1 ) , converter ) ; } else { converters . put ( tag , converter ) ; } } }
Add the converter which should be used for a specific tag .
70
12
8,898
public void checkValid ( CharSequence literal ) throws DatatypeException { // TODO find out what kind of thread concurrency guarantees are made ContextFactory cf = new ContextFactory ( ) ; Context cx = cf . enterContext ( ) ; RegExpImpl rei = new RegExpImpl ( ) ; String anchoredRegex = "^(?:" + literal + ")$" ; try { r...
Checks that the value compiles as an anchored JavaScript regular expression .
137
14
8,899
public static < T extends Key < T > > NameMatcher < T > nameEquals ( final String compareTo ) { return new NameMatcher <> ( compareTo , StringOperatorName . EQUALS ) ; }
Create a NameMatcher that matches names equaling the given string .
47
14