idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
26,600
public void allowDetachToRelease ( boolean allowRelease ) { if ( ( false == allowRelease ) && ! hasCache ( ) ) { setShouldCacheNodes ( true ) ; } if ( null != m_iter ) m_iter . allowDetachToRelease ( allowRelease ) ; super . allowDetachToRelease ( allowRelease ) ; }
Calling this with a value of false will cause the nodeset to be cached .
26,601
private void resolve ( byte level , int options ) { bidi . setInverse ( ( options & Bidi . REORDER_INVERSE_LIKE_DIRECT ) != 0 ) ; bidi . setReorderingMode ( options ) ; bidi . setPara ( text , level , null ) ; }
Performs bidi resolution of text .
26,602
public void encode ( OutputStream out ) throws IOException { DerOutputStream tmp = new DerOutputStream ( ) ; algId . encode ( tmp ) ; out . write ( tmp . toByteArray ( ) ) ; }
Encode the algorithm identifier in DER form to the stream .
26,603
public static LocaleData get ( Locale locale ) { if ( locale == null ) { throw new NullPointerException ( "locale == null" ) ; } final String languageTag = locale . toLanguageTag ( ) ; synchronized ( localeDataCache ) { LocaleData localeData = localeDataCache . get ( languageTag ) ; if ( localeData != null ) { return l...
Returns a shared LocaleData for the given locale .
26,604
public boolean offer ( E e ) { if ( e == null ) throw new NullPointerException ( ) ; modCount ++ ; int i = size ; if ( i >= queue . length ) grow ( i + 1 ) ; size = i + 1 ; if ( i == 0 ) queue [ 0 ] = e ; else siftUp ( i , e ) ; return true ; }
Inserts the specified element into this priority queue .
26,605
boolean removeEq ( Object o ) { for ( int i = 0 ; i < size ; i ++ ) { if ( o == queue [ i ] ) { removeAt ( i ) ; return true ; } } return false ; }
Version of remove using reference equality not equals . Needed by iterator . remove .
26,606
public final static String getDefaultAlgorithm ( ) { String type ; type = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { public String run ( ) { return Security . getProperty ( "ssl.KeyManagerFactory.algorithm" ) ; } } ) ; if ( type == null ) { type = "SunX509" ; } return type ; }
Obtains the default KeyManagerFactory algorithm name .
26,607
void buildFieldDescriptors ( Field [ ] declaredFields ) { final Field f = ObjectStreamClass . fieldSerialPersistentFields ( this . forClass ( ) ) ; boolean useReflectFields = f == null ; ObjectStreamField [ ] _fields = null ; if ( ! useReflectFields ) { f . setAccessible ( true ) ; try { _fields = ( ObjectStreamField [...
Builds the collection of field descriptors for the receiver
26,608
private boolean inSamePackage ( Class < ? > c1 , Class < ? > c2 ) { String nameC1 = c1 . getName ( ) ; String nameC2 = c2 . getName ( ) ; int indexDotC1 = nameC1 . lastIndexOf ( '.' ) ; int indexDotC2 = nameC2 . lastIndexOf ( '.' ) ; if ( indexDotC1 != indexDotC2 ) { return false ; } if ( indexDotC1 == - 1 ) { return t...
Checks if two classes belong to the same package .
26,609
public ObjectStreamField getField ( String name ) { ObjectStreamField [ ] allFields = getFields ( ) ; for ( int i = 0 ; i < allFields . length ; i ++ ) { ObjectStreamField f = allFields [ i ] ; if ( f . getName ( ) . equals ( name ) ) { return f ; } } return null ; }
Gets a field descriptor of the class represented by this class descriptor .
26,610
ObjectStreamField [ ] fields ( ) { if ( fields == null ) { Class < ? > forCl = forClass ( ) ; if ( forCl != null && isSerializable ( ) && ! forCl . isArray ( ) ) { buildFieldDescriptors ( forCl . getDeclaredFields ( ) ) ; } else { setFields ( NO_FIELDS ) ; } } return fields ; }
Returns the collection of field descriptors for the fields of the corresponding class
26,611
private void copyFieldAttributes ( ) { if ( ( loadFields == null ) || fields == null ) { return ; } for ( int i = 0 ; i < loadFields . length ; i ++ ) { ObjectStreamField loadField = loadFields [ i ] ; String name = loadField . getName ( ) ; for ( int j = 0 ; j < fields . length ; j ++ ) { ObjectStreamField field = fie...
If a Class uses serialPersistentFields to define the serialized fields this . loadFields cannot get the unshared information when deserializing fields using current implementation of ObjectInputStream . This method provides a way to copy the unshared attribute from this . fields .
26,612
private void resolveProperties ( ) { if ( arePropertiesResolved ) { return ; } Class < ? > cl = forClass ( ) ; isProxy = Proxy . isProxyClass ( cl ) ; isEnum = Enum . class . isAssignableFrom ( cl ) ; isSerializable = isSerializable ( cl ) ; isExternalizable = isExternalizable ( cl ) ; arePropertiesResolved = true ; }
Resolves the class properties if they weren t already
26,613
public final Certificate getCertificate ( String alias ) throws KeyStoreException { if ( ! initialized ) { throw new KeyStoreException ( "Uninitialized keystore" ) ; } return keyStoreSpi . engineGetCertificate ( alias ) ; }
Returns the certificate associated with the given alias .
26,614
public final Date getCreationDate ( String alias ) throws KeyStoreException { if ( ! initialized ) { throw new KeyStoreException ( "Uninitialized keystore" ) ; } return keyStoreSpi . engineGetCreationDate ( alias ) ; }
Returns the creation date of the entry identified by the given alias .
26,615
public final void setKeyEntry ( String alias , Key key , char [ ] password , Certificate [ ] chain ) throws KeyStoreException { if ( ! initialized ) { throw new KeyStoreException ( "Uninitialized keystore" ) ; } if ( ( key instanceof PrivateKey ) && ( chain == null || chain . length == 0 ) ) { throw new IllegalArgument...
Assigns the given key to the given alias protecting it with the given password .
26,616
public final void setCertificateEntry ( String alias , Certificate cert ) throws KeyStoreException { if ( ! initialized ) { throw new KeyStoreException ( "Uninitialized keystore" ) ; } keyStoreSpi . engineSetCertificateEntry ( alias , cert ) ; }
Assigns the given trusted certificate to the given alias .
26,617
public final void store ( OutputStream stream , char [ ] password ) throws KeyStoreException , IOException , NoSuchAlgorithmException , CertificateException { if ( ! initialized ) { throw new KeyStoreException ( "Uninitialized keystore" ) ; } keyStoreSpi . engineStore ( stream , password ) ; }
Stores this keystore to the given output stream and protects its integrity with the given password .
26,618
public final void load ( InputStream stream , char [ ] password ) throws IOException , NoSuchAlgorithmException , CertificateException { keyStoreSpi . engineLoad ( stream , password ) ; initialized = true ; }
Loads this KeyStore from the given input stream .
26,619
private E xfer ( E e , boolean haveData , int how , long nanos ) { if ( haveData && ( e == null ) ) throw new NullPointerException ( ) ; Node s = null ; retry : for ( ; ; ) { for ( Node h = head , p = h ; p != null ; ) { boolean isData = p . isData ; Object item = p . item ; if ( item != FORGOTTEN && ( item != null ) =...
Implements all queuing methods . See above for explanation .
26,620
private Node tryAppend ( Node s , boolean haveData ) { for ( Node t = tail , p = t ; ; ) { Node n , u ; if ( p == null && ( p = head ) == null ) { if ( casHead ( null , s ) ) return s ; } else if ( p . cannotPrecede ( haveData ) ) return null ; else if ( ( n = p . next ) != null ) p = p != t && t != ( u = tail ) ? ( t ...
Tries to append node s as tail .
26,621
final Node firstDataNode ( ) { restartFromHead : for ( ; ; ) { for ( Node p = head ; p != null ; ) { Object item = p . item ; if ( p . isData ) { if ( item != null && item != FORGOTTEN ) return p ; } else if ( item == null ) break ; if ( UNLINKED == ( p = p . next ) ) continue restartFromHead ; } return null ; } }
Returns the first unmatched data node or null if none . Callers must recheck if the returned node s item field is null or self - linked before using .
26,622
public void dump ( java . io . PrintStream out ) { if ( out == null ) { out = System . out ; } this . fRData . dump ( out ) ; }
Dump the contents of the state table and character classes for this break iterator . For debugging only .
26,623
public static void compileRules ( String rules , OutputStream ruleBinary ) throws IOException { RBBIRuleBuilder . compileRules ( rules , ruleBinary ) ; }
Compile a set of source break rules into the binary state tables used by the break iterator engine . Creating a break iterator from precompiled rules is much faster than creating one from source rules .
26,624
public int next ( ) { if ( fCachedBreakPositions != null ) { if ( fPositionInCache < fCachedBreakPositions . length - 1 ) { ++ fPositionInCache ; int pos = fCachedBreakPositions [ fPositionInCache ] ; fText . setIndex ( pos ) ; return pos ; } else { reset ( ) ; } } int startPos = current ( ) ; fDictionaryCharCount = 0 ...
Advances the iterator to the next boundary position .
26,625
public int previous ( ) { int result ; int startPos ; CharacterIterator text = getText ( ) ; fLastStatusIndexValid = false ; if ( fCachedBreakPositions != null ) { if ( fPositionInCache > 0 ) { -- fPositionInCache ; if ( fPositionInCache <= 0 ) { fLastStatusIndexValid = false ; } int pos = fCachedBreakPositions [ fPosi...
Moves the iterator backwards to the last boundary preceding this one .
26,626
public int following ( int offset ) { CharacterIterator text = getText ( ) ; if ( fCachedBreakPositions == null || offset < fCachedBreakPositions [ 0 ] || offset >= fCachedBreakPositions [ fCachedBreakPositions . length - 1 ] ) { fCachedBreakPositions = null ; return rulesFollowing ( offset ) ; } else { fPositionInCach...
Sets the iterator to refer to the first boundary position following the specified position .
26,627
public int preceding ( int offset ) { CharacterIterator text = getText ( ) ; if ( fCachedBreakPositions == null || offset <= fCachedBreakPositions [ 0 ] || offset > fCachedBreakPositions [ fCachedBreakPositions . length - 1 ] ) { fCachedBreakPositions = null ; return rulesPreceding ( offset ) ; } else { fPositionInCach...
Sets the iterator to refer to the last boundary position before the specified position .
26,628
protected static final void checkOffset ( int offset , CharacterIterator text ) { if ( offset < text . getBeginIndex ( ) || offset > text . getEndIndex ( ) ) { throw new IllegalArgumentException ( "offset out of bounds" ) ; } }
Throw IllegalArgumentException unless begin &lt ; = offset &lt ; end .
26,629
public boolean isBoundary ( int offset ) { checkOffset ( offset , fText ) ; if ( offset == fText . getBeginIndex ( ) ) { first ( ) ; return true ; } if ( offset == fText . getEndIndex ( ) ) { last ( ) ; return true ; } fText . setIndex ( offset ) ; previous32 ( fText ) ; int pos = fText . getIndex ( ) ; boolean result ...
Returns true if the specified position is a boundary position . As a side effect leaves the iterator pointing to the first boundary position at or after offset .
26,630
public Void visitCompilationUnit ( CompilationUnitTree unit , Void unused ) { scan ( unit . getImports ( ) , null ) ; scan ( unit . getPackageAnnotations ( ) , null ) ; scan ( unit . getTypeDecls ( ) , null ) ; return null ; }
TreeScanner methods .
26,631
private boolean checkAnnotations ( List < ? extends AnnotationTree > annotations , Tree node ) { for ( AnnotationTree annotation : annotations ) { if ( isJ2ObjCIncompatible ( annotation ) ) { nodesToStrip . add ( node ) ; return false ; } } return true ; }
Checks for any J2ObjCIncompatible annotations . Returns whether the caller should to continue scanning this node .
26,632
public final String getDisplayName ( String tzID , NameType type , long date ) { String name = getTimeZoneDisplayName ( tzID , type ) ; if ( name == null ) { String mzID = getMetaZoneID ( tzID , date ) ; name = getMetaZoneDisplayName ( mzID , type ) ; } return name ; }
Returns the display name of the time zone at the given date .
26,633
public Collection < MatchInfo > find ( CharSequence text , int start , EnumSet < NameType > types ) { throw new UnsupportedOperationException ( "The method is not implemented in TimeZoneNames base class." ) ; }
Finds time zone name prefix matches for the input text at the given offset and returns a collection of the matches .
26,634
static Object newInstance ( String className , ClassLoader cl , boolean doFallback ) throws ConfigurationError { try { Class providerClass = findProviderClass ( className , cl , doFallback ) ; Object instance = providerClass . newInstance ( ) ; debugPrintln ( "created new instance of " + providerClass + " using ClassLo...
Create an instance of a class using the specified ClassLoader
26,635
static Class findProviderClass ( String className , ClassLoader cl , boolean doFallback ) throws ClassNotFoundException , ConfigurationError { SecurityManager security = System . getSecurityManager ( ) ; try { if ( security != null ) { final int lastDot = className . lastIndexOf ( "." ) ; String packageName = className...
Find a Class using the specified ClassLoader
26,636
private static String findJarServiceProviderName ( String factoryId ) { SecuritySupport ss = SecuritySupport . getInstance ( ) ; String serviceId = SERVICES_PATH + factoryId ; InputStream is = null ; ClassLoader cl = findClassLoader ( ) ; is = ss . getResourceAsStream ( cl , serviceId ) ; if ( is == null ) { ClassLoade...
Find the name of service provider using Jar Service Provider Mechanism
26,637
private static String toHexString ( byte [ ] bytes ) { if ( bytes . length == 0 ) { return "(empty)" ; } StringBuilder sb = new StringBuilder ( bytes . length * 3 - 1 ) ; boolean isInitial = true ; for ( byte b : bytes ) { if ( isInitial ) { isInitial = false ; } else { sb . append ( ':' ) ; } int k = b & 0xFF ; sb . a...
convert byte array to hex string
26,638
public void setStartYear ( int year ) { if ( isFrozen ( ) ) { throw new UnsupportedOperationException ( "Attempt to modify a frozen SimpleTimeZone instance." ) ; } getSTZInfo ( ) . sy = year ; this . startYear = year ; transitionRulesInitialized = false ; }
Sets the daylight savings starting year .
26,639
public void setStartRule ( int month , int dayOfMonth , int time ) { if ( isFrozen ( ) ) { throw new UnsupportedOperationException ( "Attempt to modify a frozen SimpleTimeZone instance." ) ; } getSTZInfo ( ) . setStart ( month , - 1 , - 1 , time , dayOfMonth , false ) ; setStartRule ( month , dayOfMonth , 0 , time , WA...
Sets the DST start rule to a fixed date within a month .
26,640
public void setEndRule ( int month , int dayOfMonth , int time ) { if ( isFrozen ( ) ) { throw new UnsupportedOperationException ( "Attempt to modify a frozen SimpleTimeZone instance." ) ; } getSTZInfo ( ) . setEnd ( month , - 1 , - 1 , time , dayOfMonth , false ) ; setEndRule ( month , dayOfMonth , WALL_TIME , time ) ...
Sets the DST end rule to a fixed date within a month .
26,641
public void setDSTSavings ( int millisSavedDuringDST ) { if ( isFrozen ( ) ) { throw new UnsupportedOperationException ( "Attempt to modify a frozen SimpleTimeZone instance." ) ; } if ( millisSavedDuringDST <= 0 ) { throw new IllegalArgumentException ( ) ; } dst = millisSavedDuringDST ; transitionRulesInitialized = fal...
Sets the amount of time in ms that the clock is advanced during DST .
26,642
private void readObject ( java . io . ObjectInputStream in ) throws IOException , ClassNotFoundException { in . defaultReadObject ( ) ; if ( xinfo != null ) { xinfo . applyTo ( this ) ; } }
on JDK 1 . 4 and later can t deserialize a SimpleTimeZone as a SimpleTimeZone ...
26,643
private int compareToRule ( int month , int monthLen , int prevMonthLen , int dayOfMonth , int dayOfWeek , int millis , int millisDelta , int ruleMode , int ruleMonth , int ruleDayOfWeek , int ruleDay , int ruleMillis ) { millis += millisDelta ; while ( millis >= Grego . MILLIS_PER_DAY ) { millis -= Grego . MILLIS_PER_...
Compare a given date in the year to a rule . Return 1 0 or - 1 depending on whether the date is after equal to or before the rule date . The millis are compared directly against the ruleMillis so any standard - daylight adjustments must be handled by the caller .
26,644
public boolean inDaylightTime ( Date date ) { GregorianCalendar gc = new GregorianCalendar ( this ) ; gc . setTime ( date ) ; return gc . inDaylightTime ( ) ; }
Overrides TimeZone Queries if the give date is in Daylight Saving Time .
26,645
private void construct ( int _raw , int _startMonth , int _startDay , int _startDayOfWeek , int _startTime , int _startTimeMode , int _endMonth , int _endDay , int _endDayOfWeek , int _endTime , int _endTimeMode , int _dst ) { raw = _raw ; startMonth = _startMonth ; startDay = _startDay ; startDayOfWeek = _startDayOfWe...
Internal construction method .
26,646
public boolean hasSameRules ( TimeZone othr ) { if ( this == othr ) { return true ; } if ( ! ( othr instanceof SimpleTimeZone ) ) { return false ; } SimpleTimeZone other = ( SimpleTimeZone ) othr ; return other != null && raw == other . raw && useDaylight == other . useDaylight && ( ! useDaylight || ( dst == other . ds...
Returns true if this zone has the same rules and offset as another zone .
26,647
private static int readFully ( InputStream in , ByteArrayOutputStream bout , int length ) throws IOException { int read = 0 ; byte [ ] buffer = new byte [ 2048 ] ; while ( length > 0 ) { int n = in . read ( buffer , 0 , length < 2048 ? length : 2048 ) ; if ( n <= 0 ) { break ; } bout . write ( buffer , 0 , n ) ; read +...
Read from the stream until length bytes have been read or EOF has been reached . Return the number of bytes actually read .
26,648
public static synchronized X509CertImpl intern ( X509Certificate c ) throws CertificateException { if ( c == null ) { return null ; } boolean isImpl = c instanceof X509CertImpl ; byte [ ] encoding ; if ( isImpl ) { encoding = ( ( X509CertImpl ) c ) . getEncodedInternal ( ) ; } else { encoding = c . getEncoded ( ) ; } X...
Return an interned X509CertImpl for the given certificate . If the given X509Certificate or X509CertImpl is already present in the cert cache the cached object is returned . Otherwise if it is a X509Certificate it is first converted to a X509CertImpl . Then the X509CertImpl is added to the cache and returned .
26,649
private static synchronized Object getFromCache ( Cache cache , byte [ ] encoding ) { Object key = new Cache . EqualByteArray ( encoding ) ; Object value = cache . get ( key ) ; return value ; }
Get the X509CertImpl or X509CRLImpl from the cache .
26,650
private static synchronized void addToCache ( Cache cache , byte [ ] encoding , Object value ) { if ( encoding . length > ENC_MAX_LENGTH ) { return ; } Object key = new Cache . EqualByteArray ( encoding ) ; cache . put ( key , value ) ; }
Add the X509CertImpl or X509CRLImpl to the cache .
26,651
private static byte [ ] readOneBlock ( InputStream is ) throws IOException { int c = is . read ( ) ; if ( c == - 1 ) { return null ; } if ( c == DerValue . tag_Sequence ) { ByteArrayOutputStream bout = new ByteArrayOutputStream ( 2048 ) ; bout . write ( c ) ; readBERInternal ( is , bout , c ) ; return bout . toByteArra...
Returns an ASN . 1 SEQUENCE from a stream which might be a BER - encoded binary block or a PEM - style BASE64 - encoded ASCII data . In the latter case it s de - BASE64 ed before return .
26,652
private Object readResolve ( ) { KnownLevel o = KnownLevel . matches ( this ) ; if ( o != null ) { return o . levelObject ; } Level level = new Level ( this . name , this . value , this . resourceBundleName ) ; return level ; }
This is a performance optimization .
26,653
public void reset ( ) { int i ; fOffsets [ 0 ] = 0x0080 ; fOffsets [ 1 ] = 0x00C0 ; fOffsets [ 2 ] = 0x0400 ; fOffsets [ 3 ] = 0x0600 ; fOffsets [ 4 ] = 0x0900 ; fOffsets [ 5 ] = 0x3040 ; fOffsets [ 6 ] = 0x30A0 ; fOffsets [ 7 ] = 0xFF00 ; for ( i = 0 ; i < NUMWINDOWS ; i ++ ) { fTimeStamps [ i ] = 0 ; } for ( i = 0 ; ...
Reset the compressor to its initial state .
26,654
private int findDynamicWindow ( int c ) { for ( int i = NUMWINDOWS - 1 ; i >= 0 ; -- i ) { if ( inDynamicWindow ( c , i ) ) { ++ fTimeStamps [ i ] ; return i ; } } return INVALIDWINDOW ; }
Determine if a dynamic window for a certain character is defined
26,655
private static int findStaticWindow ( int c ) { for ( int i = NUMSTATICWINDOWS - 1 ; i >= 0 ; -- i ) { if ( inStaticWindow ( c , i ) ) { return i ; } } return INVALIDWINDOW ; }
Determine if a static window for a certain character is defined
26,656
private int getLRDefinedWindow ( ) { int leastRU = Integer . MAX_VALUE ; int whichWindow = INVALIDWINDOW ; for ( int i = NUMWINDOWS - 1 ; i >= 0 ; -- i ) { if ( fTimeStamps [ i ] < leastRU ) { leastRU = fTimeStamps [ i ] ; whichWindow = i ; } } return whichWindow ; }
Find the least - recently defined window
26,657
public char setIndex ( int location ) { if ( location < start || location > end ) { throw new IllegalArgumentException ( ) ; } offset = location ; if ( offset == end ) { return DONE ; } return string . charAt ( offset ) ; }
Sets the current index in the source string .
26,658
public void setText ( String value ) { string = value ; start = offset = 0 ; end = value . length ( ) ; }
Sets the source string to iterate over . The begin and end positions are set to the start and end of this string .
26,659
public static long getTimeScaleValue ( int scale , int value ) { TimeScaleData data = getTimeScaleData ( scale ) ; switch ( value ) { case UNITS_VALUE : return data . units ; case EPOCH_OFFSET_VALUE : return data . epochOffset ; case FROM_MIN_VALUE : return data . fromMin ; case FROM_MAX_VALUE : return data . fromMax ;...
Get a value associated with a particular time scale .
26,660
public static BigDecimal toBigDecimalTrunc ( BigDecimal universalTime , int timeScale ) { TimeScaleData data = getTimeScaleData ( timeScale ) ; BigDecimal units = new BigDecimal ( data . units ) ; BigDecimal epochOffset = new BigDecimal ( data . epochOffset ) ; return universalTime . divide ( units , BigDecimal . ROUND...
Convert a time in the Universal Time Scale into another time scale . The division used to do the conversion rounds down .
26,661
public XObject execute ( XPathContext xctxt ) throws javax . xml . transform . TransformerException { XObject expr1 = m_left . execute ( xctxt ) ; if ( expr1 . bool ( ) ) { XObject expr2 = m_right . execute ( xctxt ) ; return expr2 . bool ( ) ? XBoolean . S_TRUE : XBoolean . S_FALSE ; } else return XBoolean . S_FALSE ;...
AND two expressions and return the boolean result . Override superclass method for optimization purposes .
26,662
public static void setBlocking ( FileDescriptor fd , boolean blocking ) throws IOException { try { int flags = Libcore . os . fcntlVoid ( fd , F_GETFL ) ; if ( ! blocking ) { flags |= O_NONBLOCK ; } else { flags &= ~ O_NONBLOCK ; } Libcore . os . fcntlLong ( fd , F_SETFL , flags ) ; } catch ( ErrnoException errnoExcept...
Sets fd to be blocking or non - blocking according to the state of blocking .
26,663
public final void initSign ( PrivateKey privateKey , SecureRandom random ) throws InvalidKeyException { engineInitSign ( privateKey , random ) ; state = SIGN ; }
Initialize this object for signing . If this method is called again with a different argument it negates the effect of this call .
26,664
public final void update ( byte b ) throws SignatureException { if ( state == VERIFY || state == SIGN ) { engineUpdate ( b ) ; } else { throw new SignatureException ( "object not initialized for " + "signature or verification" ) ; } }
Updates the data to be signed or verified by a byte .
26,665
public final void update ( byte [ ] data , int off , int len ) throws SignatureException { if ( state == SIGN || state == VERIFY ) { if ( data == null ) { throw new IllegalArgumentException ( "data is null" ) ; } if ( off < 0 || len < 0 ) { throw new IllegalArgumentException ( "off or len is less than 0" ) ; } if ( dat...
Updates the data to be signed or verified using the specified array of bytes starting at the specified offset .
26,666
int getPreviouslyCounted ( XPathContext support , int node ) { int n = m_countNodes . size ( ) ; m_countResult = 0 ; for ( int i = n - 1 ; i >= 0 ; i -- ) { int countedNode = m_countNodes . elementAt ( i ) ; if ( node == countedNode ) { m_countResult = i + 1 + m_countNodesStartCount ; break ; } DTM dtm = support . getD...
Try and find a node that was previously counted . If found return a positive integer that corresponds to the count .
26,667
int getLast ( ) { int size = m_countNodes . size ( ) ; return ( size > 0 ) ? m_countNodes . elementAt ( size - 1 ) : DTM . NULL ; }
Get the last node in the list .
26,668
private void pushRun ( int runBase , int runLen ) { this . runBase [ stackSize ] = runBase ; this . runLen [ stackSize ] = runLen ; stackSize ++ ; }
Pushes the specified run onto the pending - run stack .
26,669
private void mergeForceCollapse ( ) { while ( stackSize > 1 ) { int n = stackSize - 2 ; if ( n > 0 && runLen [ n - 1 ] < runLen [ n + 1 ] ) n -- ; mergeAt ( n ) ; } }
Merges all runs on the stack until only one remains . This method is called once to complete the sort .
26,670
public void setChoices ( double [ ] limits , String formats [ ] ) { if ( limits . length != formats . length ) { throw new IllegalArgumentException ( "Array and limit arrays must be of the same length." ) ; } choiceLimits = limits ; choiceFormats = formats ; }
Set the choices to be used in formatting .
26,671
public StringBuffer format ( double number , StringBuffer toAppendTo , FieldPosition status ) { int i ; for ( i = 0 ; i < choiceLimits . length ; ++ i ) { if ( ! ( number >= choiceLimits [ i ] ) ) { break ; } } -- i ; if ( i < 0 ) i = 0 ; return toAppendTo . append ( choiceFormats [ i ] ) ; }
Returns pattern with formatted double .
26,672
public Number parse ( String text , ParsePosition status ) { int start = status . index ; int furthest = start ; double bestNumber = Double . NaN ; double tempNumber = 0.0 ; for ( int i = 0 ; i < choiceFormats . length ; ++ i ) { String tempString = choiceFormats [ i ] ; if ( text . regionMatches ( start , tempString ,...
Parses a Number from the input text .
26,673
public void play ( int port ) throws IOException { if ( acceptExecutor != null ) { throw new IllegalStateException ( "play() already called" ) ; } acceptExecutor = Executors . newSingleThreadExecutor ( ) ; requestExecutor = Executors . newFixedThreadPool ( workerThreads ) ; serverSocket = new ServerSocket ( port ) ; se...
Starts the server serves all enqueued requests and shuts the server down .
26,674
public void putAll ( Map < ? , ? > attr ) { if ( ! Attributes . class . isInstance ( attr ) ) throw new ClassCastException ( ) ; for ( Map . Entry < ? , ? > me : ( attr ) . entrySet ( ) ) put ( me . getKey ( ) , me . getValue ( ) ) ; }
Copies all of the attribute name - value mappings from the specified Attributes to this Map . Duplicate mappings will be replaced .
26,675
public static void fatalError ( Throwable error , String path ) { StringWriter msg = new StringWriter ( ) ; PrintWriter writer = new PrintWriter ( msg ) ; writer . println ( String . format ( "internal error translating \"%s\"" , path ) ) ; error . printStackTrace ( writer ) ; writer . flush ( ) ; error ( msg . toStrin...
Report that an internal error happened when translating a specific source .
26,676
private int defaultThreadID ( ) { long tid = Thread . currentThread ( ) . getId ( ) ; if ( tid < MIN_SEQUENTIAL_THREAD_ID ) { return ( int ) tid ; } else { Integer id = threadIds . get ( ) ; if ( id == null ) { id = nextThreadId . getAndIncrement ( ) ; threadIds . set ( id ) ; } return id ; } }
Returns the default value for a new LogRecord s threadID .
26,677
public void setBreakIterator ( BreakIterator breakiter ) { search_ . setBreakIter ( breakiter ) ; if ( search_ . breakIter ( ) != null ) { if ( search_ . text ( ) != null ) { search_ . breakIter ( ) . setText ( ( CharacterIterator ) search_ . text ( ) . clone ( ) ) ; } } }
Set the BreakIterator that will be used to restrict the points at which matches are detected .
26,678
public void setTarget ( CharacterIterator text ) { if ( text == null || text . getEndIndex ( ) == text . getIndex ( ) ) { throw new IllegalArgumentException ( "Illegal null or empty text" ) ; } text . setIndex ( text . getBeginIndex ( ) ) ; search_ . setTarget ( text ) ; search_ . matchedIndex_ = DONE ; search_ . setMa...
Set the target text to be searched . Text iteration will then begin at the start of the text string . This method is useful if you want to reuse an iterator to search within a different body of text .
26,679
public void reset ( ) { setMatchNotFound ( ) ; setIndex ( search_ . beginIndex ( ) ) ; search_ . isOverlap_ = false ; search_ . isCanonicalMatch_ = false ; search_ . elementComparisonType_ = ElementComparisonType . STANDARD_ELEMENT_COMPARISON ; search_ . isForwardSearching_ = true ; search_ . reset_ = true ; }
Resets the iteration . Search will begin at the start of the text string if a forward iteration is initiated before a backwards iteration . Otherwise if a backwards iteration is initiated before a forwards iteration the search will begin at the end of the text string .
26,680
public void encode ( OutputStream out ) throws IOException { if ( notBefore == null || notAfter == null ) { throw new IOException ( "CertAttrSet:CertificateValidity:" + " null values to encode.\n" ) ; } DerOutputStream pair = new DerOutputStream ( ) ; if ( notBefore . getTime ( ) < YR_2050 ) { pair . putUTCTime ( notBe...
Encode the CertificateValidity period in DER form to the stream .
26,681
public void reset ( ) { endRange = set . getRangeCount ( ) - 1 ; range = 0 ; endElement = - 1 ; nextElement = 0 ; if ( endRange >= 0 ) { loadRange ( range ) ; } stringIterator = null ; if ( set . strings != null ) { stringIterator = set . strings . iterator ( ) ; if ( ! stringIterator . hasNext ( ) ) { stringIterator =...
Resets this iterator to the start of the set .
26,682
public boolean functionAvailable ( String ns , String funcName ) throws javax . xml . transform . TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages . createXPATHMessage ( XPATHErrorResources . ER_ARG_CANNOT_BE_NULL , new Object [ ] { "Function Name" } ) ; throw new NullPointerException ( ...
Is the extension function available?
26,683
public boolean elementAvailable ( String ns , String elemName ) throws javax . xml . transform . TransformerException { return false ; }
Is the extension element available?
26,684
public ZipEntry getNextEntry ( ) throws IOException { JarEntry e ; if ( first == null ) { e = ( JarEntry ) super . getNextEntry ( ) ; if ( tryManifest ) { e = checkManifest ( e ) ; tryManifest = false ; } } else { e = first ; if ( first . getName ( ) . equalsIgnoreCase ( INDEX_NAME ) ) tryManifest = true ; first = null...
Reads the next ZIP file entry and positions the stream at the beginning of the entry data . If verification has been enabled any invalid signature detected while positioning the stream for the next entry will result in an exception .
26,685
public void throwException ( ) throws BufferUnderflowException , BufferOverflowException , UnmappableCharacterException , MalformedInputException , CharacterCodingException { switch ( this . type ) { case TYPE_UNDERFLOW : throw new BufferUnderflowException ( ) ; case TYPE_OVERFLOW : throw new BufferOverflowException ( ...
Throws an exception corresponding to this coder result .
26,686
public boolean get ( int key , boolean valueIfKeyNotFound ) { int i = ContainerHelpers . binarySearch ( mKeys , mSize , key ) ; if ( i < 0 ) { return valueIfKeyNotFound ; } else { return mValues [ i ] ; } }
Gets the boolean mapped from the specified key or the specified value if no such mapping has been made .
26,687
public final void normalize ( ) { Node next ; for ( Node node = getFirstChild ( ) ; node != null ; node = next ) { next = node . getNextSibling ( ) ; node . normalize ( ) ; if ( node . getNodeType ( ) == Node . TEXT_NODE ) { ( ( TextImpl ) node ) . minimize ( ) ; } } }
Normalize the text nodes within this subtree . Although named similarly this method is unrelated to Document . normalize .
26,688
public void encode ( OutputStream out ) throws IOException { DerOutputStream tmp = new DerOutputStream ( ) ; if ( extensionValue == null ) { this . extensionId = PKIXExtensions . BasicConstraints_Id ; if ( ca ) { critical = true ; } else { critical = false ; } encodeThis ( ) ; } super . encode ( tmp ) ; out . write ( t...
Encode this extension value to the output stream .
26,689
public void addAttribute ( Attribute attribute , Object value ) { if ( attribute == null ) { throw new NullPointerException ( ) ; } int len = length ( ) ; if ( len == 0 ) { throw new IllegalArgumentException ( "Can't add attribute to 0-length text" ) ; } addAttributeImpl ( attribute , value , 0 , len ) ; }
Adds an attribute to the entire string .
26,690
public void addAttribute ( Attribute attribute , Object value , int beginIndex , int endIndex ) { if ( attribute == null ) { throw new NullPointerException ( ) ; } if ( beginIndex < 0 || endIndex > length ( ) || beginIndex >= endIndex ) { throw new IllegalArgumentException ( "Invalid substring range" ) ; } addAttribute...
Adds an attribute to a subrange of the string .
26,691
public void addAttributes ( Map < ? extends Attribute , ? > attributes , int beginIndex , int endIndex ) { if ( attributes == null ) { throw new NullPointerException ( ) ; } if ( beginIndex < 0 || endIndex > length ( ) || beginIndex > endIndex ) { throw new IllegalArgumentException ( "Invalid substring range" ) ; } if ...
Adds a set of attributes to a subrange of the string .
26,692
public AttributedCharacterIterator getIterator ( Attribute [ ] attributes , int beginIndex , int endIndex ) { return new AttributedStringIterator ( attributes , beginIndex , endIndex ) ; }
Creates an AttributedCharacterIterator instance that provides access to selected contents of this string . Information about attributes not listed in attributes that the implementor may have need not be made accessible through the iterator . If the list is null all available attribute information should be made accessi...
26,693
private Object getAttributeCheckRange ( Attribute attribute , int runIndex , int beginIndex , int endIndex ) { Object value = getAttribute ( attribute , runIndex ) ; if ( value instanceof Annotation ) { if ( beginIndex > 0 ) { int currIndex = runIndex ; int runStart = runStarts [ currIndex ] ; while ( runStart >= begin...
gets an attribute value but returns an annotation only if it s range does not extend outside the range beginIndex .. endIndex
26,694
private boolean attributeValuesMatch ( Set attributes , int runIndex1 , int runIndex2 ) { Iterator iterator = attributes . iterator ( ) ; while ( iterator . hasNext ( ) ) { Attribute key = ( Attribute ) iterator . next ( ) ; if ( ! valuesMatch ( getAttribute ( key , runIndex1 ) , getAttribute ( key , runIndex2 ) ) ) { ...
returns whether all specified attributes have equal values in the runs with the given indices
26,695
private final static boolean valuesMatch ( Object value1 , Object value2 ) { if ( value1 == null ) { return value2 == null ; } else { return value1 . equals ( value2 ) ; } }
returns whether the two objects are either both null or equal
26,696
private final void appendContents ( StringBuffer buf , CharacterIterator iterator ) { int index = iterator . getBeginIndex ( ) ; int end = iterator . getEndIndex ( ) ; while ( index < end ) { iterator . setIndex ( index ++ ) ; buf . append ( iterator . current ( ) ) ; } }
Appends the contents of the CharacterIterator iterator into the StringBuffer buf .
26,697
private static boolean mapsDiffer ( Map last , Map attrs ) { if ( last == null ) { return ( attrs != null && attrs . size ( ) > 0 ) ; } return ( ! last . equals ( attrs ) ) ; }
Returns true if the attributes specified in last and attrs differ .
26,698
public static double nextAfter ( double start , double direction ) { if ( Double . isNaN ( start ) || Double . isNaN ( direction ) ) { return start + direction ; } else if ( start == direction ) { return direction ; } else { long transducer = Double . doubleToRawLongBits ( start + 0.0d ) ; if ( direction > start ) { tr...
Returns the floating - point number adjacent to the first argument in the direction of the second argument . If both arguments compare as equal the second argument is returned .
26,699
public static float nextAfter ( float start , double direction ) { if ( Float . isNaN ( start ) || Double . isNaN ( direction ) ) { return start + ( float ) direction ; } else if ( start == direction ) { return ( float ) direction ; } else { int transducer = Float . floatToRawIntBits ( start + 0.0f ) ; if ( direction >...
Returns the floating - point number adjacent to the first argument in the direction of the second argument . If both arguments compare as equal a value equivalent to the second argument is returned .