idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
27,000
public void setRoot ( int root ) { super . setRoot ( root ) ; m_exprObj = FilterExprIteratorSimple . executeFilterExpr ( root , m_lpi . getXPathContext ( ) , m_lpi . getPrefixResolver ( ) , m_lpi . getIsTopLevel ( ) , m_lpi . m_stackFrame , m_expr ) ; }
Set the root node of the TreeWalker .
27,001
public short acceptNode ( int n ) { try { if ( getPredicateCount ( ) > 0 ) { countProximityPosition ( 0 ) ; if ( ! executePredicates ( n , m_lpi . getXPathContext ( ) ) ) return DTMIterator . FILTER_SKIP ; } return DTMIterator . FILTER_ACCEPT ; } catch ( javax . xml . transform . TransformerException se ) { throw new R...
This method needs to override AxesWalker . acceptNode because FilterExprWalkers don t need to and shouldn t do a node test .
27,002
private int sieveSearch ( int limit , int start ) { if ( start >= limit ) return - 1 ; int index = start ; do { if ( ! get ( index ) ) return index ; index ++ ; } while ( index < limit - 1 ) ; return - 1 ; }
This method returns the index of the first clear bit in the search array that occurs at or after start . It will not search past the specified limit . It returns - 1 if there is no such clear bit .
27,003
private void sieveSingle ( int limit , int start , int step ) { while ( start < limit ) { set ( start ) ; start += step ; } }
Sieve a single set of multiples out of the sieve . Begin to remove multiples of the specified step starting at the specified start index up to the specified limit .
27,004
BigInteger retrieve ( BigInteger initValue , int certainty , java . util . Random random ) { int offset = 1 ; for ( int i = 0 ; i < bits . length ; i ++ ) { long nextLong = ~ bits [ i ] ; for ( int j = 0 ; j < 64 ; j ++ ) { if ( ( nextLong & 1 ) == 1 ) { BigInteger candidate = initValue . add ( BigInteger . valueOf ( o...
Test probable primes in the sieve and return successful candidates .
27,005
static Logger getPlatformLogger ( String name ) { LogManager manager = LogManager . getLogManager ( ) ; Logger result = manager . demandSystemLogger ( name , SYSTEM_LOGGER_RB_NAME ) ; return result ; }
i . e . caller of sun . util . logging . PlatformLogger . getLogger
27,006
public boolean isLoggable ( Level level ) { if ( level . intValue ( ) < levelValue || levelValue == offValue ) { return false ; } return true ; }
Check if a message of the given level would actually be logged by this logger . This check is based on the Loggers effective level which may be inherited from its parent .
27,007
private synchronized ResourceBundle findResourceBundle ( String name , boolean useCallersClassLoader ) { if ( name == null ) { return null ; } Locale currentLocale = Locale . getDefault ( ) ; if ( catalog != null && currentLocale . equals ( catalogLocale ) && name . equals ( catalogName ) ) { return catalog ; } if ( na...
Private utility method to map a resource bundle name to an actual resource bundle using a simple one - entry cache . Returns null for a null name . May also return null if we can t find the resource bundle and there is no suitable previous cached value .
27,008
private synchronized void setupResourceInfo ( String name , Class < ? > callersClass ) { if ( name == null ) { return ; } if ( findResourceBundle ( name , true ) == null ) { this . callersClassLoaderRef = null ; throw new MissingResourceException ( "Can't find " + name + " bundle" , name , "" ) ; } resourceBundleName =...
Synchronized to prevent races in setting the fields .
27,009
private void doSetParent ( Logger newParent ) { synchronized ( treeLock ) { LogManager . LoggerWeakRef ref = null ; if ( parent != null ) { for ( Iterator < LogManager . LoggerWeakRef > iter = parent . kids . iterator ( ) ; iter . hasNext ( ) ; ) { ref = iter . next ( ) ; Logger kid = ref . get ( ) ; if ( kid == this )...
Logger onto a parent logger .
27,010
private void updateEffectiveLevel ( ) { int newLevelValue ; if ( levelObject != null ) { newLevelValue = levelObject . intValue ( ) ; } else { if ( parent != null ) { newLevelValue = parent . levelValue ; } else { newLevelValue = Level . INFO . intValue ( ) ; } } if ( levelValue == newLevelValue ) { return ; } levelVal...
recursively for our children .
27,011
private String getEffectiveResourceBundleName ( ) { Logger target = this ; while ( target != null ) { String rbn = target . getResourceBundleName ( ) ; if ( rbn != null ) { return rbn ; } target = target . getParent ( ) ; } return null ; }
May return null
27,012
protected void pushIgnoreNullabilityPragmas ( ) { if ( getGenerationUnit ( ) . options ( ) . nullability ( ) || getGenerationUnit ( ) . hasNullabilityAnnotations ( ) ) { newline ( ) ; println ( "#if __has_feature(nullability)" ) ; println ( "#pragma clang diagnostic push" ) ; println ( "#pragma GCC diagnostic ignored \...
Ignores nullability warnings . This method should be paired with popIgnoreNullabilityPragmas .
27,013
protected void popIgnoreNullabilityPragmas ( ) { if ( getGenerationUnit ( ) . options ( ) . nullability ( ) || getGenerationUnit ( ) . hasNullabilityAnnotations ( ) ) { newline ( ) ; println ( "#if __has_feature(nullability)" ) ; println ( "#pragma clang diagnostic pop" ) ; println ( "#endif" ) ; } }
Restores warnings after a call to pushIgnoreNullabilityPragmas .
27,014
public int getSerializedDataSize ( ) { int result = ( 4 << 2 ) ; result += ( m_dataOffset_ << 1 ) ; if ( isCharTrie ( ) ) { result += ( m_dataLength_ << 1 ) ; } else if ( isIntTrie ( ) ) { result += ( m_dataLength_ << 2 ) ; } return result ; }
Gets the serialized data file size of the Trie . This is used during trie data reading for size checking purposes .
27,015
protected final int getBMPOffset ( char ch ) { return ( ch >= UTF16 . LEAD_SURROGATE_MIN_VALUE && ch <= UTF16 . LEAD_SURROGATE_MAX_VALUE ) ? getRawOffset ( LEAD_INDEX_OFFSET_ , ch ) : getRawOffset ( 0 , ch ) ; }
Gets the offset to data which the BMP character points to Treats a lead surrogate as a normal code point .
27,016
private final boolean checkHeader ( int signature ) { if ( signature != HEADER_SIGNATURE_ ) { return false ; } if ( ( m_options_ & HEADER_OPTIONS_SHIFT_MASK_ ) != INDEX_STAGE_1_SHIFT_ || ( ( m_options_ >> HEADER_OPTIONS_INDEX_SHIFT_ ) & HEADER_OPTIONS_SHIFT_MASK_ ) != INDEX_STAGE_2_SHIFT_ ) { return false ; } return tr...
Authenticates raw data header . Checking the header information signature and options .
27,017
static public XObject create ( Object val ) { XObject result ; if ( val instanceof XObject ) { result = ( XObject ) val ; } else if ( val instanceof String ) { result = new XString ( ( String ) val ) ; } else if ( val instanceof Boolean ) { result = new XBoolean ( ( Boolean ) val ) ; } else if ( val instanceof Double )...
Create the right XObject based on the type of the object passed . This function can not make an XObject that exposes DOM Nodes NodeLists and NodeIterators to the XSLT stylesheet as node - sets .
27,018
static boolean certCanSignCrl ( X509Certificate cert ) { boolean [ ] keyUsage = cert . getKeyUsage ( ) ; if ( keyUsage != null ) { return keyUsage [ 6 ] ; } return false ; }
Checks that a cert can be used to verify a CRL .
27,019
public static Locale getLocaleFromName ( String name ) { String language = "" ; String country = "" ; String variant = "" ; int i1 = name . indexOf ( '_' ) ; if ( i1 < 0 ) { language = name ; } else { language = name . substring ( 0 , i1 ) ; ++ i1 ; int i2 = name . indexOf ( '_' , i1 ) ; if ( i2 < 0 ) { country = name ...
A helper function to convert a string of the form aa_BB_CC to a locale object . Why isn t this in Locale?
27,020
public Trie2Writable set ( int c , int value ) { if ( c < 0 || c > 0x10ffff ) { throw new IllegalArgumentException ( "Invalid code point." ) ; } set ( c , true , value ) ; fHash = 0 ; return this ; }
Set a value for a code point .
27,021
private void fillBlock ( int block , int start , int limit , int value , int initialValue , boolean overwrite ) { int i ; int pLimit = block + limit ; if ( overwrite ) { for ( i = block + start ; i < pLimit ; i ++ ) { data [ i ] = value ; } } else { for ( i = block + start ; i < pLimit ; i ++ ) { if ( data [ i ] == ini...
initialValue is ignored if overwrite = TRUE
27,022
public Trie2Writable setRange ( Trie2 . Range range , boolean overwrite ) { fHash = 0 ; if ( range . leadSurrogate ) { for ( int c = range . startCodePoint ; c <= range . endCodePoint ; c ++ ) { if ( overwrite || getFromU16SingleLead ( ( char ) c ) == this . initialValue ) { setForLeadSurrogateCodeUnit ( ( char ) c , r...
Set the values from a Trie2 . Range .
27,023
public Trie2_16 toTrie2_16 ( ) { Trie2_16 frozenTrie = new Trie2_16 ( ) ; freeze ( frozenTrie , ValueWidth . BITS_16 ) ; return frozenTrie ; }
Produce an optimized read - only Trie2_16 from this writable Trie . The data values outside of the range that will fit in a 16 bit unsigned value will be truncated .
27,024
public Trie2_32 toTrie2_32 ( ) { Trie2_32 frozenTrie = new Trie2_32 ( ) ; freeze ( frozenTrie , ValueWidth . BITS_32 ) ; return frozenTrie ; }
Produce an optimized read - only Trie2_32 from this writable Trie .
27,025
public TimeUnitFormat setLocale ( ULocale locale ) { if ( locale != this . locale ) { mf = mf . withLocale ( locale ) ; setLocale ( locale , locale ) ; this . locale = locale ; isReady = false ; } return this ; }
Set the locale used for formatting or parsing .
27,026
public StringBuffer format ( Object obj , StringBuffer toAppendTo , FieldPosition pos ) { return mf . format ( obj , toAppendTo , pos ) ; }
Format a TimeUnitAmount .
27,027
public TimeUnitAmount parseObject ( String source , ParsePosition pos ) { if ( ! isReady ) { setup ( ) ; } Number resultNumber = null ; TimeUnit resultTimeUnit = null ; int oldPos = pos . getIndex ( ) ; int newPos = - 1 ; int longestParseDistance = 0 ; String countOfLongestMatch = null ; for ( TimeUnit timeUnit : timeU...
Parse a TimeUnitAmount .
27,028
private void searchInTree ( String resourceKey , int styl , TimeUnit timeUnit , String srcPluralCount , String searchPluralCount , Map < String , Object [ ] > countToPatterns ) { ULocale parentLocale = locale ; String srcTimeUnitName = timeUnit . toString ( ) ; while ( parentLocale != null ) { try { ICUResourceBundle u...
then other is the searchPluralCount .
27,029
private void initialize ( ULocale locale ) { this . requestedLocale = locale . toLocale ( ) ; this . ulocale = locale ; CacheData data = cachedLocaleData . getInstance ( locale , null ) ; setLocale ( data . validLocale , data . validLocale ) ; setDigitStrings ( data . digits ) ; String [ ] numberElements = data . numbe...
Initializes the symbols from the locale data .
27,030
public void init ( boolean forward ) throws CertPathValidatorException { if ( ! forward ) { prevPubKey = trustedPubKey ; if ( PKIX . isDSAPublicKeyWithoutParams ( prevPubKey ) ) { throw new CertPathValidatorException ( "Key parameters missing" ) ; } prevSubject = caName ; } else { throw new CertPathValidatorException (...
Initializes the internal state of the checker from parameters specified in the constructor .
27,031
private void verifySignature ( X509Certificate cert ) throws CertPathValidatorException { String msg = "signature" ; if ( debug != null ) debug . println ( "---checking " + msg + "..." ) ; try { if ( sigProvider != null ) { cert . verify ( prevPubKey , sigProvider ) ; } else { cert . verify ( prevPubKey ) ; } } catch (...
Verifies the signature on the certificate using the previous public key .
27,032
private void verifyTimestamp ( X509Certificate cert ) throws CertPathValidatorException { String msg = "timestamp" ; if ( debug != null ) debug . println ( "---checking " + msg + ":" + date . toString ( ) + "..." ) ; try { cert . checkValidity ( date ) ; } catch ( CertificateExpiredException e ) { throw new CertPathVal...
Internal method to verify the timestamp on a certificate
27,033
private void verifyNameChaining ( X509Certificate cert ) throws CertPathValidatorException { if ( prevSubject != null ) { String msg = "subject/issuer name chaining" ; if ( debug != null ) debug . println ( "---checking " + msg + "..." ) ; X500Principal currIssuer = cert . getIssuerX500Principal ( ) ; if ( X500Name . a...
Internal method to check that cert has a valid DN to be next in a chain
27,034
private void updateState ( X509Certificate currCert ) throws CertPathValidatorException { PublicKey cKey = currCert . getPublicKey ( ) ; if ( debug != null ) { debug . println ( "BasicChecker.updateState issuer: " + currCert . getIssuerX500Principal ( ) . toString ( ) + "; subject: " + currCert . getSubjectX500Principa...
Internal method to manage state information at each iteration
27,035
static PublicKey makeInheritedParamsKey ( PublicKey keyValueKey , PublicKey keyParamsKey ) throws CertPathValidatorException { if ( ! ( keyValueKey instanceof DSAPublicKey ) || ! ( keyParamsKey instanceof DSAPublicKey ) ) throw new CertPathValidatorException ( "Input key is not " + "appropriate type for " + "inheriting...
Internal method to create a new key with inherited key parameters .
27,036
XPath getCountMatchPattern ( XPathContext support , int contextNode ) throws javax . xml . transform . TransformerException { XPath countMatchPattern = m_countMatchPattern ; DTM dtm = support . getDTM ( contextNode ) ; if ( null == countMatchPattern ) { switch ( dtm . getNodeType ( contextNode ) ) { case DTM . ELEMENT_...
Get the count match pattern or a default value .
27,037
public int getPreviousNode ( XPathContext xctxt , int pos ) throws TransformerException { XPath countMatchPattern = getCountMatchPattern ( xctxt , pos ) ; DTM dtm = xctxt . getDTM ( pos ) ; if ( Constants . NUMBERLEVEL_ANY == m_level ) { XPath fromMatchPattern = m_fromMatchPattern ; while ( DTM . NULL != pos ) { int ne...
Get the previous node to be counted .
27,038
public int getTargetNode ( XPathContext xctxt , int sourceNode ) throws TransformerException { int target = DTM . NULL ; XPath countMatchPattern = getCountMatchPattern ( xctxt , sourceNode ) ; if ( Constants . NUMBERLEVEL_ANY == m_level ) { target = findPrecedingOrAncestorOrSelf ( xctxt , m_fromMatchPattern , countMatc...
Get the target node that will be counted ..
27,039
NodeVector getMatchingAncestors ( XPathContext xctxt , int node , boolean stopAtFirstFound ) throws javax . xml . transform . TransformerException { NodeSetDTM ancestors = new NodeSetDTM ( xctxt . getDTMManager ( ) ) ; XPath countMatchPattern = getCountMatchPattern ( xctxt , node ) ; DTM dtm = xctxt . getDTM ( node ) ;...
Get the ancestors up to the root that match the pattern .
27,040
Locale getLocale ( TransformerImpl transformer , int contextNode ) throws TransformerException { Locale locale = null ; if ( null != m_lang_avt ) { XPathContext xctxt = transformer . getXPathContext ( ) ; String langValue = m_lang_avt . evaluate ( xctxt , contextNode , this ) ; if ( null != langValue ) { locale = new L...
Get the locale we should be using .
27,041
private DecimalFormat getNumberFormatter ( TransformerImpl transformer , int contextNode ) throws TransformerException { Locale locale = ( Locale ) getLocale ( transformer , contextNode ) . clone ( ) ; DecimalFormat formatter = null ; String digitGroupSepValue = ( null != m_groupingSeparator_avt ) ? m_groupingSeparator...
Get the number formatter to be used the format the numbers
27,042
String formatNumberList ( TransformerImpl transformer , long [ ] list , int contextNode ) throws TransformerException { String numStr ; FastStringBuffer formattedNumber = StringBufferPool . get ( ) ; try { int nNumbers = list . length , numberWidth = 1 ; char numberType = '1' ; String formatToken , lastSepString = null...
Format a vector of numbers into a formatted string .
27,043
protected String int2singlealphaCount ( long val , CharArrayWrapper table ) { int radix = table . getLength ( ) ; if ( val > radix ) { return getZeroString ( ) ; } else return ( new Character ( table . getChar ( ( int ) val - 1 ) ) ) . toString ( ) ; }
Convert a long integer into alphabetic counting in other words count using the sequence A B C ... Z .
27,044
protected String long2roman ( long val , boolean prefixesAreOK ) { if ( val <= 0 ) { return getZeroString ( ) ; } String roman = "" ; int place = 0 ; if ( val <= 3999L ) { do { while ( val >= m_romanConvertTable [ place ] . m_postValue ) { roman += m_romanConvertTable [ place ] . m_postLetter ; val -= m_romanConvertTab...
Convert a long integer into roman numerals .
27,045
private void encodeThis ( ) throws IOException { if ( id == null && names == null && serialNum == null ) { this . extensionValue = null ; return ; } DerOutputStream seq = new DerOutputStream ( ) ; DerOutputStream tmp = new DerOutputStream ( ) ; if ( id != null ) { DerOutputStream tmp1 = new DerOutputStream ( ) ; id . e...
Encode only the extension value
27,046
public byte [ ] getEncodedKeyIdentifier ( ) throws IOException { if ( id != null ) { DerOutputStream derOut = new DerOutputStream ( ) ; id . encode ( derOut ) ; return derOut . toByteArray ( ) ; } return null ; }
Return the encoded key identifier or null if not specified .
27,047
public int getFCD16 ( int c ) { if ( c < 0 ) { return 0 ; } else if ( c < 0x180 ) { return tccc180 [ c ] ; } else if ( c <= 0xffff ) { if ( ! singleLeadMightHaveNonZeroFCD16 ( c ) ) { return 0 ; } } return getFCD16FromNormData ( c ) ; }
Returns the FCD data for code point c .
27,048
public int getFCD16FromNormData ( int c ) { for ( ; ; ) { int norm16 = getNorm16 ( c ) ; if ( norm16 <= minYesNo ) { return 0 ; } else if ( norm16 >= MIN_NORMAL_MAYBE_YES ) { norm16 &= 0xff ; return norm16 | ( norm16 << 8 ) ; } else if ( norm16 >= minMaybeYes ) { return 0 ; } else if ( isDecompNoAlgorithmic ( norm16 ) ...
Gets the FCD value from the regular normalization data .
27,049
public String getDecomposition ( int c ) { int decomp = - 1 ; int norm16 ; for ( ; ; ) { if ( c < minDecompNoCP || isDecompYes ( norm16 = getNorm16 ( c ) ) ) { } else if ( isHangul ( norm16 ) ) { StringBuilder buffer = new StringBuilder ( ) ; Hangul . decompose ( c , buffer ) ; return buffer . toString ( ) ; } else if ...
Gets the decomposition for one code point .
27,050
public String getRawDecomposition ( int c ) { int norm16 ; if ( c < minDecompNoCP || isDecompYes ( norm16 = getNorm16 ( c ) ) ) { return null ; } else if ( isHangul ( norm16 ) ) { StringBuilder buffer = new StringBuilder ( ) ; Hangul . getRawDecomposition ( c , buffer ) ; return buffer . toString ( ) ; } else if ( isDe...
Gets the raw decomposition for one code point .
27,051
public Appendable decompose ( CharSequence s , StringBuilder dest ) { decompose ( s , 0 , s . length ( ) , dest , s . length ( ) ) ; return dest ; }
NFD without an NFD Normalizer2 instance .
27,052
public void decompose ( CharSequence s , int src , int limit , StringBuilder dest , int destLengthEstimate ) { if ( destLengthEstimate < 0 ) { destLengthEstimate = limit - src ; } dest . setLength ( 0 ) ; ReorderingBuffer buffer = new ReorderingBuffer ( this , dest , destLengthEstimate ) ; decompose ( s , src , limit ,...
Decomposes s [ src limit [ and writes the result to dest . limit can be NULL if src is NUL - terminated . destLengthEstimate is the initial dest buffer capacity and can be - 1 .
27,053
public boolean hasDecompBoundary ( int c , boolean before ) { for ( ; ; ) { if ( c < minDecompNoCP ) { return true ; } int norm16 = getNorm16 ( c ) ; if ( isHangul ( norm16 ) || isDecompYesAndZeroCC ( norm16 ) ) { return true ; } else if ( norm16 > MIN_NORMAL_MAYBE_YES ) { return false ; } else if ( isDecompNoAlgorithm...
at the cost of building the FCD trie for a decomposition normalizer .
27,054
public void decomposeShort ( CharSequence s , int src , int limit , ReorderingBuffer buffer ) { while ( src < limit ) { int c = Character . codePointAt ( s , src ) ; src += Character . charCount ( c ) ; decompose ( c , getNorm16 ( c ) , buffer ) ; } }
Public in Java for collation implementation code .
27,055
private static int combine ( String compositions , int list , int trail ) { int key1 , firstUnit ; if ( trail < COMP_1_TRAIL_LIMIT ) { key1 = ( trail << 1 ) ; while ( key1 > ( firstUnit = compositions . charAt ( list ) ) ) { list += 2 + ( firstUnit & COMP_1_TRIPLE ) ; } if ( key1 == ( firstUnit & COMP_1_TRAIL_MASK ) ) ...
Finds the recomposition result for a forward - combining lead character specified with a pointer to its compositions list and a backward - combining trail character .
27,056
private boolean isGroupingPosition ( int pos ) { boolean result = false ; if ( isGroupingUsed ( ) && ( pos > 0 ) && ( groupingSize > 0 ) ) { if ( ( groupingSize2 > 0 ) && ( pos > groupingSize ) ) { result = ( ( pos - groupingSize ) % groupingSize2 ) == 0 ; } else { result = pos % groupingSize == 0 ; } } return result ;...
Returns true if a grouping separator belongs at the given position based on whether grouping is in use and the values of the primary and secondary grouping interval .
27,057
private UnicodeSet getEquivalentDecimals ( String decimal , boolean strictParse ) { UnicodeSet equivSet = UnicodeSet . EMPTY ; if ( strictParse ) { if ( strictDotEquivalents . contains ( decimal ) ) { equivSet = strictDotEquivalents ; } else if ( strictCommaEquivalents . contains ( decimal ) ) { equivSet = strictCommaE...
Returns a set of characters equivalent to the given desimal separator used for parsing number . This method may return an empty set .
27,058
private final int skipPadding ( String text , int position ) { while ( position < text . length ( ) && text . charAt ( position ) == pad ) { ++ position ; } return position ; }
Starting at position advance past a run of pad characters if any . Return the index of the first character after position that is not a pad character . Result is > = position .
27,059
private int compareAffix ( String text , int pos , boolean isNegative , boolean isPrefix , String affixPat , boolean complexCurrencyParsing , int type , Currency [ ] currency ) { if ( currency != null || currencyChoice != null || ( currencySignCount != CURRENCY_SIGN_COUNT_ZERO && complexCurrencyParsing ) ) { return com...
Returns the length matched by the given affix or - 1 if none . Runs of white space in the affix match runs of white space in the input . Pattern white space and input white space are determined differently ; see code .
27,060
private static String trimMarksFromAffix ( String affix ) { boolean hasBidiMark = false ; int idx = 0 ; for ( ; idx < affix . length ( ) ; idx ++ ) { if ( isBidiMark ( affix . charAt ( idx ) ) ) { hasBidiMark = true ; break ; } } if ( ! hasBidiMark ) { return affix ; } StringBuilder buf = new StringBuilder ( ) ; buf . ...
Remove bidi marks from affix
27,061
private static int compareSimpleAffix ( String affix , String input , int pos ) { int start = pos ; String trimmedAffix = ( affix . length ( ) > 1 ) ? trimMarksFromAffix ( affix ) : affix ; for ( int i = 0 ; i < trimmedAffix . length ( ) ; ) { int c = UTF16 . charAt ( trimmedAffix , i ) ; int len = UTF16 . getCharCount...
Return the length matched by the given affix or - 1 if none . Runs of white space in the affix match runs of white space in the input . Pattern white space and input white space are determined differently ; see code .
27,062
private static int skipPatternWhiteSpace ( String text , int pos ) { while ( pos < text . length ( ) ) { int c = UTF16 . charAt ( text , pos ) ; if ( ! PatternProps . isWhiteSpace ( c ) ) { break ; } pos += UTF16 . getCharCount ( c ) ; } return pos ; }
Skips over a run of zero or more Pattern_White_Space characters at pos in text .
27,063
private static int skipBidiMarks ( String text , int pos ) { while ( pos < text . length ( ) ) { int c = UTF16 . charAt ( text , pos ) ; if ( ! isBidiMark ( c ) ) { break ; } pos += UTF16 . getCharCount ( c ) ; } return pos ; }
Skips over a run of zero or more bidi marks at pos in text .
27,064
public void setDecimalFormatSymbols ( DecimalFormatSymbols newSymbols ) { symbols = ( DecimalFormatSymbols ) newSymbols . clone ( ) ; setCurrencyForSymbols ( ) ; expandAffixes ( null ) ; }
Sets the decimal format symbols used by this format . The format uses a copy of the provided symbols .
27,065
private void setCurrencyForSymbols ( ) { DecimalFormatSymbols def = new DecimalFormatSymbols ( symbols . getULocale ( ) ) ; if ( symbols . getCurrencySymbol ( ) . equals ( def . getCurrencySymbol ( ) ) && symbols . getInternationalCurrencySymbol ( ) . equals ( def . getInternationalCurrencySymbol ( ) ) ) { setCurrency ...
Update the currency object to match the symbols . This method is used only when the caller has passed in a symbols object that may not be the default object for its locale .
27,066
public void setRoundingMode ( int roundingMode ) { if ( roundingMode < BigDecimal . ROUND_UP || roundingMode > BigDecimal . ROUND_UNNECESSARY ) { throw new IllegalArgumentException ( "Invalid rounding mode: " + roundingMode ) ; } this . roundingMode = roundingMode ; resetActualRounding ( ) ; }
Sets the rounding mode . This has no effect unless the rounding increment is greater than zero .
27,067
private void formatAffix2Attribute ( boolean isPrefix , Field fieldType , StringBuffer buf , int offset , int symbolSize ) { int begin ; begin = offset ; if ( ! isPrefix ) { begin += buf . length ( ) ; } addAttribute ( fieldType , begin , begin + symbolSize ) ; }
Fix for prefix and suffix in Ticket 11805 .
27,068
private void appendEvaluated ( StringBuffer buffer , String s ) { boolean escape = false ; boolean dollar = false ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; if ( c == '\\' && ! escape ) { escape = true ; } else if ( c == '$' && ! escape ) { dollar = true ; } else if ( c >= '0' && c <=...
Internal helper method to append a given string to a given string buffer . If the string contains any references to groups these are replaced by the corresponding group s contents .
27,069
public String replaceAll ( String replacement ) { reset ( ) ; StringBuffer buffer = new StringBuffer ( input . length ( ) ) ; while ( find ( ) ) { appendReplacement ( buffer , replacement ) ; } return appendTail ( buffer ) . toString ( ) ; }
Replaces every subsequence of the input sequence that matches the pattern with the given replacement string .
27,070
public int compareTo ( ByteArrayWrapper other ) { if ( this == other ) return 0 ; int minSize = size < other . size ? size : other . size ; for ( int i = 0 ; i < minSize ; ++ i ) { if ( bytes [ i ] != other . bytes [ i ] ) { return ( bytes [ i ] & 0xFF ) - ( other . bytes [ i ] & 0xFF ) ; } } return size - other . size...
Compare this object to another ByteArrayWrapper which must not be null .
27,071
private static final void copyBytes ( byte [ ] src , int srcoff , byte [ ] tgt , int tgtoff , int length ) { if ( length < 64 ) { for ( int i = srcoff , n = tgtoff ; -- length >= 0 ; ++ i , ++ n ) { tgt [ n ] = src [ i ] ; } } else { System . arraycopy ( src , srcoff , tgt , tgtoff , length ) ; } }
Copies the contents of src byte array from offset srcoff to the target of tgt byte array at the offset tgtoff .
27,072
public static void addAttributes ( SerializationHandler handler , int src ) throws TransformerException { TransformerImpl transformer = ( TransformerImpl ) handler . getTransformer ( ) ; DTM dtm = transformer . getXPathContext ( ) . getDTM ( src ) ; for ( int node = dtm . getFirstAttribute ( src ) ; DTM . NULL != node ...
Copy DOM attributes to the result element .
27,073
public static void outputResultTreeFragment ( SerializationHandler handler , XObject obj , XPathContext support ) throws org . xml . sax . SAXException { int doc = obj . rtf ( ) ; DTM dtm = support . getDTM ( doc ) ; if ( null != dtm ) { for ( int n = dtm . getFirstChild ( doc ) ; DTM . NULL != n ; n = dtm . getNextSib...
Given a result tree fragment walk the tree and output it to the SerializationHandler .
27,074
public static boolean isDefinedNSDecl ( SerializationHandler serializer , int attr , DTM dtm ) { if ( DTM . NAMESPACE_NODE == dtm . getNodeType ( attr ) ) { String prefix = dtm . getNodeNameX ( attr ) ; String uri = serializer . getNamespaceURIFromPrefix ( prefix ) ; if ( ( null != uri ) && uri . equals ( dtm . getStri...
Returns whether a namespace is defined
27,075
public double num ( ) throws javax . xml . transform . TransformerException { error ( XPATHErrorResources . ER_CANT_CONVERT_TO_NUMBER , new Object [ ] { getTypeString ( ) } ) ; return 0.0 ; }
Cast result object to a number . Always issues an error .
27,076
public boolean bool ( ) throws javax . xml . transform . TransformerException { error ( XPATHErrorResources . ER_CANT_CONVERT_TO_NUMBER , new Object [ ] { getTypeString ( ) } ) ; return false ; }
Cast result object to a boolean . Always issues an error .
27,077
public Object castToType ( int t , XPathContext support ) throws javax . xml . transform . TransformerException { Object result ; switch ( t ) { case CLASS_STRING : result = str ( ) ; break ; case CLASS_NUMBER : result = new Double ( num ( ) ) ; break ; case CLASS_NODESET : result = iter ( ) ; break ; case CLASS_BOOLEA...
Cast object to type t .
27,078
private synchronized void readObject ( java . io . ObjectInputStream s ) throws IOException , ClassNotFoundException { s . defaultReadObject ( ) ; if ( ( handler = getDelegate ( ) . getURLStreamHandler ( protocol ) ) == null ) { throw new IOException ( "unknown protocol: " + protocol ) ; } if ( authority == null && ( (...
readObject is called to restore the state of the URL from the stream . It reads the components of the URL and finds the local stream handler .
27,079
public XmlPullParser newPullParser ( ) throws XmlPullParserException { final XmlPullParser pp = getParserInstance ( ) ; for ( Map . Entry < String , Boolean > entry : features . entrySet ( ) ) { if ( entry . getValue ( ) ) { pp . setFeature ( entry . getKey ( ) , entry . getValue ( ) ) ; } } return pp ; }
Creates a new instance of a XML Pull Parser using the currently configured factory features .
27,080
public static String quoteNameIfNecessary ( String name ) { int len = name . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = name . charAt ( i ) ; if ( ! ( ( c >= 'A' && c <= 'Z' ) || ( c >= 'a' && c <= 'z' ) || ( c == ' ' ) || ( c >= '0' && c <= '9' ) ) ) { return '"' + quoteName ( name ) + '"' ; } } return...
Returns the name conservatively quoting it if there are any characters that are likely to cause trouble outside of a quoted string or returning it literally if it seems safe .
27,081
public static String quoteName ( String name ) { StringBuilder sb = new StringBuilder ( ) ; int len = name . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = name . charAt ( i ) ; if ( c == '\\' || c == '"' ) { sb . append ( '\\' ) ; } sb . append ( c ) ; } return sb . toString ( ) ; }
Returns the name with internal backslashes and quotation marks preceded by backslashes . The outer quote marks themselves are not added by this method .
27,082
public static String quoteComment ( String comment ) { int len = comment . length ( ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = comment . charAt ( i ) ; if ( c == '(' || c == ')' || c == '\\' ) { sb . append ( '\\' ) ; } sb . append ( c ) ; } return sb . toString ( ) ; }
Returns the comment with internal backslashes and parentheses preceded by backslashes . The outer parentheses themselves are not added by this method .
27,083
DateTimeParseContext copy ( ) { DateTimeParseContext newContext = new DateTimeParseContext ( formatter ) ; newContext . caseSensitive = caseSensitive ; newContext . strict = strict ; return newContext ; }
Creates a copy of this context . This retains the case sensitive and strict flags .
27,084
static boolean charEqualsIgnoreCase ( char c1 , char c2 ) { return c1 == c2 || Character . toUpperCase ( c1 ) == Character . toUpperCase ( c2 ) || Character . toLowerCase ( c1 ) == Character . toLowerCase ( c2 ) ; }
Compares two characters ignoring case .
27,085
void endOptional ( boolean successful ) { if ( successful ) { parsed . remove ( parsed . size ( ) - 2 ) ; } else { parsed . remove ( parsed . size ( ) - 1 ) ; } }
Ends the parsing of an optional segment of the input .
27,086
TemporalAccessor toResolved ( ResolverStyle resolverStyle , Set < TemporalField > resolverFields ) { Parsed parsed = currentParsed ( ) ; parsed . chrono = getEffectiveChronology ( ) ; parsed . zone = ( parsed . zone != null ? parsed . zone : formatter . getZone ( ) ) ; return parsed . resolve ( resolverStyle , resolver...
Gets the resolved result of the parse .
27,087
public void removeAtRange ( int index , int size ) { final int end = Math . min ( mSize , index + size ) ; for ( int i = index ; i < end ; i ++ ) { removeAt ( i ) ; } }
Remove a range of mappings as a batch .
27,088
public void clear ( ) { int n = mSize ; Object [ ] values = mValues ; for ( int i = 0 ; i < n ; i ++ ) { values [ i ] = null ; } mSize = 0 ; mGarbage = false ; }
Removes all key - value mappings from this SparseArray .
27,089
long lastCEWithPrimaryBefore ( long p ) { if ( p == 0 ) { return 0 ; } assert ( p > elements [ ( int ) elements [ IX_FIRST_PRIMARY_INDEX ] ] ) ; int index = findP ( p ) ; long q = elements [ index ] ; long secTer ; if ( p == ( q & 0xffffff00L ) ) { assert ( ( q & PRIMARY_STEP_MASK ) == 0 ) ; secTer = elements [ index -...
Returns the last root CE with a primary weight before p . Intended only for reordering group boundaries .
27,090
long firstCEWithPrimaryAtLeast ( long p ) { if ( p == 0 ) { return 0 ; } int index = findP ( p ) ; if ( p != ( elements [ index ] & 0xffffff00L ) ) { for ( ; ; ) { p = elements [ ++ index ] ; if ( ( p & SEC_TER_DELTA_FLAG ) == 0 ) { assert ( ( p & PRIMARY_STEP_MASK ) == 0 ) ; break ; } } } return ( p << 32 ) | Collatio...
Returns the first root CE with a primary weight of at least p . Intended only for reordering group boundaries .
27,091
long getPrimaryBefore ( long p , boolean isCompressible ) { int index = findPrimary ( p ) ; int step ; long q = elements [ index ] ; if ( p == ( q & 0xffffff00L ) ) { step = ( int ) q & PRIMARY_STEP_MASK ; if ( step == 0 ) { do { p = elements [ -- index ] ; } while ( ( p & SEC_TER_DELTA_FLAG ) != 0 ) ; return p & 0xfff...
Returns the primary weight before p . p must be greater than the first root primary .
27,092
int findPrimary ( long p ) { assert ( ( p & 0xff ) == 0 ) ; int index = findP ( p ) ; assert ( isEndOfPrimaryRange ( elements [ index + 1 ] ) || p == ( elements [ index ] & 0xffffff00L ) ) ; return index ; }
Finds the index of the input primary . p must occur as a root primary and must not be 0 .
27,093
public static String createGmtOffsetString ( boolean includeGmt , boolean includeMinuteSeparator , int offsetMillis ) { int offsetMinutes = offsetMillis / 60000 ; char sign = '+' ; if ( offsetMinutes < 0 ) { sign = '-' ; offsetMinutes = - offsetMinutes ; } StringBuilder builder = new StringBuilder ( 9 ) ; if ( includeG...
Returns a string representation of an offset from UTC .
27,094
public static String [ ] getAvailableIDs ( int rawOffset ) { List < String > ids = new ArrayList < > ( ) ; for ( String id : getAvailableIDs ( ) ) { TimeZone tz = NativeTimeZone . get ( id ) ; if ( tz . getRawOffset ( ) == rawOffset ) { ids . add ( id ) ; } } return ids . toArray ( new String [ 0 ] ) ; }
Gets the available IDs according to the given time zone offset in milliseconds .
27,095
static synchronized TimeZone getDefaultRef ( ) { if ( defaultTimeZone == null ) { defaultTimeZone = NativeTimeZone . getDefaultNativeTimeZone ( ) ; } if ( defaultTimeZone == null ) { defaultTimeZone = GMTHolder . INSTANCE ; } return defaultTimeZone ; }
Returns the reference to the default TimeZone object . This method doesn t create a clone .
27,096
public void execute ( TransformerImpl transformer ) throws TransformerException { XPathContext xctxt = transformer . getXPathContext ( ) ; int sourceNode = xctxt . getCurrentNode ( ) ; if ( m_test . bool ( xctxt , sourceNode , this ) ) { transformer . executeChildTemplates ( this , true ) ; } }
Conditionally execute a sub - template . The expression is evaluated and the resulting object is converted to a boolean as if by a call to the boolean function . If the result is true then the content template is instantiated ; otherwise nothing is created .
27,097
private int findOrInsertNodeForCEs ( int strength ) { assert ( Collator . PRIMARY <= strength && strength <= Collator . QUATERNARY ) ; long ce ; for ( ; ; -- cesLength ) { if ( cesLength == 0 ) { ce = ces [ 0 ] = 0 ; cesLength = 1 ; break ; } else { ce = ces [ cesLength - 1 ] ; } if ( ceStrength ( ce ) <= strength ) { ...
Picks one of the current CEs and finds or inserts a node in the graph for the CE + strength .
27,098
private int findOrInsertNodeForPrimary ( long p ) { int rootIndex = binarySearchForRootPrimaryNode ( rootPrimaryIndexes . getBuffer ( ) , rootPrimaryIndexes . size ( ) , nodes . getBuffer ( ) , p ) ; if ( rootIndex >= 0 ) { return rootPrimaryIndexes . elementAti ( rootIndex ) ; } else { int index = nodes . size ( ) ; n...
Finds or inserts the node for a root CE s primary weight .
27,099
private int findOrInsertWeakNode ( int index , int weight16 , int level ) { assert ( 0 <= index && index < nodes . size ( ) ) ; assert ( Collator . SECONDARY <= level && level <= Collator . TERTIARY ) ; if ( weight16 == Collation . COMMON_WEIGHT16 ) { return findCommonNode ( index , level ) ; } long node = nodes . elem...
Finds or inserts the node for a secondary or tertiary weight .