idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
27,600
public synchronized void co_exit_to ( Object arg_object , int thisCoroutine , int toCoroutine ) throws java . lang . NoSuchMethodException { if ( ! m_activeIDs . get ( toCoroutine ) ) throw new java . lang . NoSuchMethodException ( XMLMessages . createXMLMessage ( XMLErrorResources . ER_COROUTINE_NOT_AVAIL , new Object...
Make the ID available for reuse and terminate this coroutine transferring control to the specified coroutine . Note that this returns immediately rather than waiting for any further coroutine traffic so the thread can proceed with other shutdown activities .
27,601
static < E > Node < E > newNode ( E item ) { Node < E > node = new Node < E > ( ) ; U . putObject ( node , ITEM , item ) ; return node ; }
Returns a new node holding item . Uses relaxed write because item can only be seen after piggy - backing publication via casNext .
27,602
public String [ ] split ( CharSequence input , int limit ) { String [ ] fast = fastSplit ( pattern , input . toString ( ) , limit ) ; if ( fast != null ) { return fast ; } int index = 0 ; boolean matchLimited = limit > 0 ; ArrayList < String > matchList = new ArrayList < > ( ) ; Matcher m = matcher ( input ) ; while ( ...
Splits the given input sequence around matches of this pattern .
27,603
private void readObject ( java . io . ObjectInputStream s ) throws java . io . IOException , ClassNotFoundException { s . defaultReadObject ( ) ; compile ( ) ; }
Recompile the Pattern instance from a stream . The original pattern string is read in and the object tree is recompiled from it .
27,604
public Stream < String > splitAsStream ( final CharSequence input ) { class MatcherIterator implements Iterator < String > { private final Matcher matcher ; private int current ; private String nextElement ; private int emptyElementCount ; MatcherIterator ( ) { this . matcher = matcher ( input ) ; } public String next ...
Creates a stream from the given input sequence around matches of this pattern .
27,605
private Appendable normalize ( CharSequence src , Appendable dest , UnicodeSet . SpanCondition spanCondition ) { StringBuilder tempDest = new StringBuilder ( ) ; try { for ( int prevSpanLimit = 0 ; prevSpanLimit < src . length ( ) ; ) { int spanLimit = set . span ( src , prevSpanLimit , spanCondition ) ; int spanLength...
an in - filter prefix .
27,606
public static Set < String > getAvailableIDs ( SystemTimeZoneType type , String region , Integer rawOffset ) { Set < String > baseSet = null ; switch ( type ) { case ANY : baseSet = getSystemZIDs ( ) ; break ; case CANONICAL : baseSet = getCanonicalSystemZIDs ( ) ; break ; case CANONICAL_LOCATION : baseSet = getCanonic...
Returns an immutable set of system IDs for the given conditions .
27,607
public static synchronized int countEquivalentIDs ( String id ) { int count = 0 ; UResourceBundle res = openOlsonResource ( null , id ) ; if ( res != null ) { try { UResourceBundle links = res . get ( "links" ) ; int [ ] v = links . getIntVector ( ) ; count = v . length ; } catch ( MissingResourceException ex ) { } } r...
Returns the number of IDs in the equivalency group that includes the given ID . An equivalency group contains zones that behave identically to the given zone .
27,608
public static synchronized String getEquivalentID ( String id , int index ) { String result = "" ; if ( index >= 0 ) { UResourceBundle res = openOlsonResource ( null , id ) ; if ( res != null ) { int zoneIdx = - 1 ; try { UResourceBundle links = res . get ( "links" ) ; int [ ] zones = links . getIntVector ( ) ; if ( in...
Returns an ID in the equivalency group that includes the given ID . An equivalency group contains zones that behave identically to the given zone .
27,609
public static String getCanonicalCLDRID ( String tzid ) { String canonical = CANONICAL_ID_CACHE . get ( tzid ) ; if ( canonical == null ) { canonical = findCLDRCanonicalID ( tzid ) ; if ( canonical == null ) { try { int zoneIdx = getZoneIndex ( tzid ) ; if ( zoneIdx >= 0 ) { UResourceBundle top = UResourceBundle . getB...
Return the canonical id for this tzid defined by CLDR which might be the id itself . If the given tzid is not known return null .
27,610
public static String getRegion ( String tzid ) { String region = REGION_CACHE . get ( tzid ) ; if ( region == null ) { int zoneIdx = getZoneIndex ( tzid ) ; if ( zoneIdx >= 0 ) { try { UResourceBundle top = UResourceBundle . getBundleInstance ( ICUData . ICU_BASE_NAME , ZONEINFORESNAME , ICUResourceBundle . ICU_DATA_CL...
Return the region code for this tzid . If tzid is not a system zone ID this method returns null .
27,611
public static String getCanonicalCountry ( String tzid ) { String country = getRegion ( tzid ) ; if ( country != null && country . equals ( kWorld ) ) { country = null ; } return country ; }
Return the canonical country code for this tzid . If we have none or if the time zone is not associated with a country or unknown return null .
27,612
public static String getCanonicalCountry ( String tzid , Output < Boolean > isPrimary ) { isPrimary . value = Boolean . FALSE ; String country = getRegion ( tzid ) ; if ( country != null && country . equals ( kWorld ) ) { return null ; } Boolean singleZone = SINGLE_COUNTRY_CACHE . get ( tzid ) ; if ( singleZone == null...
Return the canonical country code for this tzid . If we have none or if the time zone is not associated with a country or unknown return null . When the given zone is the primary zone of the country true is set to isPrimary .
27,613
public static UResourceBundle openOlsonResource ( UResourceBundle top , String id ) { UResourceBundle res = null ; int zoneIdx = getZoneIndex ( id ) ; if ( zoneIdx >= 0 ) { try { if ( top == null ) { top = UResourceBundle . getBundleInstance ( ICUData . ICU_BASE_NAME , ZONEINFORESNAME , ICUResourceBundle . ICU_DATA_CLA...
Given an ID and the top - level resource of the zoneinfo resource open the appropriate resource for the given time zone . Dereference links if necessary .
27,614
public static SimpleTimeZone getCustomTimeZone ( String id ) { int [ ] fields = new int [ 4 ] ; if ( parseCustomID ( id , fields ) ) { Integer key = Integer . valueOf ( fields [ 0 ] * ( fields [ 1 ] | fields [ 2 ] << 5 | fields [ 3 ] << 11 ) ) ; return CUSTOM_ZONE_CACHE . getInstance ( key , fields ) ; } return null ; ...
Parse a custom time zone identifier and return a corresponding zone .
27,615
public static String getCustomID ( String id ) { int [ ] fields = new int [ 4 ] ; if ( parseCustomID ( id , fields ) ) { return formatCustomID ( fields [ 1 ] , fields [ 2 ] , fields [ 3 ] , fields [ 0 ] < 0 ) ; } return null ; }
Parse a custom time zone identifier and return the normalized custom time zone identifier for the given custom id string .
27,616
public static SimpleTimeZone getCustomTimeZone ( int offset ) { boolean negative = false ; int tmp = offset ; if ( offset < 0 ) { negative = true ; tmp = - offset ; } int hour , min , sec ; if ( ASSERT ) { Assert . assrt ( "millis!=0" , tmp % 1000 != 0 ) ; } tmp /= 1000 ; sec = tmp % 60 ; tmp /= 60 ; min = tmp % 60 ; h...
Creates a custom zone for the offset
27,617
public void encode ( OutputStream out ) throws IOException { DerOutputStream tmp = new DerOutputStream ( ) ; tmp . write ( key . getEncoded ( ) ) ; out . write ( tmp . toByteArray ( ) ) ; }
Encode the key in DER form to the stream .
27,618
public String getLocalNameOfNode ( Node n ) { String name = n . getLocalName ( ) ; return ( null == name ) ? super . getLocalNameOfNode ( n ) : name ; }
Returns the local name of the given node as defined by the XML Namespaces specification . This is prepared to handle documents built using DOM Level 1 methods by falling back upon explicitly parsing the node name .
27,619
public double num ( XPathContext xctxt ) throws javax . xml . transform . TransformerException { return execute ( xctxt ) . num ( ) ; }
Evaluate expression to a number .
27,620
public boolean bool ( XPathContext xctxt ) throws javax . xml . transform . TransformerException { return execute ( xctxt ) . bool ( ) ; }
Evaluate expression to a boolean .
27,621
public DTMIterator asIteratorRaw ( XPathContext xctxt , int contextNode ) throws javax . xml . transform . TransformerException { try { xctxt . pushCurrentNodeAndExpression ( contextNode , contextNode ) ; XNodeSet nodeset = ( XNodeSet ) execute ( xctxt ) ; return nodeset . iterRaw ( ) ; } finally { xctxt . popCurrentNo...
Given an select expression and a context evaluate the XPath and return the resulting iterator but do not clone .
27,622
public void add ( StandardPlural rangeStart , StandardPlural rangeEnd , StandardPlural result ) { if ( isFrozen ) { throw new UnsupportedOperationException ( ) ; } explicit [ result . ordinal ( ) ] = true ; if ( rangeStart == null ) { for ( StandardPlural rs : StandardPlural . values ( ) ) { if ( rangeEnd == null ) { f...
Internal method for building . If the start or end are null it means everything of that type .
27,623
static CharInfo getCharInfo ( String entitiesFileName , String method ) { CharInfo charInfo = ( CharInfo ) m_getCharInfoCache . get ( entitiesFileName ) ; if ( charInfo != null ) { return mutableCopyOf ( charInfo ) ; } try { charInfo = getCharInfoBasedOnPrivilege ( entitiesFileName , method , true ) ; m_getCharInfoCach...
Factory that reads in a resource file that describes the mapping of characters to entity references .
27,624
private static CharInfo mutableCopyOf ( CharInfo charInfo ) { CharInfo copy = new CharInfo ( ) ; int max = charInfo . array_of_bits . length ; System . arraycopy ( charInfo . array_of_bits , 0 , copy . array_of_bits , 0 , max ) ; copy . firstWordNotUsed = charInfo . firstWordNotUsed ; max = charInfo . shouldMapAttrChar...
Create a mutable copy of the cached one .
27,625
private boolean extraEntity ( String outputString , int charToMap ) { boolean extra = false ; if ( charToMap < ASCII_MAX ) { switch ( charToMap ) { case '"' : if ( ! outputString . equals ( "&quot;" ) ) extra = true ; break ; case '&' : if ( ! outputString . equals ( "&amp;" ) ) extra = true ; break ; case '<' : if ( !...
This method returns true if there are some non - standard mappings to entities other than quot amp lt gt and its only purpose is for performance .
27,626
boolean defineChar2StringMapping ( String outputString , char inputChar ) { CharKey character = new CharKey ( inputChar ) ; m_charToString . put ( character , outputString ) ; set ( inputChar ) ; boolean extraMapping = extraEntity ( outputString , inputChar ) ; return extraMapping ; }
Call this method to register a char to String mapping for example to map < to &lt ; .
27,627
public static int bounds ( String source , int offset16 ) { char ch = source . charAt ( offset16 ) ; if ( isSurrogate ( ch ) ) { if ( isLeadSurrogate ( ch ) ) { if ( ++ offset16 < source . length ( ) && isTrailSurrogate ( source . charAt ( offset16 ) ) ) { return LEAD_SURROGATE_BOUNDARY ; } } else { -- offset16 ; if ( ...
Returns the type of the boundaries around the char at offset16 . Used for random access .
27,628
public static int append ( char [ ] target , int limit , int char32 ) { if ( char32 < CODEPOINT_MIN_VALUE || char32 > CODEPOINT_MAX_VALUE ) { throw new IllegalArgumentException ( "Illegal codepoint" ) ; } if ( char32 >= SUPPLEMENTARY_MIN_VALUE ) { target [ limit ++ ] = getLeadSurrogate ( char32 ) ; target [ limit ++ ] ...
Adds a codepoint to offset16 position of the argument char array .
27,629
public static int countCodePoint ( String source ) { if ( source == null || source . length ( ) == 0 ) { return 0 ; } return findCodePointOffset ( source , source . length ( ) ) ; }
Number of codepoints in a UTF16 String
27,630
public static int countCodePoint ( StringBuffer source ) { if ( source == null || source . length ( ) == 0 ) { return 0 ; } return findCodePointOffset ( source , source . length ( ) ) ; }
Number of codepoints in a UTF16 String buffer
27,631
public static int countCodePoint ( char source [ ] , int start , int limit ) { if ( source == null || source . length == 0 ) { return 0 ; } return findCodePointOffset ( source , start , limit , limit - start ) ; }
Number of codepoints in a UTF16 char array substring
27,632
public static void setCharAt ( StringBuffer target , int offset16 , int char32 ) { int count = 1 ; char single = target . charAt ( offset16 ) ; if ( isSurrogate ( single ) ) { if ( isLeadSurrogate ( single ) && ( target . length ( ) > offset16 + 1 ) && isTrailSurrogate ( target . charAt ( offset16 + 1 ) ) ) { count ++ ...
Set a code point into a UTF16 position . Adjusts target according if we are replacing a non - supplementary codepoint with a supplementary and vice versa .
27,633
public static int setCharAt ( char target [ ] , int limit , int offset16 , int char32 ) { if ( offset16 >= limit ) { throw new ArrayIndexOutOfBoundsException ( offset16 ) ; } int count = 1 ; char single = target [ offset16 ] ; if ( isSurrogate ( single ) ) { if ( isLeadSurrogate ( single ) && ( target . length > offset...
Set a code point into a UTF16 position in a char array . Adjusts target according if we are replacing a non - supplementary codepoint with a supplementary and vice versa .
27,634
public static int moveCodePointOffset ( String source , int offset16 , int shift32 ) { int result = offset16 ; int size = source . length ( ) ; int count ; char ch ; if ( offset16 < 0 || offset16 > size ) { throw new StringIndexOutOfBoundsException ( offset16 ) ; } if ( shift32 > 0 ) { if ( shift32 + offset16 > size ) ...
Shifts offset16 by the argument number of codepoints
27,635
public static int moveCodePointOffset ( char source [ ] , int start , int limit , int offset16 , int shift32 ) { int size = source . length ; int count ; char ch ; int result = offset16 + start ; if ( start < 0 || limit < start ) { throw new StringIndexOutOfBoundsException ( start ) ; } if ( limit > size ) { throw new ...
Shifts offset16 by the argument number of codepoints within a subarray .
27,636
public static String newString ( int [ ] codePoints , int offset , int count ) { if ( count < 0 ) { throw new IllegalArgumentException ( ) ; } char [ ] chars = new char [ count ] ; int w = 0 ; for ( int r = offset , e = offset + count ; r < e ; ++ r ) { int cp = codePoints [ r ] ; if ( cp < 0 || cp > 0x10ffff ) { throw...
Cover JDK 1 . 5 API . Create a String from an array of codePoints .
27,637
public static int getSingleCodePoint ( CharSequence s ) { if ( s == null || s . length ( ) == 0 ) { return - 1 ; } else if ( s . length ( ) == 1 ) { return s . charAt ( 0 ) ; } else if ( s . length ( ) > 2 ) { return - 1 ; } int cp = Character . codePointAt ( s , 0 ) ; if ( cp > 0xFFFF ) { return cp ; } return - 1 ; }
Utility for getting a code point from a CharSequence that contains exactly one code point .
27,638
public static ExecutorService newCachedThreadPool ( ThreadFactory threadFactory ) { return new ThreadPoolExecutor ( 0 , Integer . MAX_VALUE , 60L , TimeUnit . SECONDS , new SynchronousQueue < Runnable > ( ) , threadFactory ) ; }
Creates a thread pool that creates new threads as needed but will reuse previously constructed threads when they are available and uses the provided ThreadFactory to create new threads when needed .
27,639
private int getMoreData ( ) throws IOException { if ( done ) return - 1 ; int readin = input . read ( ibuffer ) ; if ( readin == - 1 ) { done = true ; try { obuffer = cipher . doFinal ( ) ; } catch ( IllegalBlockSizeException e ) { obuffer = null ; } catch ( BadPaddingException e ) { obuffer = null ; } if ( obuffer == ...
private convenience function .
27,640
private boolean matchModes ( QName m1 , QName m2 ) { return ( ( ( null == m1 ) && ( null == m2 ) ) || ( ( null != m1 ) && ( null != m2 ) && m1 . equals ( m2 ) ) ) ; }
Tell if two modes match according to the rules of XSLT .
27,641
public boolean matches ( XPathContext xctxt , int targetNode , QName mode ) throws TransformerException { double score = m_stepPattern . getMatchScore ( xctxt , targetNode ) ; return ( XPath . MATCH_SCORE_NONE != score ) && matchModes ( mode , m_template . getMode ( ) ) ; }
Return the mode associated with the template .
27,642
public final void setMaxPriority ( int pri ) { int ngroupsSnapshot ; ThreadGroup [ ] groupsSnapshot ; synchronized ( this ) { checkAccess ( ) ; if ( pri < Thread . MIN_PRIORITY ) { pri = Thread . MIN_PRIORITY ; } if ( pri > Thread . MAX_PRIORITY ) { pri = Thread . MAX_PRIORITY ; } maxPriority = ( parent != null ) ? Mat...
before using it .
27,643
public final boolean parentOf ( ThreadGroup g ) { for ( ; g != null ; g = g . parent ) { if ( g == this ) { return true ; } } return false ; }
Tests if this thread group is either the thread group argument or one of its ancestor thread groups .
27,644
public int activeCount ( ) { int result ; int ngroupsSnapshot ; ThreadGroup [ ] groupsSnapshot ; synchronized ( this ) { if ( destroyed ) { return 0 ; } result = nthreads ; ngroupsSnapshot = ngroups ; if ( groups != null ) { groupsSnapshot = Arrays . copyOf ( groups , ngroupsSnapshot ) ; } else { groupsSnapshot = null ...
Returns an estimate of the number of active threads in this thread group and its subgroups . Recursively iterates over all subgroups in this thread group .
27,645
public int activeGroupCount ( ) { int ngroupsSnapshot ; ThreadGroup [ ] groupsSnapshot ; synchronized ( this ) { if ( destroyed ) { return 0 ; } ngroupsSnapshot = ngroups ; if ( groups != null ) { groupsSnapshot = Arrays . copyOf ( groups , ngroupsSnapshot ) ; } else { groupsSnapshot = null ; } } int n = ngroupsSnapsho...
Returns an estimate of the number of active groups in this thread group and its subgroups . Recursively iterates over all subgroups in this thread group .
27,646
private final void add ( ThreadGroup g ) { synchronized ( this ) { if ( destroyed ) { throw new IllegalThreadStateException ( ) ; } if ( groups == null ) { groups = new ThreadGroup [ 4 ] ; } else if ( ngroups == groups . length ) { groups = Arrays . copyOf ( groups , ngroups * 2 ) ; } groups [ ngroups ] = g ; ngroups +...
Adds the specified Thread group to this group .
27,647
private void remove ( ThreadGroup g ) { synchronized ( this ) { if ( destroyed ) { return ; } for ( int i = 0 ; i < ngroups ; i ++ ) { if ( groups [ i ] == g ) { ngroups -= 1 ; System . arraycopy ( groups , i + 1 , groups , i , ngroups - i ) ; groups [ ngroups ] = null ; break ; } } if ( nthreads == 0 ) { notifyAll ( )...
Removes the specified Thread group from this group .
27,648
void add ( Thread t ) { synchronized ( this ) { if ( destroyed ) { throw new IllegalThreadStateException ( ) ; } if ( threads == null ) { threads = new Thread [ 4 ] ; } else if ( nthreads == threads . length ) { threads = Arrays . copyOf ( threads , nthreads * 2 ) ; } threads [ nthreads ] = t ; nthreads ++ ; nUnstarted...
Adds the specified thread to this thread group .
27,649
private void remove ( Thread t ) { synchronized ( this ) { if ( destroyed ) { return ; } for ( int i = 0 ; i < nthreads ; i ++ ) { if ( threads [ i ] == t ) { System . arraycopy ( threads , i + 1 , threads , i , -- nthreads - i ) ; threads [ nthreads ] = null ; break ; } } } }
Removes the specified Thread from this group . Invoking this method on a thread group that has been destroyed has no effect .
27,650
public int getCharFromName ( int choice , String name ) { if ( choice >= UCharacterNameChoice . CHAR_NAME_CHOICE_COUNT || name == null || name . length ( ) == 0 ) { return - 1 ; } int result = getExtendedChar ( name . toLowerCase ( Locale . ENGLISH ) , choice ) ; if ( result >= - 1 ) { return result ; } String upperCas...
Find a character by its name and return its code point value
27,651
public String getExtendedName ( int ch ) { String result = getName ( ch , UCharacterNameChoice . UNICODE_CHAR_NAME ) ; if ( result == null ) { result = getExtendedOr10Name ( ch ) ; } return result ; }
Retrieves the extended name
27,652
public int getGroup ( int codepoint ) { int endGroup = m_groupcount_ ; int msb = getCodepointMSB ( codepoint ) ; int result = 0 ; while ( result < endGroup - 1 ) { int gindex = ( result + endGroup ) >> 1 ; if ( msb < getGroupMSB ( gindex ) ) { endGroup = gindex ; } else { result = gindex ; } } return result ; }
Gets the group index for the codepoint or the group before it .
27,653
public String getExtendedOr10Name ( int ch ) { String result = null ; if ( result == null ) { int type = getType ( ch ) ; if ( type >= TYPE_NAMES_ . length ) { result = UNKNOWN_TYPE_NAME_ ; } else { result = TYPE_NAMES_ [ type ] ; } synchronized ( m_utilStringBuffer_ ) { m_utilStringBuffer_ . setLength ( 0 ) ; m_utilSt...
Gets the extended and 1 . 0 name when the most current unicode names fail
27,654
public String getAlgorithmName ( int index , int codepoint ) { String result = null ; synchronized ( m_utilStringBuffer_ ) { m_utilStringBuffer_ . setLength ( 0 ) ; m_algorithm_ [ index ] . appendName ( codepoint , m_utilStringBuffer_ ) ; result = m_utilStringBuffer_ . toString ( ) ; } return result ; }
Gets the Algorithmic name of the codepoint
27,655
public synchronized String getGroupName ( int ch , int choice ) { int msb = getCodepointMSB ( ch ) ; int group = getGroup ( ch ) ; if ( msb == m_groupinfo_ [ group * m_groupsize_ ] ) { int index = getGroupLengths ( group , m_groupoffsets_ , m_grouplengths_ ) ; int offset = ch & GROUP_MASK_ ; return getGroupName ( index...
Gets the group name of the character
27,656
boolean setToken ( char token [ ] , byte tokenstring [ ] ) { if ( token != null && tokenstring != null && token . length > 0 && tokenstring . length > 0 ) { m_tokentable_ = token ; m_tokenstring_ = tokenstring ; return true ; } return false ; }
Sets the token data
27,657
boolean setAlgorithm ( AlgorithmName alg [ ] ) { if ( alg != null && alg . length != 0 ) { m_algorithm_ = alg ; return true ; } return false ; }
Set the algorithm name information array
27,658
boolean setGroupCountSize ( int count , int size ) { if ( count <= 0 || size <= 0 ) { return false ; } m_groupcount_ = count ; m_groupsize_ = size ; return true ; }
Sets the number of group and size of each group in number of char
27,659
boolean setGroup ( char group [ ] , byte groupstring [ ] ) { if ( group != null && groupstring != null && group . length > 0 && groupstring . length > 0 ) { m_groupinfo_ = group ; m_groupstring_ = groupstring ; return true ; } return false ; }
Sets the group name data
27,660
private String getAlgName ( int ch , int choice ) { if ( choice == UCharacterNameChoice . UNICODE_CHAR_NAME || choice == UCharacterNameChoice . EXTENDED_CHAR_NAME ) { synchronized ( m_utilStringBuffer_ ) { m_utilStringBuffer_ . setLength ( 0 ) ; for ( int index = m_algorithm_ . length - 1 ; index >= 0 ; index -- ) { if...
Gets the algorithmic name for the argument character
27,661
private synchronized int getGroupChar ( String name , int choice ) { for ( int i = 0 ; i < m_groupcount_ ; i ++ ) { int startgpstrindex = getGroupLengths ( i , m_groupoffsets_ , m_grouplengths_ ) ; int result = getGroupChar ( startgpstrindex , m_grouplengths_ , name , choice ) ; if ( result != - 1 ) { return ( m_groupi...
Getting the character with the tokenized argument name
27,662
private int getGroupChar ( int index , char length [ ] , String name , int choice ) { byte b = 0 ; char token ; int len ; int namelen = name . length ( ) ; int nindex ; int count ; for ( int result = 0 ; result <= LINES_PER_GROUP_ ; result ++ ) { nindex = 0 ; len = length [ result ] ; if ( choice != UCharacterNameChoic...
Compares and retrieve character if name is found within the argument group
27,663
private static int getType ( int ch ) { if ( UCharacterUtility . isNonCharacter ( ch ) ) { return NON_CHARACTER_ ; } int result = UCharacter . getType ( ch ) ; if ( result == UCharacterCategory . SURROGATE ) { if ( ch <= UTF16 . LEAD_SURROGATE_MAX_VALUE ) { result = LEAD_SURROGATE_ ; } else { result = TRAIL_SURROGATE_ ...
Gets the character extended type
27,664
private int addAlgorithmName ( int maxlength ) { int result = 0 ; for ( int i = m_algorithm_ . length - 1 ; i >= 0 ; i -- ) { result = m_algorithm_ [ i ] . add ( m_nameSet_ , maxlength ) ; if ( result > maxlength ) { maxlength = result ; } } return maxlength ; }
Adds all algorithmic names into the name set . Equivalent to part of calcAlgNameSetsLengths .
27,665
private int addExtendedName ( int maxlength ) { for ( int i = TYPE_NAMES_ . length - 1 ; i >= 0 ; i -- ) { int length = 9 + add ( m_nameSet_ , TYPE_NAMES_ [ i ] ) ; if ( length > maxlength ) { maxlength = length ; } } return maxlength ; }
Adds all extended names into the name set . Equivalent to part of calcExtNameSetsLengths .
27,666
private int [ ] addGroupName ( int offset , int length , byte tokenlength [ ] , int set [ ] ) { int resultnlength = 0 ; int resultplength = 0 ; while ( resultplength < length ) { char b = ( char ) ( m_groupstring_ [ offset + resultplength ] & 0xff ) ; resultplength ++ ; if ( b == ';' ) { break ; } if ( b >= m_tokentabl...
Adds names of a group to the argument set . Equivalent to calcNameSetLength .
27,667
private boolean initNameSetsLengths ( ) { if ( m_maxNameLength_ > 0 ) { return true ; } String extra = "0123456789ABCDEF<>-" ; for ( int i = extra . length ( ) - 1 ; i >= 0 ; i -- ) { add ( m_nameSet_ , extra . charAt ( i ) ) ; } m_maxNameLength_ = addAlgorithmName ( 0 ) ; m_maxNameLength_ = addExtendedName ( m_maxName...
Sets up the name sets and the calculation of the maximum lengths . Equivalent to calcNameSetsLengths .
27,668
private void convert ( int set [ ] , UnicodeSet uset ) { uset . clear ( ) ; if ( ! initNameSetsLengths ( ) ) { return ; } for ( char c = 255 ; c > 0 ; c -- ) { if ( contains ( set , c ) ) { uset . add ( c ) ; } } }
Converts the char set cset into a Unicode set uset . Equivalent to charSetToUSet .
27,669
public void set ( V newReference , boolean newMark ) { Pair < V > current = pair ; if ( newReference != current . reference || newMark != current . mark ) this . pair = Pair . of ( newReference , newMark ) ; }
Unconditionally sets the value of both the reference and mark .
27,670
public int serialize ( OutputStream os ) throws IOException { DataOutputStream dos = new DataOutputStream ( os ) ; int bytesWritten = 0 ; bytesWritten += serializeHeader ( dos ) ; for ( int i = 0 ; i < dataLength ; i ++ ) { dos . writeChar ( index [ data16 + i ] ) ; } bytesWritten += dataLength * 2 ; return bytesWritte...
Serialize a Trie2_16 onto an OutputStream .
27,671
private static InetAddress [ ] lookupHostByName ( String host , int netId ) throws UnknownHostException { BlockGuard . getThreadPolicy ( ) . onNetwork ( ) ; Object cachedResult = addressCache . get ( host , netId ) ; if ( cachedResult != null ) { if ( cachedResult instanceof InetAddress [ ] ) { return ( InetAddress [ ]...
Resolves a hostname to its IP addresses using a cache .
27,672
public byte [ ] toByteArray ( ) { int length = getLength ( ) + 1 ; byte result [ ] = new byte [ length ] ; System . arraycopy ( m_key_ , 0 , result , 0 , length ) ; return result ; }
Duplicates and returns the value of this CollationKey as a sequence of big - endian bytes terminated by a null .
27,673
public int compareTo ( CollationKey target ) { for ( int i = 0 ; ; ++ i ) { int l = m_key_ [ i ] & 0xff ; int r = target . m_key_ [ i ] & 0xff ; if ( l < r ) { return - 1 ; } else if ( l > r ) { return 1 ; } else if ( l == 0 ) { return 0 ; } } }
Compare this CollationKey to another CollationKey . The collation rules of the Collator that created this key are applied .
27,674
private int getLength ( ) { if ( m_length_ >= 0 ) { return m_length_ ; } int length = m_key_ . length ; for ( int index = 0 ; index < length ; index ++ ) { if ( m_key_ [ index ] == 0 ) { length = index ; break ; } } m_length_ = length ; return m_length_ ; }
Gets the length of the CollationKey
27,675
public Node getNode ( int nodeHandle ) { int identity = makeNodeIdentity ( nodeHandle ) ; return ( Node ) m_nodes . elementAt ( identity ) ; }
Return an DOM node for the given node .
27,676
protected int getNextNodeIdentity ( int identity ) { identity += 1 ; if ( identity >= m_nodes . size ( ) ) { if ( ! nextNode ( ) ) identity = DTM . NULL ; } return identity ; }
Get the next node identity value in the list and call the iterator if it hasn t been added yet .
27,677
public int getHandleOfNode ( Node node ) { if ( null != node ) { if ( ( m_root == node ) || ( m_root . getNodeType ( ) == DOCUMENT_NODE && m_root == node . getOwnerDocument ( ) ) || ( m_root . getNodeType ( ) != DOCUMENT_NODE && m_root . getOwnerDocument ( ) == node . getOwnerDocument ( ) ) ) { for ( Node cursor = node...
Get the handle from a Node . This is a more robust version of getHandleFromNode intended to be usable by the public .
27,678
public boolean isWhitespace ( int nodeHandle ) { int type = getNodeType ( nodeHandle ) ; Node node = getNode ( nodeHandle ) ; if ( TEXT_NODE == type || CDATA_SECTION_NODE == type ) { FastStringBuffer buf = StringBufferPool . get ( ) ; while ( node != null ) { buf . append ( node . getNodeValue ( ) ) ; node = logicalNex...
Determine if the string - value of a node is whitespace
27,679
public void dispatchToEvents ( int nodeHandle , org . xml . sax . ContentHandler ch ) throws org . xml . sax . SAXException { TreeWalker treeWalker = m_walker ; ContentHandler prevCH = treeWalker . getContentHandler ( ) ; if ( null != prevCH ) { treeWalker = new TreeWalker ( null ) ; } treeWalker . setContentHandler ( ...
Directly create SAX parser events from a subtree .
27,680
void reExecutePeriodic ( RunnableScheduledFuture < ? > task ) { if ( canRunInCurrentRunState ( true ) ) { super . getQueue ( ) . add ( task ) ; if ( ! canRunInCurrentRunState ( true ) && remove ( task ) ) task . cancel ( false ) ; else ensurePrestart ( ) ; } }
Requeues a periodic task unless current run state precludes it . Same idea as delayedExecute except drops task rather than rejecting .
27,681
protected < V > RunnableScheduledFuture < V > decorateTask ( Runnable runnable , RunnableScheduledFuture < V > task ) { return task ; }
Modifies or replaces the task used to execute a runnable . This method can be used to override the concrete class used for managing internal tasks . The default implementation simply returns the given task .
27,682
protected < V > RunnableScheduledFuture < V > decorateTask ( Callable < V > callable , RunnableScheduledFuture < V > task ) { return task ; }
Modifies or replaces the task used to execute a callable . This method can be used to override the concrete class used for managing internal tasks . The default implementation simply returns the given task .
27,683
long triggerTime ( long delay ) { return System . nanoTime ( ) + ( ( delay < ( Long . MAX_VALUE >> 1 ) ) ? delay : overflowFree ( delay ) ) ; }
Returns the nanoTime - based trigger time of a delayed action .
27,684
private long overflowFree ( long delay ) { Delayed head = ( Delayed ) super . getQueue ( ) . peek ( ) ; if ( head != null ) { long headDelay = head . getDelay ( NANOSECONDS ) ; if ( headDelay < 0 && ( delay - headDelay < 0 ) ) delay = Long . MAX_VALUE + headDelay ; } return delay ; }
Constrains the values of all delays in the queue to be within Long . MAX_VALUE of each other to avoid overflow in compareTo . This may occur if a task is eligible to be dequeued but has not yet been while some other task is added with a delay of Long . MAX_VALUE .
27,685
public static int floatToIntBits ( float value ) { int result = floatToRawIntBits ( value ) ; if ( ( ( result & FloatConsts . EXP_BIT_MASK ) == FloatConsts . EXP_BIT_MASK ) && ( result & FloatConsts . SIGNIF_BIT_MASK ) != 0 ) result = 0x7fc00000 ; return result ; }
Returns a representation of the specified floating - point value according to the IEEE 754 floating - point single format bit layout .
27,686
private void getMatchingCACerts ( ForwardState currentState , List < CertStore > certStores , Collection < X509Certificate > caCerts ) throws IOException { if ( debug != null ) { debug . println ( "ForwardBuilder.getMatchingCACerts()..." ) ; } int initialSize = caCerts . size ( ) ; X509CertSelector sel = null ; if ( cu...
Retrieves all CA certificates which satisfy constraints and requirements specified in the parameters and PKIX state .
27,687
@ SuppressWarnings ( "unchecked" ) private boolean getCerts ( AuthorityInfoAccessExtension aiaExt , Collection < X509Certificate > certs ) { if ( Builder . USE_AIA == false ) { return false ; } List < AccessDescription > adList = aiaExt . getAccessDescriptions ( ) ; if ( adList == null || adList . isEmpty ( ) ) { retur...
because of the selector so the cast is safe
27,688
public boolean offer ( E e ) { final ReentrantLock lock = this . lock ; lock . lock ( ) ; try { q . offer ( e ) ; if ( q . peek ( ) == e ) { leader = null ; available . signal ( ) ; } return true ; } finally { lock . unlock ( ) ; } }
Inserts the specified element into this delay queue .
27,689
public E take ( ) throws InterruptedException { final ReentrantLock lock = this . lock ; lock . lockInterruptibly ( ) ; try { for ( ; ; ) { E first = q . peek ( ) ; if ( first == null ) available . await ( ) ; else { long delay = first . getDelay ( NANOSECONDS ) ; if ( delay <= 0L ) return q . poll ( ) ; first = null ;...
Retrieves and removes the head of this queue waiting if necessary until an element with an expired delay is available on this queue .
27,690
public E poll ( long timeout , TimeUnit unit ) throws InterruptedException { long nanos = unit . toNanos ( timeout ) ; final ReentrantLock lock = this . lock ; lock . lockInterruptibly ( ) ; try { for ( ; ; ) { E first = q . peek ( ) ; if ( first == null ) { if ( nanos <= 0L ) return null ; else nanos = available . awa...
Retrieves and removes the head of this queue waiting if necessary until an element with an expired delay is available on this queue or the specified wait time expires .
27,691
private E peekExpired ( ) { E first = q . peek ( ) ; return ( first == null || first . getDelay ( NANOSECONDS ) > 0 ) ? null : first ; }
Returns first element only if it is expired . Used only by drainTo . Call only when holding lock .
27,692
public void clear ( ) { final ReentrantLock lock = this . lock ; lock . lock ( ) ; try { q . clear ( ) ; } finally { lock . unlock ( ) ; } }
Atomically removes all of the elements from this delay queue . The queue will be empty after this call returns . Elements with an unexpired delay are not waited for ; they are simply discarded from the queue .
27,693
public boolean remove ( Object o ) { final ReentrantLock lock = this . lock ; lock . lock ( ) ; try { return q . remove ( o ) ; } finally { lock . unlock ( ) ; } }
Removes a single instance of the specified element from this queue if it is present whether or not it has expired .
27,694
Vector getCounters ( ElemNumber numberElem ) { Vector counters = ( Vector ) this . get ( numberElem ) ; return ( null == counters ) ? putElemNumber ( numberElem ) : counters ; }
Get the list of counters that corresponds to the given ElemNumber object .
27,695
Vector putElemNumber ( ElemNumber numberElem ) { Vector counters = new Vector ( ) ; this . put ( numberElem , counters ) ; return counters ; }
Put a counter into the table and create an empty vector as it s value .
27,696
void appendBtoFList ( NodeSetDTM flist , NodeSetDTM blist ) { int n = blist . size ( ) ; for ( int i = ( n - 1 ) ; i >= 0 ; i -- ) { flist . addElement ( blist . item ( i ) ) ; } }
Add a list of counted nodes that were built in backwards document order or a list of counted nodes that are in forwards document order .
27,697
public int countNode ( XPathContext support , ElemNumber numberElem , int node ) throws TransformerException { int count = 0 ; Vector counters = getCounters ( numberElem ) ; int nCounters = counters . size ( ) ; int target = numberElem . getTargetNode ( support , node ) ; if ( DTM . NULL != target ) { for ( int i = 0 ;...
Count forward until the given node is found or until we have looked to the given amount .
27,698
int match ( byte [ ] text , int textLen , byte [ ] [ ] escapeSequences ) { int i , j ; int escN ; int hits = 0 ; int misses = 0 ; int shifts = 0 ; int quality ; scanInput : for ( i = 0 ; i < textLen ; i ++ ) { if ( text [ i ] == 0x1b ) { checkEscapes : for ( escN = 0 ; escN < escapeSequences . length ; escN ++ ) { byte...
Matching function shared among the 2022 detectors JP CN and KR Counts up the number of legal an unrecognized escape sequences in the sample of text and computes a score based on the total number & the proportion that fit the encoding .
27,699
private static DateFormatSymbols getCachedInstance ( Locale locale ) { SoftReference < DateFormatSymbols > ref = cachedInstances . get ( locale ) ; DateFormatSymbols dfs = null ; if ( ref == null || ( dfs = ref . get ( ) ) == null ) { dfs = new DateFormatSymbols ( locale ) ; ref = new SoftReference < DateFormatSymbols ...
Returns a cached DateFormatSymbols if it s found in the cache . Otherwise this method returns a newly cached instance for the given locale .