id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
33,300
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/ManifestEntryVerifier.java
ManifestEntryVerifier.verify
public CodeSigner[] verify(Hashtable<String, CodeSigner[]> verifiedSigners, Hashtable<String, CodeSigner[]> sigFileSigners) throws JarException { if (skip) { return null; } if (signers != null) return signers; for (int i=0; i < digests.size(); i++) { MessageDigest digest = digests.get(i); byte [] manHash = manifestHashes.get(i); byte [] theHash = digest.digest(); if (debug != null) { debug.println("Manifest Entry: " + name + " digest=" + digest.getAlgorithm()); debug.println(" manifest " + toHex(manHash)); debug.println(" computed " + toHex(theHash)); debug.println(); } if (!MessageDigest.isEqual(theHash, manHash)) throw new SecurityException(digest.getAlgorithm()+ " digest error for "+name); } // take it out of sigFileSigners and put it in verifiedSigners... signers = sigFileSigners.remove(name); if (signers != null) { verifiedSigners.put(name, signers); } return signers; }
java
public CodeSigner[] verify(Hashtable<String, CodeSigner[]> verifiedSigners, Hashtable<String, CodeSigner[]> sigFileSigners) throws JarException { if (skip) { return null; } if (signers != null) return signers; for (int i=0; i < digests.size(); i++) { MessageDigest digest = digests.get(i); byte [] manHash = manifestHashes.get(i); byte [] theHash = digest.digest(); if (debug != null) { debug.println("Manifest Entry: " + name + " digest=" + digest.getAlgorithm()); debug.println(" manifest " + toHex(manHash)); debug.println(" computed " + toHex(theHash)); debug.println(); } if (!MessageDigest.isEqual(theHash, manHash)) throw new SecurityException(digest.getAlgorithm()+ " digest error for "+name); } // take it out of sigFileSigners and put it in verifiedSigners... signers = sigFileSigners.remove(name); if (signers != null) { verifiedSigners.put(name, signers); } return signers; }
[ "public", "CodeSigner", "[", "]", "verify", "(", "Hashtable", "<", "String", ",", "CodeSigner", "[", "]", ">", "verifiedSigners", ",", "Hashtable", "<", "String", ",", "CodeSigner", "[", "]", ">", "sigFileSigners", ")", "throws", "JarException", "{", "if", ...
go through all the digests, calculating the final digest and comparing it to the one in the manifest. If this is the first time we have verified this object, remove its code signers from sigFileSigners and place in verifiedSigners.
[ "go", "through", "all", "the", "digests", "calculating", "the", "final", "digest", "and", "comparing", "it", "to", "the", "one", "in", "the", "manifest", ".", "If", "this", "is", "the", "first", "time", "we", "have", "verified", "this", "object", "remove",...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/ManifestEntryVerifier.java#L194-L230
33,301
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/AttributesImplSerializer.java
AttributesImplSerializer.getIndex
public final int getIndex(String qname) { int index; if (super.getLength() < MAX) { // if we haven't got too many attributes let the // super class look it up index = super.getIndex(qname); return index; } // we have too many attributes and the super class is slow // so find it quickly using our Hashtable. Integer i = (Integer)m_indexFromQName.get(qname); if (i == null) index = -1; else index = i.intValue(); return index; }
java
public final int getIndex(String qname) { int index; if (super.getLength() < MAX) { // if we haven't got too many attributes let the // super class look it up index = super.getIndex(qname); return index; } // we have too many attributes and the super class is slow // so find it quickly using our Hashtable. Integer i = (Integer)m_indexFromQName.get(qname); if (i == null) index = -1; else index = i.intValue(); return index; }
[ "public", "final", "int", "getIndex", "(", "String", "qname", ")", "{", "int", "index", ";", "if", "(", "super", ".", "getLength", "(", ")", "<", "MAX", ")", "{", "// if we haven't got too many attributes let the", "// super class look it up", "index", "=", "sup...
This method gets the index of an attribute given its qName. @param qname the qualified name of the attribute, e.g. "prefix1:locName1" @return the integer index of the attribute. @see org.xml.sax.Attributes#getIndex(String)
[ "This", "method", "gets", "the", "index", "of", "an", "attribute", "given", "its", "qName", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/AttributesImplSerializer.java#L71-L90
33,302
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/AttributesImplSerializer.java
AttributesImplSerializer.switchOverToHash
private void switchOverToHash(int numAtts) { for (int index = 0; index < numAtts; index++) { String qName = super.getQName(index); Integer i = new Integer(index); m_indexFromQName.put(qName, i); // Add quick look-up to find with uri/local name pair String uri = super.getURI(index); String local = super.getLocalName(index); m_buff.setLength(0); m_buff.append('{').append(uri).append('}').append(local); String key = m_buff.toString(); m_indexFromQName.put(key, i); } }
java
private void switchOverToHash(int numAtts) { for (int index = 0; index < numAtts; index++) { String qName = super.getQName(index); Integer i = new Integer(index); m_indexFromQName.put(qName, i); // Add quick look-up to find with uri/local name pair String uri = super.getURI(index); String local = super.getLocalName(index); m_buff.setLength(0); m_buff.append('{').append(uri).append('}').append(local); String key = m_buff.toString(); m_indexFromQName.put(key, i); } }
[ "private", "void", "switchOverToHash", "(", "int", "numAtts", ")", "{", "for", "(", "int", "index", "=", "0", ";", "index", "<", "numAtts", ";", "index", "++", ")", "{", "String", "qName", "=", "super", ".", "getQName", "(", "index", ")", ";", "Integ...
We are switching over to having a hash table for quick look up of attributes, but up until now we haven't kept any information in the Hashtable, so we now update the Hashtable. Future additional attributes will update the Hashtable as they are added. @param numAtts
[ "We", "are", "switching", "over", "to", "having", "a", "hash", "table", "for", "quick", "look", "up", "of", "attributes", "but", "up", "until", "now", "we", "haven", "t", "kept", "any", "information", "in", "the", "Hashtable", "so", "we", "now", "update"...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/AttributesImplSerializer.java#L147-L163
33,303
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/AttributesImplSerializer.java
AttributesImplSerializer.getIndex
public final int getIndex(String uri, String localName) { int index; if (super.getLength() < MAX) { // if we haven't got too many attributes let the // super class look it up index = super.getIndex(uri,localName); return index; } // we have too many attributes and the super class is slow // so find it quickly using our Hashtable. // Form the key of format "{uri}localName" m_buff.setLength(0); m_buff.append('{').append(uri).append('}').append(localName); String key = m_buff.toString(); Integer i = (Integer)m_indexFromQName.get(key); if (i == null) index = -1; else index = i.intValue(); return index; }
java
public final int getIndex(String uri, String localName) { int index; if (super.getLength() < MAX) { // if we haven't got too many attributes let the // super class look it up index = super.getIndex(uri,localName); return index; } // we have too many attributes and the super class is slow // so find it quickly using our Hashtable. // Form the key of format "{uri}localName" m_buff.setLength(0); m_buff.append('{').append(uri).append('}').append(localName); String key = m_buff.toString(); Integer i = (Integer)m_indexFromQName.get(key); if (i == null) index = -1; else index = i.intValue(); return index; }
[ "public", "final", "int", "getIndex", "(", "String", "uri", ",", "String", "localName", ")", "{", "int", "index", ";", "if", "(", "super", ".", "getLength", "(", ")", "<", "MAX", ")", "{", "// if we haven't got too many attributes let the", "// super class look ...
This method gets the index of an attribute given its uri and locanName. @param uri the URI of the attribute name. @param localName the local namer (after the ':' ) of the attribute name. @return the integer index of the attribute. @see org.xml.sax.Attributes#getIndex(String)
[ "This", "method", "gets", "the", "index", "of", "an", "attribute", "given", "its", "uri", "and", "locanName", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/AttributesImplSerializer.java#L213-L236
33,304
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/CRLReasonCodeExtension.java
CRLReasonCodeExtension.getReasonCode
public CRLReason getReasonCode() { // if out-of-range, return UNSPECIFIED if (reasonCode > 0 && reasonCode < values.length) { return values[reasonCode]; } else { return CRLReason.UNSPECIFIED; } }
java
public CRLReason getReasonCode() { // if out-of-range, return UNSPECIFIED if (reasonCode > 0 && reasonCode < values.length) { return values[reasonCode]; } else { return CRLReason.UNSPECIFIED; } }
[ "public", "CRLReason", "getReasonCode", "(", ")", "{", "// if out-of-range, return UNSPECIFIED", "if", "(", "reasonCode", ">", "0", "&&", "reasonCode", "<", "values", ".", "length", ")", "{", "return", "values", "[", "reasonCode", "]", ";", "}", "else", "{", ...
Return the reason as a CRLReason enum.
[ "Return", "the", "reason", "as", "a", "CRLReason", "enum", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/CRLReasonCodeExtension.java#L194-L201
33,305
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/util/locale/BaseLocale.java
BaseLocale.createInstance
public static BaseLocale createInstance(String language, String region) { BaseLocale base = new BaseLocale(language, region); CACHE.put(new Key(language, region), base); return base; }
java
public static BaseLocale createInstance(String language, String region) { BaseLocale base = new BaseLocale(language, region); CACHE.put(new Key(language, region), base); return base; }
[ "public", "static", "BaseLocale", "createInstance", "(", "String", "language", ",", "String", "region", ")", "{", "BaseLocale", "base", "=", "new", "BaseLocale", "(", "language", ",", "region", ")", ";", "CACHE", ".", "put", "(", "new", "Key", "(", "langua...
validation is performed.
[ "validation", "is", "performed", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/util/locale/BaseLocale.java#L66-L70
33,306
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalInfo.java
DateIntervalInfo.initializeFromReadOnlyPatterns
private void initializeFromReadOnlyPatterns(DateIntervalInfo dii) { fFallbackIntervalPattern = dii.fFallbackIntervalPattern; fFirstDateInPtnIsLaterDate = dii.fFirstDateInPtnIsLaterDate; fIntervalPatterns = dii.fIntervalPatterns; fIntervalPatternsReadOnly = true; }
java
private void initializeFromReadOnlyPatterns(DateIntervalInfo dii) { fFallbackIntervalPattern = dii.fFallbackIntervalPattern; fFirstDateInPtnIsLaterDate = dii.fFirstDateInPtnIsLaterDate; fIntervalPatterns = dii.fIntervalPatterns; fIntervalPatternsReadOnly = true; }
[ "private", "void", "initializeFromReadOnlyPatterns", "(", "DateIntervalInfo", "dii", ")", "{", "fFallbackIntervalPattern", "=", "dii", ".", "fFallbackIntervalPattern", ";", "fFirstDateInPtnIsLaterDate", "=", "dii", ".", "fFirstDateInPtnIsLaterDate", ";", "fIntervalPatterns", ...
Initialize this object @param dii must have read-only fIntervalPatterns.
[ "Initialize", "this", "object" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalInfo.java#L397-L402
33,307
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalInfo.java
DateIntervalInfo.genPatternInfo
@Deprecated public static PatternInfo genPatternInfo(String intervalPattern, boolean laterDateFirst) { int splitPoint = splitPatternInto2Part(intervalPattern); String firstPart = intervalPattern.substring(0, splitPoint); String secondPart = null; if ( splitPoint < intervalPattern.length() ) { secondPart = intervalPattern.substring(splitPoint, intervalPattern.length()); } return new PatternInfo(firstPart, secondPart, laterDateFirst); }
java
@Deprecated public static PatternInfo genPatternInfo(String intervalPattern, boolean laterDateFirst) { int splitPoint = splitPatternInto2Part(intervalPattern); String firstPart = intervalPattern.substring(0, splitPoint); String secondPart = null; if ( splitPoint < intervalPattern.length() ) { secondPart = intervalPattern.substring(splitPoint, intervalPattern.length()); } return new PatternInfo(firstPart, secondPart, laterDateFirst); }
[ "@", "Deprecated", "public", "static", "PatternInfo", "genPatternInfo", "(", "String", "intervalPattern", ",", "boolean", "laterDateFirst", ")", "{", "int", "splitPoint", "=", "splitPatternInto2Part", "(", "intervalPattern", ")", ";", "String", "firstPart", "=", "in...
Break interval patterns as 2 part and save them into pattern info. @param intervalPattern interval pattern @param laterDateFirst whether the first date in intervalPattern is earlier date or later date @return pattern info object @deprecated This API is ICU internal only. @hide original deprecated declaration @hide draft / provisional / internal are hidden on Android
[ "Break", "interval", "patterns", "as", "2", "part", "and", "save", "them", "into", "pattern", "info", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalInfo.java#L818-L830
33,308
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalInfo.java
DateIntervalInfo.getIntervalPattern
public PatternInfo getIntervalPattern(String skeleton, int field) { if ( field > MINIMUM_SUPPORTED_CALENDAR_FIELD ) { throw new IllegalArgumentException("no support for field less than SECOND"); } Map<String, PatternInfo> patternsOfOneSkeleton = fIntervalPatterns.get(skeleton); if ( patternsOfOneSkeleton != null ) { PatternInfo intervalPattern = patternsOfOneSkeleton. get(CALENDAR_FIELD_TO_PATTERN_LETTER[field]); if ( intervalPattern != null ) { return intervalPattern; } } return null; }
java
public PatternInfo getIntervalPattern(String skeleton, int field) { if ( field > MINIMUM_SUPPORTED_CALENDAR_FIELD ) { throw new IllegalArgumentException("no support for field less than SECOND"); } Map<String, PatternInfo> patternsOfOneSkeleton = fIntervalPatterns.get(skeleton); if ( patternsOfOneSkeleton != null ) { PatternInfo intervalPattern = patternsOfOneSkeleton. get(CALENDAR_FIELD_TO_PATTERN_LETTER[field]); if ( intervalPattern != null ) { return intervalPattern; } } return null; }
[ "public", "PatternInfo", "getIntervalPattern", "(", "String", "skeleton", ",", "int", "field", ")", "{", "if", "(", "field", ">", "MINIMUM_SUPPORTED_CALENDAR_FIELD", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"no support for field less than SECOND\"", ...
Get the interval pattern given the largest different calendar field. @param skeleton the skeleton @param field the largest different calendar field @return interval pattern return null if interval pattern is not found. @throws IllegalArgumentException if getting interval pattern on a calendar field that is smaller than the MINIMUM_SUPPORTED_CALENDAR_FIELD
[ "Get", "the", "interval", "pattern", "given", "the", "largest", "different", "calendar", "field", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalInfo.java#L842-L856
33,309
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalInfo.java
DateIntervalInfo.setFallbackIntervalPattern
public void setFallbackIntervalPattern(String fallbackPattern) { if ( frozen ) { throw new UnsupportedOperationException("no modification is allowed after DII is frozen"); } int firstPatternIndex = fallbackPattern.indexOf("{0}"); int secondPatternIndex = fallbackPattern.indexOf("{1}"); if ( firstPatternIndex == -1 || secondPatternIndex == -1 ) { throw new IllegalArgumentException("no pattern {0} or pattern {1} in fallbackPattern"); } if ( firstPatternIndex > secondPatternIndex ) { fFirstDateInPtnIsLaterDate = true; } fFallbackIntervalPattern = fallbackPattern; }
java
public void setFallbackIntervalPattern(String fallbackPattern) { if ( frozen ) { throw new UnsupportedOperationException("no modification is allowed after DII is frozen"); } int firstPatternIndex = fallbackPattern.indexOf("{0}"); int secondPatternIndex = fallbackPattern.indexOf("{1}"); if ( firstPatternIndex == -1 || secondPatternIndex == -1 ) { throw new IllegalArgumentException("no pattern {0} or pattern {1} in fallbackPattern"); } if ( firstPatternIndex > secondPatternIndex ) { fFirstDateInPtnIsLaterDate = true; } fFallbackIntervalPattern = fallbackPattern; }
[ "public", "void", "setFallbackIntervalPattern", "(", "String", "fallbackPattern", ")", "{", "if", "(", "frozen", ")", "{", "throw", "new", "UnsupportedOperationException", "(", "\"no modification is allowed after DII is frozen\"", ")", ";", "}", "int", "firstPatternIndex"...
Re-set the fallback interval pattern. In construction, default fallback pattern is set as "{0} - {1}". And constructor taking locale as parameter will set the fallback pattern as what defined in the locale resource file. This method provides a way for user to replace the fallback pattern. @param fallbackPattern fall-back interval pattern. @throws UnsupportedOperationException if the object is frozen @throws IllegalArgumentException if there is no pattern {0} or pattern {1} in fallbakckPattern
[ "Re", "-", "set", "the", "fallback", "interval", "pattern", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalInfo.java#L884-L898
33,310
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalInfo.java
DateIntervalInfo.parseSkeleton
static void parseSkeleton(String skeleton, int[] skeletonFieldWidth) { int PATTERN_CHAR_BASE = 0x41; for ( int i = 0; i < skeleton.length(); ++i ) { ++skeletonFieldWidth[skeleton.charAt(i) - PATTERN_CHAR_BASE]; } }
java
static void parseSkeleton(String skeleton, int[] skeletonFieldWidth) { int PATTERN_CHAR_BASE = 0x41; for ( int i = 0; i < skeleton.length(); ++i ) { ++skeletonFieldWidth[skeleton.charAt(i) - PATTERN_CHAR_BASE]; } }
[ "static", "void", "parseSkeleton", "(", "String", "skeleton", ",", "int", "[", "]", "skeletonFieldWidth", ")", "{", "int", "PATTERN_CHAR_BASE", "=", "0x41", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "skeleton", ".", "length", "(", ")", ";",...
Parse skeleton, save each field's width. It is used for looking for best match skeleton, and adjust pattern field width. @param skeleton skeleton to be parsed @param skeletonFieldWidth parsed skeleton field width
[ "Parse", "skeleton", "save", "each", "field", "s", "width", ".", "It", "is", "used", "for", "looking", "for", "best", "match", "skeleton", "and", "adjust", "pattern", "field", "width", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalInfo.java#L1008-L1013
33,311
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalInfo.java
DateIntervalInfo.getRawPatterns
@Deprecated public Map<String, Map<String, PatternInfo>> getRawPatterns() { LinkedHashMap<String, Map<String, PatternInfo>> result = new LinkedHashMap<String, Map<String, PatternInfo>>(); for (Entry<String, Map<String, PatternInfo>> entry : fIntervalPatterns.entrySet()) { result.put(entry.getKey(), new LinkedHashMap<String, PatternInfo>(entry.getValue())); } return result; }
java
@Deprecated public Map<String, Map<String, PatternInfo>> getRawPatterns() { LinkedHashMap<String, Map<String, PatternInfo>> result = new LinkedHashMap<String, Map<String, PatternInfo>>(); for (Entry<String, Map<String, PatternInfo>> entry : fIntervalPatterns.entrySet()) { result.put(entry.getKey(), new LinkedHashMap<String, PatternInfo>(entry.getValue())); } return result; }
[ "@", "Deprecated", "public", "Map", "<", "String", ",", "Map", "<", "String", ",", "PatternInfo", ">", ">", "getRawPatterns", "(", ")", "{", "LinkedHashMap", "<", "String", ",", "Map", "<", "String", ",", "PatternInfo", ">", ">", "result", "=", "new", ...
Get the internal patterns, with a deep clone for safety. @deprecated This API is ICU internal only. @hide original deprecated declaration @hide draft / provisional / internal are hidden on Android
[ "Get", "the", "internal", "patterns", "with", "a", "deep", "clone", "for", "safety", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalInfo.java#L1164-L1171
33,312
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/SAXParseException.java
SAXParseException.init
private void init (String publicId, String systemId, int lineNumber, int columnNumber) { this.publicId = publicId; this.systemId = systemId; this.lineNumber = lineNumber; this.columnNumber = columnNumber; }
java
private void init (String publicId, String systemId, int lineNumber, int columnNumber) { this.publicId = publicId; this.systemId = systemId; this.lineNumber = lineNumber; this.columnNumber = columnNumber; }
[ "private", "void", "init", "(", "String", "publicId", ",", "String", "systemId", ",", "int", "lineNumber", ",", "int", "columnNumber", ")", "{", "this", ".", "publicId", "=", "publicId", ";", "this", ".", "systemId", "=", "systemId", ";", "this", ".", "l...
Internal initialization method. @param publicId The public identifier of the entity which generated the exception, or null. @param systemId The system identifier of the entity which generated the exception, or null. @param lineNumber The line number of the error, or -1. @param columnNumber The column number of the error, or -1.
[ "Internal", "initialization", "method", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/SAXParseException.java#L166-L173
33,313
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java
PolicyNodeImpl.addExpectedPolicy
void addExpectedPolicy(String expectedPolicy) { if (isImmutable) { throw new IllegalStateException("PolicyNode is immutable"); } if (mOriginalExpectedPolicySet) { mExpectedPolicySet.clear(); mOriginalExpectedPolicySet = false; } mExpectedPolicySet.add(expectedPolicy); }
java
void addExpectedPolicy(String expectedPolicy) { if (isImmutable) { throw new IllegalStateException("PolicyNode is immutable"); } if (mOriginalExpectedPolicySet) { mExpectedPolicySet.clear(); mOriginalExpectedPolicySet = false; } mExpectedPolicySet.add(expectedPolicy); }
[ "void", "addExpectedPolicy", "(", "String", "expectedPolicy", ")", "{", "if", "(", "isImmutable", ")", "{", "throw", "new", "IllegalStateException", "(", "\"PolicyNode is immutable\"", ")", ";", "}", "if", "(", "mOriginalExpectedPolicySet", ")", "{", "mExpectedPolic...
Adds an expectedPolicy to the expected policy set. If this is the original expected policy set initialized by the constructor, then the expected policy set is cleared before the expected policy is added. @param expectedPolicy a String representing an expected policy.
[ "Adds", "an", "expectedPolicy", "to", "the", "expected", "policy", "set", ".", "If", "this", "is", "the", "original", "expected", "policy", "set", "initialized", "by", "the", "constructor", "then", "the", "expected", "policy", "set", "is", "cleared", "before",...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java#L229-L238
33,314
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java
PolicyNodeImpl.prune
void prune(int depth) { if (isImmutable) throw new IllegalStateException("PolicyNode is immutable"); // if we have no children, we can't prune below us... if (mChildren.size() == 0) return; Iterator<PolicyNodeImpl> it = mChildren.iterator(); while (it.hasNext()) { PolicyNodeImpl node = it.next(); node.prune(depth); // now that we've called prune on the child, see if we should // remove it from the tree if ((node.mChildren.size() == 0) && (depth > mDepth + 1)) it.remove(); } }
java
void prune(int depth) { if (isImmutable) throw new IllegalStateException("PolicyNode is immutable"); // if we have no children, we can't prune below us... if (mChildren.size() == 0) return; Iterator<PolicyNodeImpl> it = mChildren.iterator(); while (it.hasNext()) { PolicyNodeImpl node = it.next(); node.prune(depth); // now that we've called prune on the child, see if we should // remove it from the tree if ((node.mChildren.size() == 0) && (depth > mDepth + 1)) it.remove(); } }
[ "void", "prune", "(", "int", "depth", ")", "{", "if", "(", "isImmutable", ")", "throw", "new", "IllegalStateException", "(", "\"PolicyNode is immutable\"", ")", ";", "// if we have no children, we can't prune below us...", "if", "(", "mChildren", ".", "size", "(", "...
Removes all paths which don't reach the specified depth. @param depth an int representing the desired minimum depth of all paths
[ "Removes", "all", "paths", "which", "don", "t", "reach", "the", "specified", "depth", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java#L245-L262
33,315
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java
PolicyNodeImpl.getPolicyNodes
Set<PolicyNodeImpl> getPolicyNodes(int depth) { Set<PolicyNodeImpl> set = new HashSet<>(); getPolicyNodes(depth, set); return set; }
java
Set<PolicyNodeImpl> getPolicyNodes(int depth) { Set<PolicyNodeImpl> set = new HashSet<>(); getPolicyNodes(depth, set); return set; }
[ "Set", "<", "PolicyNodeImpl", ">", "getPolicyNodes", "(", "int", "depth", ")", "{", "Set", "<", "PolicyNodeImpl", ">", "set", "=", "new", "HashSet", "<>", "(", ")", ";", "getPolicyNodes", "(", "depth", ",", "set", ")", ";", "return", "set", ";", "}" ]
Returns all nodes at the specified depth in the tree. @param depth an int representing the depth of the desired nodes @return a <code>Set</code> of all nodes at the specified depth
[ "Returns", "all", "nodes", "at", "the", "specified", "depth", "in", "the", "tree", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java#L302-L306
33,316
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java
PolicyNodeImpl.getPolicyNodes
private void getPolicyNodes(int depth, Set<PolicyNodeImpl> set) { // if we've reached the desired depth, then return ourself if (mDepth == depth) { set.add(this); } else { for (PolicyNodeImpl node : mChildren) { node.getPolicyNodes(depth, set); } } }
java
private void getPolicyNodes(int depth, Set<PolicyNodeImpl> set) { // if we've reached the desired depth, then return ourself if (mDepth == depth) { set.add(this); } else { for (PolicyNodeImpl node : mChildren) { node.getPolicyNodes(depth, set); } } }
[ "private", "void", "getPolicyNodes", "(", "int", "depth", ",", "Set", "<", "PolicyNodeImpl", ">", "set", ")", "{", "// if we've reached the desired depth, then return ourself", "if", "(", "mDepth", "==", "depth", ")", "{", "set", ".", "add", "(", "this", ")", ...
Add all nodes at depth depth to set and return the Set. Internal recursion helper.
[ "Add", "all", "nodes", "at", "depth", "depth", "to", "set", "and", "return", "the", "Set", ".", "Internal", "recursion", "helper", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java#L312-L321
33,317
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java
PolicyNodeImpl.getPolicyNodesValid
Set<PolicyNodeImpl> getPolicyNodesValid(int depth, String validOID) { HashSet<PolicyNodeImpl> set = new HashSet<>(); if (mDepth < depth) { for (PolicyNodeImpl node : mChildren) { set.addAll(node.getPolicyNodesValid(depth, validOID)); } } else { if (mValidPolicy.equals(validOID)) set.add(this); } return set; }
java
Set<PolicyNodeImpl> getPolicyNodesValid(int depth, String validOID) { HashSet<PolicyNodeImpl> set = new HashSet<>(); if (mDepth < depth) { for (PolicyNodeImpl node : mChildren) { set.addAll(node.getPolicyNodesValid(depth, validOID)); } } else { if (mValidPolicy.equals(validOID)) set.add(this); } return set; }
[ "Set", "<", "PolicyNodeImpl", ">", "getPolicyNodesValid", "(", "int", "depth", ",", "String", "validOID", ")", "{", "HashSet", "<", "PolicyNodeImpl", ">", "set", "=", "new", "HashSet", "<>", "(", ")", ";", "if", "(", "mDepth", "<", "depth", ")", "{", "...
Finds all nodes at the specified depth that contains the specified valid OID @param depth an int representing the desired depth @param validOID a String encoding the valid OID to match @return a Set of matched <code>PolicyNode</code>s
[ "Finds", "all", "nodes", "at", "the", "specified", "depth", "that", "contains", "the", "specified", "valid", "OID" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java#L376-L389
33,318
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java
PolicyNodeImpl.asString
String asString() { if (mParent == null) { return "anyPolicy ROOT\n"; } else { StringBuilder sb = new StringBuilder(); for (int i = 0, n = getDepth(); i < n; i++) { sb.append(" "); } sb.append(policyToString(getValidPolicy())); sb.append(" CRIT: "); sb.append(isCritical()); sb.append(" EP: "); for (String policy : getExpectedPolicies()) { sb.append(policyToString(policy)); sb.append(" "); } sb.append(" ("); sb.append(getDepth()); sb.append(")\n"); return sb.toString(); } }
java
String asString() { if (mParent == null) { return "anyPolicy ROOT\n"; } else { StringBuilder sb = new StringBuilder(); for (int i = 0, n = getDepth(); i < n; i++) { sb.append(" "); } sb.append(policyToString(getValidPolicy())); sb.append(" CRIT: "); sb.append(isCritical()); sb.append(" EP: "); for (String policy : getExpectedPolicies()) { sb.append(policyToString(policy)); sb.append(" "); } sb.append(" ("); sb.append(getDepth()); sb.append(")\n"); return sb.toString(); } }
[ "String", "asString", "(", ")", "{", "if", "(", "mParent", "==", "null", ")", "{", "return", "\"anyPolicy ROOT\\n\"", ";", "}", "else", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "n...
Prints out some data on this node.
[ "Prints", "out", "some", "data", "on", "this", "node", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/PolicyNodeImpl.java#L402-L423
33,319
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/org/apache/harmony/xml/dom/ElementImpl.java
ElementImpl.getElementById
Element getElementById(String name) { for (Attr attr : attributes) { if (attr.isId() && name.equals(attr.getValue())) { return this; } } /* * TODO: Remove this behavior. * The spec explicitly says that this is a bad idea. From * Document.getElementById(): "Attributes with the name "ID" * or "id" are not of type ID unless so defined. */ if (name.equals(getAttribute("id"))) { return this; } for (NodeImpl node : children) { if (node.getNodeType() == Node.ELEMENT_NODE) { Element element = ((ElementImpl) node).getElementById(name); if (element != null) { return element; } } } return null; }
java
Element getElementById(String name) { for (Attr attr : attributes) { if (attr.isId() && name.equals(attr.getValue())) { return this; } } /* * TODO: Remove this behavior. * The spec explicitly says that this is a bad idea. From * Document.getElementById(): "Attributes with the name "ID" * or "id" are not of type ID unless so defined. */ if (name.equals(getAttribute("id"))) { return this; } for (NodeImpl node : children) { if (node.getNodeType() == Node.ELEMENT_NODE) { Element element = ((ElementImpl) node).getElementById(name); if (element != null) { return element; } } } return null; }
[ "Element", "getElementById", "(", "String", "name", ")", "{", "for", "(", "Attr", "attr", ":", "attributes", ")", "{", "if", "(", "attr", ".", "isId", "(", ")", "&&", "name", ".", "equals", "(", "attr", ".", "getValue", "(", ")", ")", ")", "{", "...
This implementation walks the entire document looking for an element with the given ID attribute. We should consider adding an index to speed navigation of large documents.
[ "This", "implementation", "walks", "the", "entire", "document", "looking", "for", "an", "element", "with", "the", "given", "ID", "attribute", ".", "We", "should", "consider", "adding", "an", "index", "to", "speed", "navigation", "of", "large", "documents", "."...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/apache/harmony/xml/dom/ElementImpl.java#L132-L159
33,320
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ResourceBundle.java
ResourceBundle.strip
private static Locale strip(Locale locale) { String language = locale.getLanguage(); String country = locale.getCountry(); String variant = locale.getVariant(); if (!variant.isEmpty()) { variant = ""; } else if (!country.isEmpty()) { country = ""; } else if (!language.isEmpty()) { language = ""; } else { return null; } return new Locale(language, country, variant); }
java
private static Locale strip(Locale locale) { String language = locale.getLanguage(); String country = locale.getCountry(); String variant = locale.getVariant(); if (!variant.isEmpty()) { variant = ""; } else if (!country.isEmpty()) { country = ""; } else if (!language.isEmpty()) { language = ""; } else { return null; } return new Locale(language, country, variant); }
[ "private", "static", "Locale", "strip", "(", "Locale", "locale", ")", "{", "String", "language", "=", "locale", ".", "getLanguage", "(", ")", ";", "String", "country", "=", "locale", ".", "getCountry", "(", ")", ";", "String", "variant", "=", "locale", "...
Returns a locale with the most-specific field removed, or null if this locale had an empty language, country and variant.
[ "Returns", "a", "locale", "with", "the", "most", "-", "specific", "field", "removed", "or", "null", "if", "this", "locale", "had", "an", "empty", "language", "country", "and", "variant", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ResourceBundle.java#L588-L602
33,321
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java
Bidi.getBaseDirection
public static byte getBaseDirection(CharSequence paragraph) { if (paragraph == null || paragraph.length() == 0) { return NEUTRAL; } int length = paragraph.length(); int c;// codepoint byte direction; for (int i = 0; i < length; ) { // U16_NEXT(paragraph, i, length, c) for C++ c = UCharacter.codePointAt(paragraph, i); direction = UCharacter.getDirectionality(c); if (direction == UCharacterDirection.LEFT_TO_RIGHT) { return LTR; } else if (direction == UCharacterDirection.RIGHT_TO_LEFT || direction == UCharacterDirection.RIGHT_TO_LEFT_ARABIC) { return RTL; } i = UCharacter.offsetByCodePoints(paragraph, i, 1);// set i to the head index of next codepoint } return NEUTRAL; }
java
public static byte getBaseDirection(CharSequence paragraph) { if (paragraph == null || paragraph.length() == 0) { return NEUTRAL; } int length = paragraph.length(); int c;// codepoint byte direction; for (int i = 0; i < length; ) { // U16_NEXT(paragraph, i, length, c) for C++ c = UCharacter.codePointAt(paragraph, i); direction = UCharacter.getDirectionality(c); if (direction == UCharacterDirection.LEFT_TO_RIGHT) { return LTR; } else if (direction == UCharacterDirection.RIGHT_TO_LEFT || direction == UCharacterDirection.RIGHT_TO_LEFT_ARABIC) { return RTL; } i = UCharacter.offsetByCodePoints(paragraph, i, 1);// set i to the head index of next codepoint } return NEUTRAL; }
[ "public", "static", "byte", "getBaseDirection", "(", "CharSequence", "paragraph", ")", "{", "if", "(", "paragraph", "==", "null", "||", "paragraph", ".", "length", "(", ")", "==", "0", ")", "{", "return", "NEUTRAL", ";", "}", "int", "length", "=", "parag...
Get the base direction of the text provided according to the Unicode Bidirectional Algorithm. The base direction is derived from the first character in the string with bidirectional character type L, R, or AL. If the first such character has type L, LTR is returned. If the first such character has type R or AL, RTL is returned. If the string does not contain any character of these types, then NEUTRAL is returned. This is a lightweight function for use when only the base direction is needed and no further bidi processing of the text is needed. @param paragraph the text whose paragraph level direction is needed. @return LTR, RTL, NEUTRAL @see #LTR @see #RTL @see #NEUTRAL
[ "Get", "the", "base", "direction", "of", "the", "text", "provided", "according", "to", "the", "Unicode", "Bidirectional", "Algorithm", ".", "The", "base", "direction", "is", "derived", "from", "the", "first", "character", "in", "the", "string", "with", "bidire...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java#L1683-L1706
33,322
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java
Bidi.firstL_R_AL
private byte firstL_R_AL() { byte result = ON; for (int i = 0; i < prologue.length(); ) { int uchar = prologue.codePointAt(i); i += Character.charCount(uchar); byte dirProp = (byte)getCustomizedClass(uchar); if (result == ON) { if (dirProp == L || dirProp == R || dirProp == AL) { result = dirProp; } } else { if (dirProp == B) { result = ON; } } } return result; }
java
private byte firstL_R_AL() { byte result = ON; for (int i = 0; i < prologue.length(); ) { int uchar = prologue.codePointAt(i); i += Character.charCount(uchar); byte dirProp = (byte)getCustomizedClass(uchar); if (result == ON) { if (dirProp == L || dirProp == R || dirProp == AL) { result = dirProp; } } else { if (dirProp == B) { result = ON; } } } return result; }
[ "private", "byte", "firstL_R_AL", "(", ")", "{", "byte", "result", "=", "ON", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "prologue", ".", "length", "(", ")", ";", ")", "{", "int", "uchar", "=", "prologue", ".", "codePointAt", "(", "i",...
Returns the directionality of the first strong character after the last B in prologue, if any. Requires prologue!=null.
[ "Returns", "the", "directionality", "of", "the", "first", "strong", "character", "after", "the", "last", "B", "in", "prologue", "if", "any", ".", "Requires", "prologue!", "=", "null", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java#L1715-L1732
33,323
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java
Bidi.lastL_R_AL
private byte lastL_R_AL() { for (int i = prologue.length(); i > 0; ) { int uchar = prologue.codePointBefore(i); i -= Character.charCount(uchar); byte dirProp = (byte)getCustomizedClass(uchar); if (dirProp == L) { return _L; } if (dirProp == R || dirProp == AL) { return _R; } if(dirProp == B) { return _ON; } } return _ON; }
java
private byte lastL_R_AL() { for (int i = prologue.length(); i > 0; ) { int uchar = prologue.codePointBefore(i); i -= Character.charCount(uchar); byte dirProp = (byte)getCustomizedClass(uchar); if (dirProp == L) { return _L; } if (dirProp == R || dirProp == AL) { return _R; } if(dirProp == B) { return _ON; } } return _ON; }
[ "private", "byte", "lastL_R_AL", "(", ")", "{", "for", "(", "int", "i", "=", "prologue", ".", "length", "(", ")", ";", "i", ">", "0", ";", ")", "{", "int", "uchar", "=", "prologue", ".", "codePointBefore", "(", "i", ")", ";", "i", "-=", "Characte...
Returns the directionality of the last strong character at the end of the prologue, if any. Requires prologue!=null.
[ "Returns", "the", "directionality", "of", "the", "last", "strong", "character", "at", "the", "end", "of", "the", "prologue", "if", "any", ".", "Requires", "prologue!", "=", "null", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java#L3299-L3315
33,324
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java
Bidi.firstL_R_AL_EN_AN
private byte firstL_R_AL_EN_AN() { for (int i = 0; i < epilogue.length(); ) { int uchar = epilogue.codePointAt(i); i += Character.charCount(uchar); byte dirProp = (byte)getCustomizedClass(uchar); if (dirProp == L) { return _L; } if (dirProp == R || dirProp == AL) { return _R; } if (dirProp == EN) { return _EN; } if (dirProp == AN) { return _AN; } } return _ON; }
java
private byte firstL_R_AL_EN_AN() { for (int i = 0; i < epilogue.length(); ) { int uchar = epilogue.codePointAt(i); i += Character.charCount(uchar); byte dirProp = (byte)getCustomizedClass(uchar); if (dirProp == L) { return _L; } if (dirProp == R || dirProp == AL) { return _R; } if (dirProp == EN) { return _EN; } if (dirProp == AN) { return _AN; } } return _ON; }
[ "private", "byte", "firstL_R_AL_EN_AN", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "epilogue", ".", "length", "(", ")", ";", ")", "{", "int", "uchar", "=", "epilogue", ".", "codePointAt", "(", "i", ")", ";", "i", "+=", "Chara...
Returns the directionality of the first strong character, or digit, in the epilogue, if any. Requires epilogue!=null.
[ "Returns", "the", "directionality", "of", "the", "first", "strong", "character", "or", "digit", "in", "the", "epilogue", "if", "any", ".", "Requires", "epilogue!", "=", "null", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java#L3321-L3340
33,325
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java
Bidi.getParagraphByIndex
public BidiRun getParagraphByIndex(int paraIndex) { verifyValidParaOrLine(); verifyRange(paraIndex, 0, paraCount); Bidi bidi = paraBidi; /* get Para object if Line object */ int paraStart; if (paraIndex == 0) { paraStart = 0; } else { paraStart = bidi.paras_limit[paraIndex - 1]; } BidiRun bidiRun = new BidiRun(); bidiRun.start = paraStart; bidiRun.limit = bidi.paras_limit[paraIndex]; bidiRun.level = GetParaLevelAt(paraStart); return bidiRun; }
java
public BidiRun getParagraphByIndex(int paraIndex) { verifyValidParaOrLine(); verifyRange(paraIndex, 0, paraCount); Bidi bidi = paraBidi; /* get Para object if Line object */ int paraStart; if (paraIndex == 0) { paraStart = 0; } else { paraStart = bidi.paras_limit[paraIndex - 1]; } BidiRun bidiRun = new BidiRun(); bidiRun.start = paraStart; bidiRun.limit = bidi.paras_limit[paraIndex]; bidiRun.level = GetParaLevelAt(paraStart); return bidiRun; }
[ "public", "BidiRun", "getParagraphByIndex", "(", "int", "paraIndex", ")", "{", "verifyValidParaOrLine", "(", ")", ";", "verifyRange", "(", "paraIndex", ",", "0", ",", "paraCount", ")", ";", "Bidi", "bidi", "=", "paraBidi", ";", "/* get Para object if Line object *...
Get a paragraph, given the index of this paragraph. This method returns information about a paragraph.<p> @param paraIndex is the number of the paragraph, in the range <code>[0..countParagraphs()-1]</code>. @return a BidiRun object with the details of the paragraph:<br> <code>start</code> will receive the index of the first character of the paragraph in the text.<br> <code>limit</code> will receive the limit of the paragraph.<br> <code>embeddingLevel</code> will receive the level of the paragraph. @throws IllegalStateException if this call is not preceded by a successful call to <code>setPara</code> or <code>setLine</code> @throws IllegalArgumentException if paraIndex is not in the range <code>[0..countParagraphs()-1]</code> @see android.icu.text.BidiRun
[ "Get", "a", "paragraph", "given", "the", "index", "of", "this", "paragraph", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java#L4515-L4532
33,326
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java
Bidi.getLogicalToVisualRunsMap
void getLogicalToVisualRunsMap() { if (isGoodLogicalToVisualRunsMap) { return; } int count = countRuns(); if ((logicalToVisualRunsMap == null) || (logicalToVisualRunsMap.length < count)) { logicalToVisualRunsMap = new int[count]; } int i; long[] keys = new long[count]; for (i = 0; i < count; i++) { keys[i] = ((long)(runs[i].start)<<32) + i; } Arrays.sort(keys); for (i = 0; i < count; i++) { logicalToVisualRunsMap[i] = (int)(keys[i] & 0x00000000FFFFFFFF); } isGoodLogicalToVisualRunsMap = true; }
java
void getLogicalToVisualRunsMap() { if (isGoodLogicalToVisualRunsMap) { return; } int count = countRuns(); if ((logicalToVisualRunsMap == null) || (logicalToVisualRunsMap.length < count)) { logicalToVisualRunsMap = new int[count]; } int i; long[] keys = new long[count]; for (i = 0; i < count; i++) { keys[i] = ((long)(runs[i].start)<<32) + i; } Arrays.sort(keys); for (i = 0; i < count; i++) { logicalToVisualRunsMap[i] = (int)(keys[i] & 0x00000000FFFFFFFF); } isGoodLogicalToVisualRunsMap = true; }
[ "void", "getLogicalToVisualRunsMap", "(", ")", "{", "if", "(", "isGoodLogicalToVisualRunsMap", ")", "{", "return", ";", "}", "int", "count", "=", "countRuns", "(", ")", ";", "if", "(", "(", "logicalToVisualRunsMap", "==", "null", ")", "||", "(", "logicalToVi...
Compute the logical to visual run mapping
[ "Compute", "the", "logical", "to", "visual", "run", "mapping" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java#L5404-L5424
33,327
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java
Bidi.getRunLevel
public int getRunLevel(int run) { verifyValidParaOrLine(); BidiLine.getRuns(this); verifyRange(run, 0, runCount); getLogicalToVisualRunsMap(); return runs[logicalToVisualRunsMap[run]].level; }
java
public int getRunLevel(int run) { verifyValidParaOrLine(); BidiLine.getRuns(this); verifyRange(run, 0, runCount); getLogicalToVisualRunsMap(); return runs[logicalToVisualRunsMap[run]].level; }
[ "public", "int", "getRunLevel", "(", "int", "run", ")", "{", "verifyValidParaOrLine", "(", ")", ";", "BidiLine", ".", "getRuns", "(", "this", ")", ";", "verifyRange", "(", "run", ",", "0", ",", "runCount", ")", ";", "getLogicalToVisualRunsMap", "(", ")", ...
Return the level of the nth logical run in this line. @param run the index of the run, between 0 and <code>countRuns()-1</code> @return the level of the run @throws IllegalStateException if this call is not preceded by a successful call to <code>setPara</code> or <code>setLine</code> @throws IllegalArgumentException if <code>run</code> is not in the range <code>0&lt;=run&lt;countRuns()</code>
[ "Return", "the", "level", "of", "the", "nth", "logical", "run", "in", "this", "line", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java#L5438-L5445
33,328
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java
Bidi.getRunStart
public int getRunStart(int run) { verifyValidParaOrLine(); BidiLine.getRuns(this); verifyRange(run, 0, runCount); getLogicalToVisualRunsMap(); return runs[logicalToVisualRunsMap[run]].start; }
java
public int getRunStart(int run) { verifyValidParaOrLine(); BidiLine.getRuns(this); verifyRange(run, 0, runCount); getLogicalToVisualRunsMap(); return runs[logicalToVisualRunsMap[run]].start; }
[ "public", "int", "getRunStart", "(", "int", "run", ")", "{", "verifyValidParaOrLine", "(", ")", ";", "BidiLine", ".", "getRuns", "(", "this", ")", ";", "verifyRange", "(", "run", ",", "0", ",", "runCount", ")", ";", "getLogicalToVisualRunsMap", "(", ")", ...
Return the index of the character at the start of the nth logical run in this line, as an offset from the start of the line. @param run the index of the run, between 0 and <code>countRuns()</code> @return the start of the run @throws IllegalStateException if this call is not preceded by a successful call to <code>setPara</code> or <code>setLine</code> @throws IllegalArgumentException if <code>run</code> is not in the range <code>0&lt;=run&lt;countRuns()</code>
[ "Return", "the", "index", "of", "the", "character", "at", "the", "start", "of", "the", "nth", "logical", "run", "in", "this", "line", "as", "an", "offset", "from", "the", "start", "of", "the", "line", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java#L5460-L5467
33,329
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java
Bidi.getRunLimit
public int getRunLimit(int run) { verifyValidParaOrLine(); BidiLine.getRuns(this); verifyRange(run, 0, runCount); getLogicalToVisualRunsMap(); int idx = logicalToVisualRunsMap[run]; int len = idx == 0 ? runs[idx].limit : runs[idx].limit - runs[idx-1].limit; return runs[idx].start + len; }
java
public int getRunLimit(int run) { verifyValidParaOrLine(); BidiLine.getRuns(this); verifyRange(run, 0, runCount); getLogicalToVisualRunsMap(); int idx = logicalToVisualRunsMap[run]; int len = idx == 0 ? runs[idx].limit : runs[idx].limit - runs[idx-1].limit; return runs[idx].start + len; }
[ "public", "int", "getRunLimit", "(", "int", "run", ")", "{", "verifyValidParaOrLine", "(", ")", ";", "BidiLine", ".", "getRuns", "(", "this", ")", ";", "verifyRange", "(", "run", ",", "0", ",", "runCount", ")", ";", "getLogicalToVisualRunsMap", "(", ")", ...
Return the index of the character past the end of the nth logical run in this line, as an offset from the start of the line. For example, this will return the length of the line for the last run on the line. @param run the index of the run, between 0 and <code>countRuns()</code> @return the limit of the run @throws IllegalStateException if this call is not preceded by a successful call to <code>setPara</code> or <code>setLine</code> @throws IllegalArgumentException if <code>run</code> is not in the range <code>0&lt;=run&lt;countRuns()</code>
[ "Return", "the", "index", "of", "the", "character", "past", "the", "end", "of", "the", "nth", "logical", "run", "in", "this", "line", "as", "an", "offset", "from", "the", "start", "of", "the", "line", ".", "For", "example", "this", "will", "return", "t...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java#L5483-L5493
33,330
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java
Bidi.requiresBidi
public static boolean requiresBidi(char[] text, int start, int limit) { final int RTLMask = (1 << UCharacter.DIRECTIONALITY_RIGHT_TO_LEFT | 1 << UCharacter.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC | 1 << UCharacter.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING | 1 << UCharacter.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE | 1 << UCharacter.DIRECTIONALITY_ARABIC_NUMBER); for (int i = start; i < limit; ++i) { if (((1 << UCharacter.getDirection(text[i])) & RTLMask) != 0) { return true; } } return false; }
java
public static boolean requiresBidi(char[] text, int start, int limit) { final int RTLMask = (1 << UCharacter.DIRECTIONALITY_RIGHT_TO_LEFT | 1 << UCharacter.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC | 1 << UCharacter.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING | 1 << UCharacter.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE | 1 << UCharacter.DIRECTIONALITY_ARABIC_NUMBER); for (int i = start; i < limit; ++i) { if (((1 << UCharacter.getDirection(text[i])) & RTLMask) != 0) { return true; } } return false; }
[ "public", "static", "boolean", "requiresBidi", "(", "char", "[", "]", "text", ",", "int", "start", ",", "int", "limit", ")", "{", "final", "int", "RTLMask", "=", "(", "1", "<<", "UCharacter", ".", "DIRECTIONALITY_RIGHT_TO_LEFT", "|", "1", "<<", "UCharacter...
Return true if the specified text requires bidi analysis. If this returns false, the text will display left-to-right. Clients can then avoid constructing a Bidi object. Text in the Arabic Presentation Forms area of Unicode is presumed to already be shaped and ordered for display, and so will not cause this method to return true. @param text the text containing the characters to test @param start the start of the range of characters to test @param limit the limit of the range of characters to test @return true if the range of characters requires bidi analysis
[ "Return", "true", "if", "the", "specified", "text", "requires", "bidi", "analysis", ".", "If", "this", "returns", "false", "the", "text", "will", "display", "left", "-", "to", "-", "right", ".", "Clients", "can", "then", "avoid", "constructing", "a", "Bidi...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java#L5508-L5524
33,331
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java
Bidi.writeReverse
public static String writeReverse(String src, int options) { /* error checking */ if (src == null) { throw new IllegalArgumentException(); } if (src.length() > 0) { return BidiWriter.writeReverse(src, options); } else { /* nothing to do */ return ""; } }
java
public static String writeReverse(String src, int options) { /* error checking */ if (src == null) { throw new IllegalArgumentException(); } if (src.length() > 0) { return BidiWriter.writeReverse(src, options); } else { /* nothing to do */ return ""; } }
[ "public", "static", "String", "writeReverse", "(", "String", "src", ",", "int", "options", ")", "{", "/* error checking */", "if", "(", "src", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "if", "(", "src", ".", ...
Reverse a Right-To-Left run of Unicode text. This method preserves the integrity of characters with multiple code units and (optionally) combining characters. Characters can be replaced by mirror-image characters in the destination buffer. Note that "real" mirroring has to be done in a rendering engine by glyph selection and that for many "mirrored" characters there are no Unicode characters as mirror-image equivalents. There are also options to insert or remove Bidi control characters. This method is the implementation for reversing RTL runs as part of <code>writeReordered()</code>. For detailed descriptions of the parameters, see there. Since no Bidi controls are inserted here, the output string length will never exceed <code>src.length()</code>. @see #writeReordered @param src The RTL run text. @param options A bit set of options for the reordering that control how the reordered text is written. See the <code>options</code> parameter in <code>writeReordered()</code>. @return The reordered text. If the <code>REMOVE_BIDI_CONTROLS</code> option is set, then the length of the returned string may be less than <code>src.length()</code>. If this option is not set, then the length of the returned string will be exactly <code>src.length()</code>. @throws IllegalArgumentException if <code>src</code> is null.
[ "Reverse", "a", "Right", "-", "To", "-", "Left", "run", "of", "Unicode", "text", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Bidi.java#L5661-L5674
33,332
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationFastLatinBuilder.java
CollationFastLatinBuilder.compareInt64AsUnsigned
private static final int compareInt64AsUnsigned(long a, long b) { a += 0x8000000000000000L; b += 0x8000000000000000L; if(a < b) { return -1; } else if(a > b) { return 1; } else { return 0; } }
java
private static final int compareInt64AsUnsigned(long a, long b) { a += 0x8000000000000000L; b += 0x8000000000000000L; if(a < b) { return -1; } else if(a > b) { return 1; } else { return 0; } }
[ "private", "static", "final", "int", "compareInt64AsUnsigned", "(", "long", "a", ",", "long", "b", ")", "{", "a", "+=", "0x8000000000000000", "", "L", ";", "b", "+=", "0x8000000000000000", "", "L", ";", "if", "(", "a", "<", "b", ")", "{", "return", "...
Compare two signed long values as if they were unsigned.
[ "Compare", "two", "signed", "long", "values", "as", "if", "they", "were", "unsigned", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationFastLatinBuilder.java#L27-L37
33,333
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java
IdentityHashMap.containsKey
public boolean containsKey(Object key) { Object k = maskNull(key); Object[] tab = table; int len = tab.length; int i = hash(k, len); while (true) { Object item = tab[i]; if (item == k) return true; if (item == null) return false; i = nextKeyIndex(i, len); } }
java
public boolean containsKey(Object key) { Object k = maskNull(key); Object[] tab = table; int len = tab.length; int i = hash(k, len); while (true) { Object item = tab[i]; if (item == k) return true; if (item == null) return false; i = nextKeyIndex(i, len); } }
[ "public", "boolean", "containsKey", "(", "Object", "key", ")", "{", "Object", "k", "=", "maskNull", "(", "key", ")", ";", "Object", "[", "]", "tab", "=", "table", ";", "int", "len", "=", "tab", ".", "length", ";", "int", "i", "=", "hash", "(", "k...
Tests whether the specified object reference is a key in this identity hash map. @param key possible key @return <code>true</code> if the specified object reference is a key in this map @see #containsValue(Object)
[ "Tests", "whether", "the", "specified", "object", "reference", "is", "a", "key", "in", "this", "identity", "hash", "map", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java#L354-L367
33,334
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java
IdentityHashMap.containsValue
public boolean containsValue(Object value) { Object[] tab = table; for (int i = 1; i < tab.length; i += 2) if (tab[i] == value && tab[i - 1] != null) return true; return false; }
java
public boolean containsValue(Object value) { Object[] tab = table; for (int i = 1; i < tab.length; i += 2) if (tab[i] == value && tab[i - 1] != null) return true; return false; }
[ "public", "boolean", "containsValue", "(", "Object", "value", ")", "{", "Object", "[", "]", "tab", "=", "table", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "tab", ".", "length", ";", "i", "+=", "2", ")", "if", "(", "tab", "[", "i", ...
Tests whether the specified object reference is a value in this identity hash map. @param value value whose presence in this map is to be tested @return <tt>true</tt> if this map maps one or more keys to the specified object reference @see #containsKey(Object)
[ "Tests", "whether", "the", "specified", "object", "reference", "is", "a", "value", "in", "this", "identity", "hash", "map", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java#L378-L385
33,335
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java
IdentityHashMap.resize
private boolean resize(int newCapacity) { // assert (newCapacity & -newCapacity) == newCapacity; // power of 2 int newLength = newCapacity * 2; Object[] oldTable = table; int oldLength = oldTable.length; if (oldLength == 2 * MAXIMUM_CAPACITY) { // can't expand any further if (size == MAXIMUM_CAPACITY - 1) throw new IllegalStateException("Capacity exhausted."); return false; } if (oldLength >= newLength) return false; Object[] newTable = new Object[newLength]; for (int j = 0; j < oldLength; j += 2) { Object key = oldTable[j]; if (key != null) { Object value = oldTable[j+1]; oldTable[j] = null; oldTable[j+1] = null; int i = hash(key, newLength); while (newTable[i] != null) i = nextKeyIndex(i, newLength); newTable[i] = key; newTable[i + 1] = value; } } table = newTable; return true; }
java
private boolean resize(int newCapacity) { // assert (newCapacity & -newCapacity) == newCapacity; // power of 2 int newLength = newCapacity * 2; Object[] oldTable = table; int oldLength = oldTable.length; if (oldLength == 2 * MAXIMUM_CAPACITY) { // can't expand any further if (size == MAXIMUM_CAPACITY - 1) throw new IllegalStateException("Capacity exhausted."); return false; } if (oldLength >= newLength) return false; Object[] newTable = new Object[newLength]; for (int j = 0; j < oldLength; j += 2) { Object key = oldTable[j]; if (key != null) { Object value = oldTable[j+1]; oldTable[j] = null; oldTable[j+1] = null; int i = hash(key, newLength); while (newTable[i] != null) i = nextKeyIndex(i, newLength); newTable[i] = key; newTable[i + 1] = value; } } table = newTable; return true; }
[ "private", "boolean", "resize", "(", "int", "newCapacity", ")", "{", "// assert (newCapacity & -newCapacity) == newCapacity; // power of 2", "int", "newLength", "=", "newCapacity", "*", "2", ";", "Object", "[", "]", "oldTable", "=", "table", ";", "int", "oldLength", ...
Resizes the table if necessary to hold given capacity. @param newCapacity the new capacity, must be a power of two. @return whether a resize did in fact take place
[ "Resizes", "the", "table", "if", "necessary", "to", "hold", "given", "capacity", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java#L463-L494
33,336
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java
IdentityHashMap.removeMapping
private boolean removeMapping(Object key, Object value) { Object k = maskNull(key); Object[] tab = table; int len = tab.length; int i = hash(k, len); while (true) { Object item = tab[i]; if (item == k) { if (tab[i + 1] != value) return false; modCount++; size--; tab[i] = null; tab[i + 1] = null; closeDeletion(i); return true; } if (item == null) return false; i = nextKeyIndex(i, len); } }
java
private boolean removeMapping(Object key, Object value) { Object k = maskNull(key); Object[] tab = table; int len = tab.length; int i = hash(k, len); while (true) { Object item = tab[i]; if (item == k) { if (tab[i + 1] != value) return false; modCount++; size--; tab[i] = null; tab[i + 1] = null; closeDeletion(i); return true; } if (item == null) return false; i = nextKeyIndex(i, len); } }
[ "private", "boolean", "removeMapping", "(", "Object", "key", ",", "Object", "value", ")", "{", "Object", "k", "=", "maskNull", "(", "key", ")", ";", "Object", "[", "]", "tab", "=", "table", ";", "int", "len", "=", "tab", ".", "length", ";", "int", ...
Removes the specified key-value mapping from the map if it is present. @param key possible key @param value possible value @return <code>true</code> if and only if the specified key-value mapping was in the map
[ "Removes", "the", "specified", "key", "-", "value", "mapping", "from", "the", "map", "if", "it", "is", "present", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java#L556-L578
33,337
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java
IdentityHashMap.closeDeletion
private void closeDeletion(int d) { // Adapted from Knuth Section 6.4 Algorithm R Object[] tab = table; int len = tab.length; // Look for items to swap into newly vacated slot // starting at index immediately following deletion, // and continuing until a null slot is seen, indicating // the end of a run of possibly-colliding keys. Object item; for (int i = nextKeyIndex(d, len); (item = tab[i]) != null; i = nextKeyIndex(i, len) ) { // The following test triggers if the item at slot i (which // hashes to be at slot r) should take the spot vacated by d. // If so, we swap it in, and then continue with d now at the // newly vacated i. This process will terminate when we hit // the null slot at the end of this run. // The test is messy because we are using a circular table. int r = hash(item, len); if ((i < r && (r <= d || d <= i)) || (r <= d && d <= i)) { tab[d] = item; tab[d + 1] = tab[i + 1]; tab[i] = null; tab[i + 1] = null; d = i; } } }
java
private void closeDeletion(int d) { // Adapted from Knuth Section 6.4 Algorithm R Object[] tab = table; int len = tab.length; // Look for items to swap into newly vacated slot // starting at index immediately following deletion, // and continuing until a null slot is seen, indicating // the end of a run of possibly-colliding keys. Object item; for (int i = nextKeyIndex(d, len); (item = tab[i]) != null; i = nextKeyIndex(i, len) ) { // The following test triggers if the item at slot i (which // hashes to be at slot r) should take the spot vacated by d. // If so, we swap it in, and then continue with d now at the // newly vacated i. This process will terminate when we hit // the null slot at the end of this run. // The test is messy because we are using a circular table. int r = hash(item, len); if ((i < r && (r <= d || d <= i)) || (r <= d && d <= i)) { tab[d] = item; tab[d + 1] = tab[i + 1]; tab[i] = null; tab[i + 1] = null; d = i; } } }
[ "private", "void", "closeDeletion", "(", "int", "d", ")", "{", "// Adapted from Knuth Section 6.4 Algorithm R", "Object", "[", "]", "tab", "=", "table", ";", "int", "len", "=", "tab", ".", "length", ";", "// Look for items to swap into newly vacated slot", "// startin...
Rehash all possibly-colliding entries following a deletion. This preserves the linear-probe collision properties required by get, put, etc. @param d the index of a newly empty deleted slot
[ "Rehash", "all", "possibly", "-", "colliding", "entries", "following", "a", "deletion", ".", "This", "preserves", "the", "linear", "-", "probe", "collision", "properties", "required", "by", "get", "put", "etc", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java#L587-L614
33,338
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java
IdentityHashMap.putForCreate
private void putForCreate(K key, V value) throws java.io.StreamCorruptedException { Object k = maskNull(key); Object[] tab = table; int len = tab.length; int i = hash(k, len); Object item; while ( (item = tab[i]) != null) { if (item == k) throw new java.io.StreamCorruptedException(); i = nextKeyIndex(i, len); } tab[i] = k; tab[i + 1] = value; }
java
private void putForCreate(K key, V value) throws java.io.StreamCorruptedException { Object k = maskNull(key); Object[] tab = table; int len = tab.length; int i = hash(k, len); Object item; while ( (item = tab[i]) != null) { if (item == k) throw new java.io.StreamCorruptedException(); i = nextKeyIndex(i, len); } tab[i] = k; tab[i + 1] = value; }
[ "private", "void", "putForCreate", "(", "K", "key", ",", "V", "value", ")", "throws", "java", ".", "io", ".", "StreamCorruptedException", "{", "Object", "k", "=", "maskNull", "(", "key", ")", ";", "Object", "[", "]", "tab", "=", "table", ";", "int", ...
The put method for readObject. It does not resize the table, update modCount, etc.
[ "The", "put", "method", "for", "readObject", ".", "It", "does", "not", "resize", "the", "table", "update", "modCount", "etc", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java#L1342-L1358
33,339
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java
TransformerFactoryImpl.setAttribute
public void setAttribute(String name, Object value) throws IllegalArgumentException { if (name.equals(FEATURE_INCREMENTAL)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_incremental = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_incremental = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } else if (name.equals(FEATURE_OPTIMIZE)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_optimize = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_optimize = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } // Custom Xalan feature: annotate DTM with SAX source locator fields. // This gets used during SAX2DTM instantiation. // // %REVIEW% Should the name of this field really be in XalanProperties? // %REVIEW% I hate that it's a global static, but didn't want to change APIs yet. else if(name.equals(FEATURE_SOURCE_LOCATION)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_source_location = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_source_location = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } else { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUPPORTED, new Object[]{name})); //name + "not supported"); } }
java
public void setAttribute(String name, Object value) throws IllegalArgumentException { if (name.equals(FEATURE_INCREMENTAL)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_incremental = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_incremental = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } else if (name.equals(FEATURE_OPTIMIZE)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_optimize = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_optimize = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } // Custom Xalan feature: annotate DTM with SAX source locator fields. // This gets used during SAX2DTM instantiation. // // %REVIEW% Should the name of this field really be in XalanProperties? // %REVIEW% I hate that it's a global static, but didn't want to change APIs yet. else if(name.equals(FEATURE_SOURCE_LOCATION)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_source_location = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_source_location = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } else { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUPPORTED, new Object[]{name})); //name + "not supported"); } }
[ "public", "void", "setAttribute", "(", "String", "name", ",", "Object", "value", ")", "throws", "IllegalArgumentException", "{", "if", "(", "name", ".", "equals", "(", "FEATURE_INCREMENTAL", ")", ")", "{", "if", "(", "value", "instanceof", "Boolean", ")", "{...
Allows the user to set specific attributes on the underlying implementation. @param name The name of the attribute. @param value The value of the attribute; Boolean or String="true"|"false" @throws IllegalArgumentException thrown if the underlying implementation doesn't recognize the attribute.
[ "Allows", "the", "user", "to", "set", "specific", "attributes", "on", "the", "underlying", "implementation", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java#L514-L582
33,340
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java
TransformerFactoryImpl.getAttribute
public Object getAttribute(String name) throws IllegalArgumentException { if (name.equals(FEATURE_INCREMENTAL)) { return new Boolean(m_incremental); } else if (name.equals(FEATURE_OPTIMIZE)) { return new Boolean(m_optimize); } else if (name.equals(FEATURE_SOURCE_LOCATION)) { return new Boolean(m_source_location); } else throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ATTRIB_VALUE_NOT_RECOGNIZED, new Object[]{name})); //name + " attribute not recognized"); }
java
public Object getAttribute(String name) throws IllegalArgumentException { if (name.equals(FEATURE_INCREMENTAL)) { return new Boolean(m_incremental); } else if (name.equals(FEATURE_OPTIMIZE)) { return new Boolean(m_optimize); } else if (name.equals(FEATURE_SOURCE_LOCATION)) { return new Boolean(m_source_location); } else throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ATTRIB_VALUE_NOT_RECOGNIZED, new Object[]{name})); //name + " attribute not recognized"); }
[ "public", "Object", "getAttribute", "(", "String", "name", ")", "throws", "IllegalArgumentException", "{", "if", "(", "name", ".", "equals", "(", "FEATURE_INCREMENTAL", ")", ")", "{", "return", "new", "Boolean", "(", "m_incremental", ")", ";", "}", "else", "...
Allows the user to retrieve specific attributes on the underlying implementation. @param name The name of the attribute. @return value The value of the attribute. @throws IllegalArgumentException thrown if the underlying implementation doesn't recognize the attribute.
[ "Allows", "the", "user", "to", "retrieve", "specific", "attributes", "on", "the", "underlying", "implementation", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java#L594-L610
33,341
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java
TransformerFactoryImpl.newTransformerHandler
public TransformerHandler newTransformerHandler(Source src) throws TransformerConfigurationException { Templates templates = newTemplates(src); if( templates==null ) return null; return newTransformerHandler(templates); }
java
public TransformerHandler newTransformerHandler(Source src) throws TransformerConfigurationException { Templates templates = newTemplates(src); if( templates==null ) return null; return newTransformerHandler(templates); }
[ "public", "TransformerHandler", "newTransformerHandler", "(", "Source", "src", ")", "throws", "TransformerConfigurationException", "{", "Templates", "templates", "=", "newTemplates", "(", "src", ")", ";", "if", "(", "templates", "==", "null", ")", "return", "null", ...
Get a TransformerHandler object that can process SAX ContentHandler events into a Result, based on the transformation instructions specified by the argument. @param src The source of the transformation instructions. @return TransformerHandler ready to transform SAX events. @throws TransformerConfigurationException
[ "Get", "a", "TransformerHandler", "object", "that", "can", "process", "SAX", "ContentHandler", "events", "into", "a", "Result", "based", "on", "the", "transformation", "instructions", "specified", "by", "the", "argument", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java#L682-L690
33,342
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java
TransformerFactoryImpl.newTransformerHandler
public TransformerHandler newTransformerHandler(Templates templates) throws TransformerConfigurationException { try { TransformerImpl transformer = (TransformerImpl) templates.newTransformer(); transformer.setURIResolver(m_uriResolver); TransformerHandler th = (TransformerHandler) transformer.getInputContentHandler(true); return th; } catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; } }
java
public TransformerHandler newTransformerHandler(Templates templates) throws TransformerConfigurationException { try { TransformerImpl transformer = (TransformerImpl) templates.newTransformer(); transformer.setURIResolver(m_uriResolver); TransformerHandler th = (TransformerHandler) transformer.getInputContentHandler(true); return th; } catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; } }
[ "public", "TransformerHandler", "newTransformerHandler", "(", "Templates", "templates", ")", "throws", "TransformerConfigurationException", "{", "try", "{", "TransformerImpl", "transformer", "=", "(", "TransformerImpl", ")", "templates", ".", "newTransformer", "(", ")", ...
Get a TransformerHandler object that can process SAX ContentHandler events into a Result, based on the Templates argument. @param templates The source of the transformation instructions. @return TransformerHandler ready to transform SAX events. @throws TransformerConfigurationException
[ "Get", "a", "TransformerHandler", "object", "that", "can", "process", "SAX", "ContentHandler", "events", "into", "a", "Result", "based", "on", "the", "Templates", "argument", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java#L701-L735
33,343
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java
TransformerFactoryImpl.newTransformer
public Transformer newTransformer(Source source) throws TransformerConfigurationException { try { Templates tmpl=newTemplates( source ); /* this can happen if an ErrorListener is present and it doesn't throw any exception in fatalError. The spec says: "a Transformer must use this interface instead of throwing an exception" - the newTemplates() does that, and returns null. */ if( tmpl==null ) return null; Transformer transformer = tmpl.newTransformer(); transformer.setURIResolver(m_uriResolver); return transformer; } catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; // TODO: but the API promises to never return null... } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; } }
java
public Transformer newTransformer(Source source) throws TransformerConfigurationException { try { Templates tmpl=newTemplates( source ); /* this can happen if an ErrorListener is present and it doesn't throw any exception in fatalError. The spec says: "a Transformer must use this interface instead of throwing an exception" - the newTemplates() does that, and returns null. */ if( tmpl==null ) return null; Transformer transformer = tmpl.newTransformer(); transformer.setURIResolver(m_uriResolver); return transformer; } catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; // TODO: but the API promises to never return null... } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; } }
[ "public", "Transformer", "newTransformer", "(", "Source", "source", ")", "throws", "TransformerConfigurationException", "{", "try", "{", "Templates", "tmpl", "=", "newTemplates", "(", "source", ")", ";", "/* this can happen if an ErrorListener is present and it doesn't\n ...
Process the source into a Transformer object. Care must be given to know that this object can not be used concurrently in multiple threads. @param source An object that holds a URL, input stream, etc. @return A Transformer object capable of being used for transformation purposes in a single thread. @throws TransformerConfigurationException May throw this during the parse when it is constructing the Templates object and fails.
[ "Process", "the", "source", "into", "a", "Transformer", "object", ".", "Care", "must", "be", "given", "to", "know", "that", "this", "object", "can", "not", "be", "used", "concurrently", "in", "multiple", "threads", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java#L775-L812
33,344
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java
TransformerFactoryImpl.newTemplates
public Templates newTemplates(Source source) throws TransformerConfigurationException { String baseID = source.getSystemId(); if (null != baseID) { baseID = SystemIDResolver.getAbsoluteURI(baseID); } if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; Node node = dsource.getNode(); if (null != node) return processFromNode(node, baseID); else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } TemplatesHandler builder = newTemplatesHandler(); builder.setSystemId(baseID); try { InputSource isource = SAXSource.sourceToInputSource(source); isource.setSystemId(baseID); XMLReader reader = null; if (source instanceof SAXSource) reader = ((SAXSource) source).getXMLReader(); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); // If you set the namespaces to true, we'll end up getting double // xmlns attributes. Needs to be fixed. -sb // reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); reader.setContentHandler(builder); reader.parse(isource); } catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } } catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } } return builder.getTemplates(); }
java
public Templates newTemplates(Source source) throws TransformerConfigurationException { String baseID = source.getSystemId(); if (null != baseID) { baseID = SystemIDResolver.getAbsoluteURI(baseID); } if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; Node node = dsource.getNode(); if (null != node) return processFromNode(node, baseID); else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } TemplatesHandler builder = newTemplatesHandler(); builder.setSystemId(baseID); try { InputSource isource = SAXSource.sourceToInputSource(source); isource.setSystemId(baseID); XMLReader reader = null; if (source instanceof SAXSource) reader = ((SAXSource) source).getXMLReader(); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); // If you set the namespaces to true, we'll end up getting double // xmlns attributes. Needs to be fixed. -sb // reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); reader.setContentHandler(builder); reader.parse(isource); } catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } } catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } } return builder.getTemplates(); }
[ "public", "Templates", "newTemplates", "(", "Source", "source", ")", "throws", "TransformerConfigurationException", "{", "String", "baseID", "=", "source", ".", "getSystemId", "(", ")", ";", "if", "(", "null", "!=", "baseID", ")", "{", "baseID", "=", "SystemID...
Process the source into a Templates object, which is likely a compiled representation of the source. This Templates object may then be used concurrently across multiple threads. Creating a Templates object allows the TransformerFactory to do detailed performance optimization of transformation instructions, without penalizing runtime transformation. @param source An object that holds a URL, input stream, etc. @return A Templates object capable of being used for transformation purposes. @throws TransformerConfigurationException May throw this during the parse when it is constructing the Templates object and fails.
[ "Process", "the", "source", "into", "a", "Templates", "object", "which", "is", "likely", "a", "compiled", "representation", "of", "the", "source", ".", "This", "Templates", "object", "may", "then", "be", "used", "concurrently", "across", "multiple", "threads", ...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java#L844-L975
33,345
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java
TransformerFactoryImpl.setErrorListener
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (null == listener) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ERRORLISTENER, null)); // "ErrorListener"); m_errorListener = listener; }
java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (null == listener) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ERRORLISTENER, null)); // "ErrorListener"); m_errorListener = listener; }
[ "public", "void", "setErrorListener", "(", "ErrorListener", "listener", ")", "throws", "IllegalArgumentException", "{", "if", "(", "null", "==", "listener", ")", "throw", "new", "IllegalArgumentException", "(", "XSLMessages", ".", "createMessage", "(", "XSLTErrorResou...
Set an error listener for the TransformerFactory. @param listener Must be a non-null reference to an ErrorListener. @throws IllegalArgumentException if the listener argument is null.
[ "Set", "an", "error", "listener", "for", "the", "TransformerFactory", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java#L1027-L1036
33,346
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ValidIdentifiers.java
ValidIdentifiers.isValid
public static Datasubtype isValid(Datatype datatype, Set<Datasubtype> datasubtypes, String code) { Map<Datasubtype, ValiditySet> subtable = ValidityData.data.get(datatype); if (subtable != null) { for (Datasubtype datasubtype : datasubtypes) { ValiditySet validitySet = subtable.get(datasubtype); if (validitySet != null) { if (validitySet.contains(AsciiUtil.toLowerString(code))) { return datasubtype; } } } } return null; }
java
public static Datasubtype isValid(Datatype datatype, Set<Datasubtype> datasubtypes, String code) { Map<Datasubtype, ValiditySet> subtable = ValidityData.data.get(datatype); if (subtable != null) { for (Datasubtype datasubtype : datasubtypes) { ValiditySet validitySet = subtable.get(datasubtype); if (validitySet != null) { if (validitySet.contains(AsciiUtil.toLowerString(code))) { return datasubtype; } } } } return null; }
[ "public", "static", "Datasubtype", "isValid", "(", "Datatype", "datatype", ",", "Set", "<", "Datasubtype", ">", "datasubtypes", ",", "String", "code", ")", "{", "Map", "<", "Datasubtype", ",", "ValiditySet", ">", "subtable", "=", "ValidityData", ".", "data", ...
Returns the Datasubtype containing the code, or null if there is none.
[ "Returns", "the", "Datasubtype", "containing", "the", "code", "or", "null", "if", "there", "is", "none", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ValidIdentifiers.java#L172-L185
33,347
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
ParserAdapter.setup
private void setup (Parser parser) { if (parser == null) { throw new NullPointerException("Parser argument must not be null"); } this.parser = parser; atts = new AttributesImpl(); nsSupport = new NamespaceSupport(); attAdapter = new AttributeListAdapter(); }
java
private void setup (Parser parser) { if (parser == null) { throw new NullPointerException("Parser argument must not be null"); } this.parser = parser; atts = new AttributesImpl(); nsSupport = new NamespaceSupport(); attAdapter = new AttributeListAdapter(); }
[ "private", "void", "setup", "(", "Parser", "parser", ")", "{", "if", "(", "parser", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Parser argument must not be null\"", ")", ";", "}", "this", ".", "parser", "=", "parser", ";", "atts",...
Internal setup method. @param parser The embedded parser. @exception java.lang.NullPointerException If the parser parameter is null.
[ "Internal", "setup", "method", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java#L133-L143
33,348
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
ParserAdapter.setFeature
public void setFeature (String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { if (name.equals(NAMESPACES)) { checkNotParsing("feature", name); namespaces = value; if (!namespaces && !prefixes) { prefixes = true; } } else if (name.equals(NAMESPACE_PREFIXES)) { checkNotParsing("feature", name); prefixes = value; if (!prefixes && !namespaces) { namespaces = true; } } else if (name.equals(XMLNS_URIs)) { checkNotParsing("feature", name); uris = value; } else { throw new SAXNotRecognizedException("Feature: " + name); } }
java
public void setFeature (String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { if (name.equals(NAMESPACES)) { checkNotParsing("feature", name); namespaces = value; if (!namespaces && !prefixes) { prefixes = true; } } else if (name.equals(NAMESPACE_PREFIXES)) { checkNotParsing("feature", name); prefixes = value; if (!prefixes && !namespaces) { namespaces = true; } } else if (name.equals(XMLNS_URIs)) { checkNotParsing("feature", name); uris = value; } else { throw new SAXNotRecognizedException("Feature: " + name); } }
[ "public", "void", "setFeature", "(", "String", "name", ",", "boolean", "value", ")", "throws", "SAXNotRecognizedException", ",", "SAXNotSupportedException", "{", "if", "(", "name", ".", "equals", "(", "NAMESPACES", ")", ")", "{", "checkNotParsing", "(", "\"featu...
Set a feature flag for the parser. <p>The only features recognized are namespaces and namespace-prefixes.</p> @param name The feature name, as a complete URI. @param value The requested feature value. @exception SAXNotRecognizedException If the feature can't be assigned or retrieved. @exception SAXNotSupportedException If the feature can't be assigned that value. @see org.xml.sax.XMLReader#setFeature
[ "Set", "a", "feature", "flag", "for", "the", "parser", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java#L175-L196
33,349
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
ParserAdapter.getFeature
public boolean getFeature (String name) throws SAXNotRecognizedException, SAXNotSupportedException { if (name.equals(NAMESPACES)) { return namespaces; } else if (name.equals(NAMESPACE_PREFIXES)) { return prefixes; } else if (name.equals(XMLNS_URIs)) { return uris; } else { throw new SAXNotRecognizedException("Feature: " + name); } }
java
public boolean getFeature (String name) throws SAXNotRecognizedException, SAXNotSupportedException { if (name.equals(NAMESPACES)) { return namespaces; } else if (name.equals(NAMESPACE_PREFIXES)) { return prefixes; } else if (name.equals(XMLNS_URIs)) { return uris; } else { throw new SAXNotRecognizedException("Feature: " + name); } }
[ "public", "boolean", "getFeature", "(", "String", "name", ")", "throws", "SAXNotRecognizedException", ",", "SAXNotSupportedException", "{", "if", "(", "name", ".", "equals", "(", "NAMESPACES", ")", ")", "{", "return", "namespaces", ";", "}", "else", "if", "(",...
Check a parser feature flag. <p>The only features recognized are namespaces and namespace-prefixes.</p> @param name The feature name, as a complete URI. @return The current feature value. @exception SAXNotRecognizedException If the feature value can't be assigned or retrieved. @exception SAXNotSupportedException If the feature is not currently readable. @see org.xml.sax.XMLReader#setFeature
[ "Check", "a", "parser", "feature", "flag", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java#L213-L225
33,350
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
ParserAdapter.endElement
public void endElement (String qName) throws SAXException { // If we're not doing Namespace // processing, dispatch this quickly. if (!namespaces) { if (contentHandler != null) { contentHandler.endElement("", "", qName.intern()); } return; } // Split the name. String names[] = processName(qName, false, false); if (contentHandler != null) { contentHandler.endElement(names[0], names[1], names[2]); Enumeration prefixes = nsSupport.getDeclaredPrefixes(); while (prefixes.hasMoreElements()) { String prefix = (String)prefixes.nextElement(); contentHandler.endPrefixMapping(prefix); } } nsSupport.popContext(); }
java
public void endElement (String qName) throws SAXException { // If we're not doing Namespace // processing, dispatch this quickly. if (!namespaces) { if (contentHandler != null) { contentHandler.endElement("", "", qName.intern()); } return; } // Split the name. String names[] = processName(qName, false, false); if (contentHandler != null) { contentHandler.endElement(names[0], names[1], names[2]); Enumeration prefixes = nsSupport.getDeclaredPrefixes(); while (prefixes.hasMoreElements()) { String prefix = (String)prefixes.nextElement(); contentHandler.endPrefixMapping(prefix); } } nsSupport.popContext(); }
[ "public", "void", "endElement", "(", "String", "qName", ")", "throws", "SAXException", "{", "// If we're not doing Namespace", "// processing, dispatch this quickly.", "if", "(", "!", "namespaces", ")", "{", "if", "(", "contentHandler", "!=", "null", ")", "{", "cont...
Adapter implementation method; do not call. Adapt a SAX1 end element event. @param qName The qualified (prefixed) name. @exception SAXException The client may raise a processing exception. @see org.xml.sax.DocumentHandler#endElement
[ "Adapter", "implementation", "method", ";", "do", "not", "call", ".", "Adapt", "a", "SAX1", "end", "element", "event", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java#L607-L630
33,351
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
ParserAdapter.ignorableWhitespace
public void ignorableWhitespace (char ch[], int start, int length) throws SAXException { if (contentHandler != null) { contentHandler.ignorableWhitespace(ch, start, length); } }
java
public void ignorableWhitespace (char ch[], int start, int length) throws SAXException { if (contentHandler != null) { contentHandler.ignorableWhitespace(ch, start, length); } }
[ "public", "void", "ignorableWhitespace", "(", "char", "ch", "[", "]", ",", "int", "start", ",", "int", "length", ")", "throws", "SAXException", "{", "if", "(", "contentHandler", "!=", "null", ")", "{", "contentHandler", ".", "ignorableWhitespace", "(", "ch",...
Adapter implementation method; do not call. Adapt a SAX1 ignorable whitespace event. @param ch An array of characters. @param start The starting position in the array. @param length The number of characters to use. @exception SAXException The client may raise a processing exception. @see org.xml.sax.DocumentHandler#ignorableWhitespace
[ "Adapter", "implementation", "method", ";", "do", "not", "call", ".", "Adapt", "a", "SAX1", "ignorable", "whitespace", "event", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java#L664-L670
33,352
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
ParserAdapter.processingInstruction
public void processingInstruction (String target, String data) throws SAXException { if (contentHandler != null) { contentHandler.processingInstruction(target, data); } }
java
public void processingInstruction (String target, String data) throws SAXException { if (contentHandler != null) { contentHandler.processingInstruction(target, data); } }
[ "public", "void", "processingInstruction", "(", "String", "target", ",", "String", "data", ")", "throws", "SAXException", "{", "if", "(", "contentHandler", "!=", "null", ")", "{", "contentHandler", ".", "processingInstruction", "(", "target", ",", "data", ")", ...
Adapter implementation method; do not call. Adapt a SAX1 processing instruction event. @param target The processing instruction target. @param data The remainder of the processing instruction @exception SAXException The client may raise a processing exception. @see org.xml.sax.DocumentHandler#processingInstruction
[ "Adapter", "implementation", "method", ";", "do", "not", "call", ".", "Adapt", "a", "SAX1", "processing", "instruction", "event", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java#L683-L689
33,353
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
ParserAdapter.setupParser
private void setupParser () { // catch an illegal "nonsense" state. if (!prefixes && !namespaces) throw new IllegalStateException (); nsSupport.reset(); if (uris) nsSupport.setNamespaceDeclUris (true); if (entityResolver != null) { parser.setEntityResolver(entityResolver); } if (dtdHandler != null) { parser.setDTDHandler(dtdHandler); } if (errorHandler != null) { parser.setErrorHandler(errorHandler); } parser.setDocumentHandler(this); locator = null; }
java
private void setupParser () { // catch an illegal "nonsense" state. if (!prefixes && !namespaces) throw new IllegalStateException (); nsSupport.reset(); if (uris) nsSupport.setNamespaceDeclUris (true); if (entityResolver != null) { parser.setEntityResolver(entityResolver); } if (dtdHandler != null) { parser.setDTDHandler(dtdHandler); } if (errorHandler != null) { parser.setErrorHandler(errorHandler); } parser.setDocumentHandler(this); locator = null; }
[ "private", "void", "setupParser", "(", ")", "{", "// catch an illegal \"nonsense\" state.", "if", "(", "!", "prefixes", "&&", "!", "namespaces", ")", "throw", "new", "IllegalStateException", "(", ")", ";", "nsSupport", ".", "reset", "(", ")", ";", "if", "(", ...
Initialize the parser before each run.
[ "Initialize", "the", "parser", "before", "each", "run", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java#L701-L722
33,354
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
ParserAdapter.reportError
void reportError (String message) throws SAXException { if (errorHandler != null) errorHandler.error(makeException(message)); }
java
void reportError (String message) throws SAXException { if (errorHandler != null) errorHandler.error(makeException(message)); }
[ "void", "reportError", "(", "String", "message", ")", "throws", "SAXException", "{", "if", "(", "errorHandler", "!=", "null", ")", "errorHandler", ".", "error", "(", "makeException", "(", "message", ")", ")", ";", "}" ]
Report a non-fatal error. @param message The error message. @exception SAXException The client may throw an exception.
[ "Report", "a", "non", "-", "fatal", "error", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java#L763-L768
33,355
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
ParserAdapter.makeException
private SAXParseException makeException (String message) { if (locator != null) { return new SAXParseException(message, locator); } else { return new SAXParseException(message, null, null, -1, -1); } }
java
private SAXParseException makeException (String message) { if (locator != null) { return new SAXParseException(message, locator); } else { return new SAXParseException(message, null, null, -1, -1); } }
[ "private", "SAXParseException", "makeException", "(", "String", "message", ")", "{", "if", "(", "locator", "!=", "null", ")", "{", "return", "new", "SAXParseException", "(", "message", ",", "locator", ")", ";", "}", "else", "{", "return", "new", "SAXParseExc...
Construct an exception for the current context. @param message The error message.
[ "Construct", "an", "exception", "for", "the", "current", "context", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java#L776-L783
33,356
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
ParserAdapter.checkNotParsing
private void checkNotParsing (String type, String name) throws SAXNotSupportedException { if (parsing) { throw new SAXNotSupportedException("Cannot change " + type + ' ' + name + " while parsing"); } }
java
private void checkNotParsing (String type, String name) throws SAXNotSupportedException { if (parsing) { throw new SAXNotSupportedException("Cannot change " + type + ' ' + name + " while parsing"); } }
[ "private", "void", "checkNotParsing", "(", "String", "type", ",", "String", "name", ")", "throws", "SAXNotSupportedException", "{", "if", "(", "parsing", ")", "{", "throw", "new", "SAXNotSupportedException", "(", "\"Cannot change \"", "+", "type", "+", "'", "'",...
Throw an exception if we are parsing. <p>Use this method to detect illegal feature or property changes.</p> @param type The type of thing (feature or property). @param name The feature or property name. @exception SAXNotSupportedException If a document is currently being parsed.
[ "Throw", "an", "exception", "if", "we", "are", "parsing", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java#L797-L806
33,357
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/utils/URI.java
URI.isConformantSchemeName
public static boolean isConformantSchemeName(String p_scheme) { if (p_scheme == null || p_scheme.trim().length() == 0) { return false; } if (!isAlpha(p_scheme.charAt(0))) { return false; } char testChar; for (int i = 1; i < p_scheme.length(); i++) { testChar = p_scheme.charAt(i); if (!isAlphanum(testChar) && SCHEME_CHARACTERS.indexOf(testChar) == -1) { return false; } } return true; }
java
public static boolean isConformantSchemeName(String p_scheme) { if (p_scheme == null || p_scheme.trim().length() == 0) { return false; } if (!isAlpha(p_scheme.charAt(0))) { return false; } char testChar; for (int i = 1; i < p_scheme.length(); i++) { testChar = p_scheme.charAt(i); if (!isAlphanum(testChar) && SCHEME_CHARACTERS.indexOf(testChar) == -1) { return false; } } return true; }
[ "public", "static", "boolean", "isConformantSchemeName", "(", "String", "p_scheme", ")", "{", "if", "(", "p_scheme", "==", "null", "||", "p_scheme", ".", "trim", "(", ")", ".", "length", "(", ")", "==", "0", ")", "{", "return", "false", ";", "}", "if",...
Determine whether a scheme conforms to the rules for a scheme name. A scheme is conformant if it starts with an alphanumeric, and contains only alphanumerics, '+','-' and '.'. @param p_scheme The sheme name to check @return true if the scheme is conformant, false otherwise
[ "Determine", "whether", "a", "scheme", "conforms", "to", "the", "rules", "for", "a", "scheme", "name", ".", "A", "scheme", "is", "conformant", "if", "it", "starts", "with", "an", "alphanumeric", "and", "contains", "only", "alphanumerics", "+", "-", "and", ...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/utils/URI.java#L1388-L1414
33,358
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DigitList.java
DigitList.setBigDecimalDigits
private void setBigDecimalDigits(String stringDigits, int maximumDigits, boolean fixedPoint) { //| // Find the first non-zero digit, the decimal, and the last non-zero digit. //| int first=-1, last=stringDigits.length()-1, decimal=-1; //| for (int i=0; (first<0 || decimal<0) && i<=last; ++i) { //| char c = stringDigits.charAt(i); //| if (c == '.') { //| decimal = i; //| } else if (first < 0 && (c >= '1' && c <= '9')) { //| first = i; //| } //| } //| //| if (first < 0) { //| clear(); //| return; //| } //| //| // At this point we know there is at least one non-zero digit, so the //| // following loop is safe. //| for (;;) { //| char c = stringDigits.charAt(last); //| if (c != '0' && c != '.') { //| break; //| } //| --last; //| } //| //| if (decimal < 0) { //| decimal = stringDigits.length(); //| } //| //| count = last - first; //| if (decimal < first || decimal > last) { //| ++count; //| } //| decimalAt = decimal - first; //| if (decimalAt < 0) { //| ++decimalAt; //| } //| //| ensureCapacity(count, 0); //| for (int i = 0; i < count; ++i) { //| digits[i] = (byte) stringDigits.charAt(first++); //| if (first == decimal) { //| ++first; //| } //| } didRound = false; // The maxDigits here could also be Integer.MAX_VALUE set(stringDigits, stringDigits.length()); // Eliminate digits beyond maximum digits to be displayed. // Round up if appropriate. // {dlf} Some callers depend on passing '0' to round to mean 'don't round', but // rather than pass that information explicitly, we rely on some magic with maximumDigits // and decimalAt. Unfortunately, this is no good, because there are cases where maximumDigits // is zero and we do want to round, e.g. BigDecimal values -1 < x < 1. So since round // changed to perform rounding when the argument is 0, we now force the argument // to -1 in the situations where it matters. round(fixedPoint ? (maximumDigits + decimalAt) : maximumDigits == 0 ? -1 : maximumDigits); }
java
private void setBigDecimalDigits(String stringDigits, int maximumDigits, boolean fixedPoint) { //| // Find the first non-zero digit, the decimal, and the last non-zero digit. //| int first=-1, last=stringDigits.length()-1, decimal=-1; //| for (int i=0; (first<0 || decimal<0) && i<=last; ++i) { //| char c = stringDigits.charAt(i); //| if (c == '.') { //| decimal = i; //| } else if (first < 0 && (c >= '1' && c <= '9')) { //| first = i; //| } //| } //| //| if (first < 0) { //| clear(); //| return; //| } //| //| // At this point we know there is at least one non-zero digit, so the //| // following loop is safe. //| for (;;) { //| char c = stringDigits.charAt(last); //| if (c != '0' && c != '.') { //| break; //| } //| --last; //| } //| //| if (decimal < 0) { //| decimal = stringDigits.length(); //| } //| //| count = last - first; //| if (decimal < first || decimal > last) { //| ++count; //| } //| decimalAt = decimal - first; //| if (decimalAt < 0) { //| ++decimalAt; //| } //| //| ensureCapacity(count, 0); //| for (int i = 0; i < count; ++i) { //| digits[i] = (byte) stringDigits.charAt(first++); //| if (first == decimal) { //| ++first; //| } //| } didRound = false; // The maxDigits here could also be Integer.MAX_VALUE set(stringDigits, stringDigits.length()); // Eliminate digits beyond maximum digits to be displayed. // Round up if appropriate. // {dlf} Some callers depend on passing '0' to round to mean 'don't round', but // rather than pass that information explicitly, we rely on some magic with maximumDigits // and decimalAt. Unfortunately, this is no good, because there are cases where maximumDigits // is zero and we do want to round, e.g. BigDecimal values -1 < x < 1. So since round // changed to perform rounding when the argument is 0, we now force the argument // to -1 in the situations where it matters. round(fixedPoint ? (maximumDigits + decimalAt) : maximumDigits == 0 ? -1 : maximumDigits); }
[ "private", "void", "setBigDecimalDigits", "(", "String", "stringDigits", ",", "int", "maximumDigits", ",", "boolean", "fixedPoint", ")", "{", "//| // Find the first non-zero digit, the decimal, and the last non-zero digit.", "//| int first=-1, last=stringDigits.length()-1...
Internal method that sets this digit list to represent the given value. The value is given as a String of the format returned by BigDecimal. @param stringDigits value to be represented with the following syntax, expressed as a regular expression: -?\d*.?\d* Must not be an empty string. @param maximumDigits The most digits which should be converted. If maximumDigits is lower than the number of significant digits in source, the representation will be rounded. Ignored if <= 0. @param fixedPoint If true, then maximumDigits is the maximum fractional digits to be converted. If false, total digits.
[ "Internal", "method", "that", "sets", "this", "digit", "list", "to", "represent", "the", "given", "value", ".", "The", "value", "is", "given", "as", "a", "String", "of", "the", "format", "returned", "by", "BigDecimal", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DigitList.java#L644-L707
33,359
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/patterns/FunctionPattern.java
FunctionPattern.execute
public XObject execute(XPathContext xctxt, int context) throws javax.xml.transform.TransformerException { DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE; if (null != nl) { int n; while (DTM.NULL != (n = nl.nextNode())) { score = (n == context) ? SCORE_OTHER : SCORE_NONE; if (score == SCORE_OTHER) { context = n; break; } } // nl.detach(); } nl.detach(); return score; }
java
public XObject execute(XPathContext xctxt, int context) throws javax.xml.transform.TransformerException { DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE; if (null != nl) { int n; while (DTM.NULL != (n = nl.nextNode())) { score = (n == context) ? SCORE_OTHER : SCORE_NONE; if (score == SCORE_OTHER) { context = n; break; } } // nl.detach(); } nl.detach(); return score; }
[ "public", "XObject", "execute", "(", "XPathContext", "xctxt", ",", "int", "context", ")", "throws", "javax", ".", "xml", ".", "transform", ".", "TransformerException", "{", "DTMIterator", "nl", "=", "m_functionExpr", ".", "asIterator", "(", "xctxt", ",", "cont...
Test a node to see if it matches the given node test. @param xctxt XPath runtime context. @return {@link org.apache.xpath.patterns.NodeTest#SCORE_NODETEST}, {@link org.apache.xpath.patterns.NodeTest#SCORE_NONE}, {@link org.apache.xpath.patterns.NodeTest#SCORE_NSWILD}, {@link org.apache.xpath.patterns.NodeTest#SCORE_QNAME}, or {@link org.apache.xpath.patterns.NodeTest#SCORE_OTHER}. @throws javax.xml.transform.TransformerException
[ "Test", "a", "node", "to", "see", "if", "it", "matches", "the", "given", "node", "test", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/patterns/FunctionPattern.java#L102-L130
33,360
google/j2objc
translator/src/main/java/com/google/devtools/j2objc/javac/ClassFileConverter.java
ClassFileConverter.setClassPath
private void setClassPath() throws IOException { String fullPath = file.getAbsolutePath(); String rootPath = fullPath.substring(0, fullPath.lastIndexOf(classFile.getRelativePath())); List<File> classPath = new ArrayList<>(); classPath.add(new File(rootPath)); parserEnv.fileManager().setLocation(StandardLocation.CLASS_PATH, classPath); }
java
private void setClassPath() throws IOException { String fullPath = file.getAbsolutePath(); String rootPath = fullPath.substring(0, fullPath.lastIndexOf(classFile.getRelativePath())); List<File> classPath = new ArrayList<>(); classPath.add(new File(rootPath)); parserEnv.fileManager().setLocation(StandardLocation.CLASS_PATH, classPath); }
[ "private", "void", "setClassPath", "(", ")", "throws", "IOException", "{", "String", "fullPath", "=", "file", ".", "getAbsolutePath", "(", ")", ";", "String", "rootPath", "=", "fullPath", ".", "substring", "(", "0", ",", "fullPath", ".", "lastIndexOf", "(", ...
Set classpath to the root path of the input file, to support typeElement lookup.
[ "Set", "classpath", "to", "the", "root", "path", "of", "the", "input", "file", "to", "support", "typeElement", "lookup", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/javac/ClassFileConverter.java#L119-L125
33,361
google/j2objc
translator/src/main/java/com/google/devtools/j2objc/javac/ClassFileConverter.java
ClassFileConverter.convertClassInitializer
private void convertClassInitializer(AbstractTypeDeclaration typeDecl) { EntityDeclaration decl = classFile.getMethod("<clinit>", "()V"); if (decl == null) { return; // Class doesn't have a static initializer. } MethodTranslator translator = new MethodTranslator( parserEnv, translationEnv, null, typeDecl, null); Block block = (Block) decl.acceptVisitor(translator, null); for (Statement stmt : block.getStatements()) { typeDecl.addClassInitStatement(stmt.copy()); } }
java
private void convertClassInitializer(AbstractTypeDeclaration typeDecl) { EntityDeclaration decl = classFile.getMethod("<clinit>", "()V"); if (decl == null) { return; // Class doesn't have a static initializer. } MethodTranslator translator = new MethodTranslator( parserEnv, translationEnv, null, typeDecl, null); Block block = (Block) decl.acceptVisitor(translator, null); for (Statement stmt : block.getStatements()) { typeDecl.addClassInitStatement(stmt.copy()); } }
[ "private", "void", "convertClassInitializer", "(", "AbstractTypeDeclaration", "typeDecl", ")", "{", "EntityDeclaration", "decl", "=", "classFile", ".", "getMethod", "(", "\"<clinit>\"", ",", "\"()V\"", ")", ";", "if", "(", "decl", "==", "null", ")", "{", "return...
The clinit method isn't converted into a member element by javac, so extract it separately from the classfile.
[ "The", "clinit", "method", "isn", "t", "converted", "into", "a", "member", "element", "by", "javac", "so", "extract", "it", "separately", "from", "the", "classfile", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/javac/ClassFileConverter.java#L149-L161
33,362
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/libcore/net/url/JarHandler.java
JarHandler.toExternalForm
@Override protected String toExternalForm(URL url) { StringBuilder sb = new StringBuilder(); sb.append("jar:"); sb.append(url.getFile()); String ref = url.getRef(); if (ref != null) { sb.append(ref); } return sb.toString(); }
java
@Override protected String toExternalForm(URL url) { StringBuilder sb = new StringBuilder(); sb.append("jar:"); sb.append(url.getFile()); String ref = url.getRef(); if (ref != null) { sb.append(ref); } return sb.toString(); }
[ "@", "Override", "protected", "String", "toExternalForm", "(", "URL", "url", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "\"jar:\"", ")", ";", "sb", ".", "append", "(", "url", ".", "getFile", "...
Build and return the externalized string representation of url. @return String the externalized string representation of url @param url a URL
[ "Build", "and", "return", "the", "externalized", "string", "representation", "of", "url", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/libcore/net/url/JarHandler.java#L96-L106
33,363
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/GeneralSubtrees.java
GeneralSubtrees.encode
public void encode(DerOutputStream out) throws IOException { DerOutputStream seq = new DerOutputStream(); for (int i = 0, n = size(); i < n; i++) { get(i).encode(seq); } out.write(DerValue.tag_Sequence, seq); }
java
public void encode(DerOutputStream out) throws IOException { DerOutputStream seq = new DerOutputStream(); for (int i = 0, n = size(); i < n; i++) { get(i).encode(seq); } out.write(DerValue.tag_Sequence, seq); }
[ "public", "void", "encode", "(", "DerOutputStream", "out", ")", "throws", "IOException", "{", "DerOutputStream", "seq", "=", "new", "DerOutputStream", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "n", "=", "size", "(", ")", ";", "i", "<", "n...
Encode the GeneralSubtrees. @params out the DerOutputStrean to encode this object to.
[ "Encode", "the", "GeneralSubtrees", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/GeneralSubtrees.java#L137-L144
33,364
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/GeneralSubtrees.java
GeneralSubtrees.minimize
private void minimize() { // Algorithm: compare each entry n to all subsequent entries in // the list: if any subsequent entry matches or widens entry n, // remove entry n. If any subsequent entries narrow entry n, remove // the subsequent entries. for (int i = 0; i < size(); i++) { GeneralNameInterface current = getGeneralNameInterface(i); boolean remove1 = false; /* compare current to subsequent elements */ for (int j = i + 1; j < size(); j++) { GeneralNameInterface subsequent = getGeneralNameInterface(j); switch (current.constrains(subsequent)) { case GeneralNameInterface.NAME_DIFF_TYPE: /* not comparable; different name types; keep checking */ continue; case GeneralNameInterface.NAME_MATCH: /* delete one of the duplicates */ remove1 = true; break; case GeneralNameInterface.NAME_NARROWS: /* subsequent narrows current */ /* remove narrower name (subsequent) */ remove(j); j--; /* continue check with new subsequent */ continue; case GeneralNameInterface.NAME_WIDENS: /* subsequent widens current */ /* remove narrower name current */ remove1 = true; break; case GeneralNameInterface.NAME_SAME_TYPE: /* keep both for now; keep checking */ continue; } break; } /* end of this pass of subsequent elements */ if (remove1) { remove(i); i--; /* check the new i value */ } } }
java
private void minimize() { // Algorithm: compare each entry n to all subsequent entries in // the list: if any subsequent entry matches or widens entry n, // remove entry n. If any subsequent entries narrow entry n, remove // the subsequent entries. for (int i = 0; i < size(); i++) { GeneralNameInterface current = getGeneralNameInterface(i); boolean remove1 = false; /* compare current to subsequent elements */ for (int j = i + 1; j < size(); j++) { GeneralNameInterface subsequent = getGeneralNameInterface(j); switch (current.constrains(subsequent)) { case GeneralNameInterface.NAME_DIFF_TYPE: /* not comparable; different name types; keep checking */ continue; case GeneralNameInterface.NAME_MATCH: /* delete one of the duplicates */ remove1 = true; break; case GeneralNameInterface.NAME_NARROWS: /* subsequent narrows current */ /* remove narrower name (subsequent) */ remove(j); j--; /* continue check with new subsequent */ continue; case GeneralNameInterface.NAME_WIDENS: /* subsequent widens current */ /* remove narrower name current */ remove1 = true; break; case GeneralNameInterface.NAME_SAME_TYPE: /* keep both for now; keep checking */ continue; } break; } /* end of this pass of subsequent elements */ if (remove1) { remove(i); i--; /* check the new i value */ } } }
[ "private", "void", "minimize", "(", ")", "{", "// Algorithm: compare each entry n to all subsequent entries in", "// the list: if any subsequent entry matches or widens entry n,", "// remove entry n. If any subsequent entries narrow entry n, remove", "// the subsequent entries.", "for", "(", ...
minimize this GeneralSubtrees by removing all redundant entries. Internal method used by intersect and reduce.
[ "minimize", "this", "GeneralSubtrees", "by", "removing", "all", "redundant", "entries", ".", "Internal", "method", "used", "by", "intersect", "and", "reduce", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/GeneralSubtrees.java#L188-L233
33,365
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/GeneralSubtrees.java
GeneralSubtrees.createWidestSubtree
private GeneralSubtree createWidestSubtree(GeneralNameInterface name) { try { GeneralName newName; switch (name.getType()) { case GeneralNameInterface.NAME_ANY: // Create new OtherName with same OID as baseName, but // empty value ObjectIdentifier otherOID = ((OtherName)name).getOID(); newName = new GeneralName(new OtherName(otherOID, null)); break; case GeneralNameInterface.NAME_RFC822: newName = new GeneralName(new RFC822Name("")); break; case GeneralNameInterface.NAME_DNS: newName = new GeneralName(new DNSName("")); break; case GeneralNameInterface.NAME_X400: newName = new GeneralName(new X400Address((byte[])null)); break; case GeneralNameInterface.NAME_DIRECTORY: newName = new GeneralName(new X500Name("")); break; case GeneralNameInterface.NAME_EDI: newName = new GeneralName(new EDIPartyName("")); break; case GeneralNameInterface.NAME_URI: newName = new GeneralName(new URIName("")); break; case GeneralNameInterface.NAME_IP: newName = new GeneralName(new IPAddressName((byte[])null)); break; case GeneralNameInterface.NAME_OID: newName = new GeneralName (new OIDName(new ObjectIdentifier((int[])null))); break; default: throw new IOException ("Unsupported GeneralNameInterface type: " + name.getType()); } return new GeneralSubtree(newName, 0, -1); } catch (IOException e) { throw new RuntimeException("Unexpected error: " + e, e); } }
java
private GeneralSubtree createWidestSubtree(GeneralNameInterface name) { try { GeneralName newName; switch (name.getType()) { case GeneralNameInterface.NAME_ANY: // Create new OtherName with same OID as baseName, but // empty value ObjectIdentifier otherOID = ((OtherName)name).getOID(); newName = new GeneralName(new OtherName(otherOID, null)); break; case GeneralNameInterface.NAME_RFC822: newName = new GeneralName(new RFC822Name("")); break; case GeneralNameInterface.NAME_DNS: newName = new GeneralName(new DNSName("")); break; case GeneralNameInterface.NAME_X400: newName = new GeneralName(new X400Address((byte[])null)); break; case GeneralNameInterface.NAME_DIRECTORY: newName = new GeneralName(new X500Name("")); break; case GeneralNameInterface.NAME_EDI: newName = new GeneralName(new EDIPartyName("")); break; case GeneralNameInterface.NAME_URI: newName = new GeneralName(new URIName("")); break; case GeneralNameInterface.NAME_IP: newName = new GeneralName(new IPAddressName((byte[])null)); break; case GeneralNameInterface.NAME_OID: newName = new GeneralName (new OIDName(new ObjectIdentifier((int[])null))); break; default: throw new IOException ("Unsupported GeneralNameInterface type: " + name.getType()); } return new GeneralSubtree(newName, 0, -1); } catch (IOException e) { throw new RuntimeException("Unexpected error: " + e, e); } }
[ "private", "GeneralSubtree", "createWidestSubtree", "(", "GeneralNameInterface", "name", ")", "{", "try", "{", "GeneralName", "newName", ";", "switch", "(", "name", ".", "getType", "(", ")", ")", "{", "case", "GeneralNameInterface", ".", "NAME_ANY", ":", "// Cre...
create a subtree containing an instance of the input name type that widens all other names of that type. @params name GeneralNameInterface name @returns GeneralSubtree containing widest name of that type @throws RuntimeException on error (should not occur)
[ "create", "a", "subtree", "containing", "an", "instance", "of", "the", "input", "name", "type", "that", "widens", "all", "other", "names", "of", "that", "type", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/GeneralSubtrees.java#L243-L286
33,366
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/GeneralSubtrees.java
GeneralSubtrees.union
public void union(GeneralSubtrees other) { if (other != null) { for (int i = 0, n = other.size(); i < n; i++) { add(other.get(i)); } // Minimize this minimize(); } }
java
public void union(GeneralSubtrees other) { if (other != null) { for (int i = 0, n = other.size(); i < n; i++) { add(other.get(i)); } // Minimize this minimize(); } }
[ "public", "void", "union", "(", "GeneralSubtrees", "other", ")", "{", "if", "(", "other", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "n", "=", "other", ".", "size", "(", ")", ";", "i", "<", "n", ";", "i", "++", ")", "{", ...
construct union of this GeneralSubtrees with other. @param other GeneralSubtrees to be united with this
[ "construct", "union", "of", "this", "GeneralSubtrees", "with", "other", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/GeneralSubtrees.java#L478-L486
33,367
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/GeneralSubtrees.java
GeneralSubtrees.reduce
public void reduce(GeneralSubtrees excluded) { if (excluded == null) { return; } for (int i = 0, n = excluded.size(); i < n; i++) { GeneralNameInterface excludedName = excluded.getGeneralNameInterface(i); for (int j = 0; j < size(); j++) { GeneralNameInterface permitted = getGeneralNameInterface(j); switch (excludedName.constrains(permitted)) { case GeneralNameInterface.NAME_DIFF_TYPE: break; case GeneralNameInterface.NAME_MATCH: remove(j); j--; break; case GeneralNameInterface.NAME_NARROWS: /* permitted narrows excluded */ remove(j); j--; break; case GeneralNameInterface.NAME_WIDENS: /* permitted widens excluded */ break; case GeneralNameInterface.NAME_SAME_TYPE: break; } } /* end of this pass of permitted */ } /* end of pass of excluded */ }
java
public void reduce(GeneralSubtrees excluded) { if (excluded == null) { return; } for (int i = 0, n = excluded.size(); i < n; i++) { GeneralNameInterface excludedName = excluded.getGeneralNameInterface(i); for (int j = 0; j < size(); j++) { GeneralNameInterface permitted = getGeneralNameInterface(j); switch (excludedName.constrains(permitted)) { case GeneralNameInterface.NAME_DIFF_TYPE: break; case GeneralNameInterface.NAME_MATCH: remove(j); j--; break; case GeneralNameInterface.NAME_NARROWS: /* permitted narrows excluded */ remove(j); j--; break; case GeneralNameInterface.NAME_WIDENS: /* permitted widens excluded */ break; case GeneralNameInterface.NAME_SAME_TYPE: break; } } /* end of this pass of permitted */ } /* end of pass of excluded */ }
[ "public", "void", "reduce", "(", "GeneralSubtrees", "excluded", ")", "{", "if", "(", "excluded", "==", "null", ")", "{", "return", ";", "}", "for", "(", "int", "i", "=", "0", ",", "n", "=", "excluded", ".", "size", "(", ")", ";", "i", "<", "n", ...
reduce this GeneralSubtrees by contents of another. This function is used in merging excluded NameConstraints with permitted NameConstraints to obtain a minimal form of permitted NameConstraints. It is an optimization, and does not affect correctness of the results. @param excluded GeneralSubtrees
[ "reduce", "this", "GeneralSubtrees", "by", "contents", "of", "another", ".", "This", "function", "is", "used", "in", "merging", "excluded", "NameConstraints", "with", "permitted", "NameConstraints", "to", "obtain", "a", "minimal", "form", "of", "permitted", "NameC...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/GeneralSubtrees.java#L496-L524
33,368
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/FunctionTable.java
FunctionTable.getFunctionName
String getFunctionName(int funcID) { if (funcID < NUM_BUILT_IN_FUNCS) return m_functions[funcID].getName(); else return m_functions_customer[funcID - NUM_BUILT_IN_FUNCS].getName(); }
java
String getFunctionName(int funcID) { if (funcID < NUM_BUILT_IN_FUNCS) return m_functions[funcID].getName(); else return m_functions_customer[funcID - NUM_BUILT_IN_FUNCS].getName(); }
[ "String", "getFunctionName", "(", "int", "funcID", ")", "{", "if", "(", "funcID", "<", "NUM_BUILT_IN_FUNCS", ")", "return", "m_functions", "[", "funcID", "]", ".", "getName", "(", ")", ";", "else", "return", "m_functions_customer", "[", "funcID", "-", "NUM_B...
Return the name of the a function in the static table. Needed to avoid making the table publicly available.
[ "Return", "the", "name", "of", "the", "a", "function", "in", "the", "static", "table", ".", "Needed", "to", "avoid", "making", "the", "table", "publicly", "available", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/FunctionTable.java#L311-L314
33,369
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/FunctionTable.java
FunctionTable.getFunction
Function getFunction(int which) throws javax.xml.transform.TransformerException { try{ if (which < NUM_BUILT_IN_FUNCS) return (Function) m_functions[which].newInstance(); else return (Function) m_functions_customer[ which-NUM_BUILT_IN_FUNCS].newInstance(); }catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); } }
java
Function getFunction(int which) throws javax.xml.transform.TransformerException { try{ if (which < NUM_BUILT_IN_FUNCS) return (Function) m_functions[which].newInstance(); else return (Function) m_functions_customer[ which-NUM_BUILT_IN_FUNCS].newInstance(); }catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); } }
[ "Function", "getFunction", "(", "int", "which", ")", "throws", "javax", ".", "xml", ".", "transform", ".", "TransformerException", "{", "try", "{", "if", "(", "which", "<", "NUM_BUILT_IN_FUNCS", ")", "return", "(", "Function", ")", "m_functions", "[", "which...
Obtain a new Function object from a function ID. @param which The function ID, which may correspond to one of the FUNC_XXX values found in {@link org.apache.xpath.compiler.FunctionTable}, but may be a value installed by an external module. @return a a new Function instance. @throws javax.xml.transform.TransformerException if ClassNotFoundException, IllegalAccessException, or InstantiationException is thrown.
[ "Obtain", "a", "new", "Function", "object", "from", "a", "function", "ID", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/FunctionTable.java#L328-L342
33,370
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/FunctionTable.java
FunctionTable.getFunctionID
Object getFunctionID(String key){ Object id = m_functionID_customer.get(key); if (null == id) id = m_functionID.get(key); return id; }
java
Object getFunctionID(String key){ Object id = m_functionID_customer.get(key); if (null == id) id = m_functionID.get(key); return id; }
[ "Object", "getFunctionID", "(", "String", "key", ")", "{", "Object", "id", "=", "m_functionID_customer", ".", "get", "(", "key", ")", ";", "if", "(", "null", "==", "id", ")", "id", "=", "m_functionID", ".", "get", "(", "key", ")", ";", "return", "id"...
Obtain a function ID from a given function name @param key the function name in a java.lang.String format. @return a function ID, which may correspond to one of the FUNC_XXX values found in {@link org.apache.xpath.compiler.FunctionTable}, but may be a value installed by an external module.
[ "Obtain", "a", "function", "ID", "from", "a", "given", "function", "name" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/FunctionTable.java#L351-L355
33,371
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/FunctionTable.java
FunctionTable.installFunction
public int installFunction(String name, Class func) { int funcIndex; Object funcIndexObj = getFunctionID(name); if (null != funcIndexObj) { funcIndex = ((Integer) funcIndexObj).intValue(); if (funcIndex < NUM_BUILT_IN_FUNCS){ funcIndex = m_funcNextFreeIndex++; m_functionID_customer.put(name, new Integer(funcIndex)); } m_functions_customer[funcIndex - NUM_BUILT_IN_FUNCS] = func; } else { funcIndex = m_funcNextFreeIndex++; m_functions_customer[funcIndex-NUM_BUILT_IN_FUNCS] = func; m_functionID_customer.put(name, new Integer(funcIndex)); } return funcIndex; }
java
public int installFunction(String name, Class func) { int funcIndex; Object funcIndexObj = getFunctionID(name); if (null != funcIndexObj) { funcIndex = ((Integer) funcIndexObj).intValue(); if (funcIndex < NUM_BUILT_IN_FUNCS){ funcIndex = m_funcNextFreeIndex++; m_functionID_customer.put(name, new Integer(funcIndex)); } m_functions_customer[funcIndex - NUM_BUILT_IN_FUNCS] = func; } else { funcIndex = m_funcNextFreeIndex++; m_functions_customer[funcIndex-NUM_BUILT_IN_FUNCS] = func; m_functionID_customer.put(name, new Integer(funcIndex)); } return funcIndex; }
[ "public", "int", "installFunction", "(", "String", "name", ",", "Class", "func", ")", "{", "int", "funcIndex", ";", "Object", "funcIndexObj", "=", "getFunctionID", "(", "name", ")", ";", "if", "(", "null", "!=", "funcIndexObj", ")", "{", "funcIndex", "=", ...
Install a built-in function. @param name The unqualified name of the function, must not be null @param func A Implementation of an XPath Function object. @return the position of the function in the internal index.
[ "Install", "a", "built", "-", "in", "function", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/FunctionTable.java#L363-L389
33,372
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/FunctionTable.java
FunctionTable.functionAvailable
public boolean functionAvailable(String methName) { Object tblEntry = m_functionID.get(methName); if (null != tblEntry) return true; else{ tblEntry = m_functionID_customer.get(methName); return (null != tblEntry)? true : false; } }
java
public boolean functionAvailable(String methName) { Object tblEntry = m_functionID.get(methName); if (null != tblEntry) return true; else{ tblEntry = m_functionID_customer.get(methName); return (null != tblEntry)? true : false; } }
[ "public", "boolean", "functionAvailable", "(", "String", "methName", ")", "{", "Object", "tblEntry", "=", "m_functionID", ".", "get", "(", "methName", ")", ";", "if", "(", "null", "!=", "tblEntry", ")", "return", "true", ";", "else", "{", "tblEntry", "=", ...
Tell if a built-in, non-namespaced function is available. @param methName The local name of the function. @return True if the function can be executed.
[ "Tell", "if", "a", "built", "-", "in", "non", "-", "namespaced", "function", "is", "available", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/FunctionTable.java#L398-L406
33,373
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.setExtensionsTable
void setExtensionsTable(StylesheetRoot sroot) throws javax.xml.transform.TransformerException { try { if (sroot.getExtensions() != null) //only load extensions if secureProcessing is disabled if(!sroot.isSecureProcessing()) m_extensionsTable = new ExtensionsTable(sroot); } catch (javax.xml.transform.TransformerException te) {te.printStackTrace();} }
java
void setExtensionsTable(StylesheetRoot sroot) throws javax.xml.transform.TransformerException { try { if (sroot.getExtensions() != null) //only load extensions if secureProcessing is disabled if(!sroot.isSecureProcessing()) m_extensionsTable = new ExtensionsTable(sroot); } catch (javax.xml.transform.TransformerException te) {te.printStackTrace();} }
[ "void", "setExtensionsTable", "(", "StylesheetRoot", "sroot", ")", "throws", "javax", ".", "xml", ".", "transform", ".", "TransformerException", "{", "try", "{", "if", "(", "sroot", ".", "getExtensions", "(", ")", "!=", "null", ")", "//only load extensions if se...
If the stylesheet contains extensions, set the extensions table object. @param sroot The stylesheet. @throws javax.xml.transform.TransformerException
[ "If", "the", "stylesheet", "contains", "extensions", "set", "the", "extensions", "table", "object", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L379-L391
33,374
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.functionAvailable
public boolean functionAvailable(String ns, String funcName) throws javax.xml.transform.TransformerException { return getExtensionsTable().functionAvailable(ns, funcName); }
java
public boolean functionAvailable(String ns, String funcName) throws javax.xml.transform.TransformerException { return getExtensionsTable().functionAvailable(ns, funcName); }
[ "public", "boolean", "functionAvailable", "(", "String", "ns", ",", "String", "funcName", ")", "throws", "javax", ".", "xml", ".", "transform", ".", "TransformerException", "{", "return", "getExtensionsTable", "(", ")", ".", "functionAvailable", "(", "ns", ",", ...
== Implementation of the XPath ExtensionsProvider interface.
[ "==", "Implementation", "of", "the", "XPath", "ExtensionsProvider", "interface", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L395-L399
33,375
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.getInputContentHandler
public ContentHandler getInputContentHandler(boolean doDocFrag) { if (null == m_inputContentHandler) { // if(null == m_urlOfSource && null != m_stylesheetRoot) // m_urlOfSource = m_stylesheetRoot.getBaseIdentifier(); m_inputContentHandler = new TransformerHandlerImpl(this, doDocFrag, m_urlOfSource); } return m_inputContentHandler; }
java
public ContentHandler getInputContentHandler(boolean doDocFrag) { if (null == m_inputContentHandler) { // if(null == m_urlOfSource && null != m_stylesheetRoot) // m_urlOfSource = m_stylesheetRoot.getBaseIdentifier(); m_inputContentHandler = new TransformerHandlerImpl(this, doDocFrag, m_urlOfSource); } return m_inputContentHandler; }
[ "public", "ContentHandler", "getInputContentHandler", "(", "boolean", "doDocFrag", ")", "{", "if", "(", "null", "==", "m_inputContentHandler", ")", "{", "// if(null == m_urlOfSource && null != m_stylesheetRoot)", "// m_urlOfSource = m_stylesheetRoot.getBaseIdentifier();",...
Get a SAX2 ContentHandler for the input. @param doDocFrag true if a DocumentFragment should be created as the root, rather than a Document. @return A valid ContentHandler, which should never be null, as long as getFeature("http://xml.org/trax/features/sax/input") returns true.
[ "Get", "a", "SAX2", "ContentHandler", "for", "the", "input", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1326-L1339
33,376
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.getOutputFormat
public OutputProperties getOutputFormat() { // Get the output format that was set by the user, otherwise get the // output format from the stylesheet. OutputProperties format = (null == m_outputFormat) ? getStylesheet().getOutputComposed() : m_outputFormat; return format; }
java
public OutputProperties getOutputFormat() { // Get the output format that was set by the user, otherwise get the // output format from the stylesheet. OutputProperties format = (null == m_outputFormat) ? getStylesheet().getOutputComposed() : m_outputFormat; return format; }
[ "public", "OutputProperties", "getOutputFormat", "(", ")", "{", "// Get the output format that was set by the user, otherwise get the ", "// output format from the stylesheet.", "OutputProperties", "format", "=", "(", "null", "==", "m_outputFormat", ")", "?", "getStylesheet", "("...
Get the output properties used for the transformation. @return the output format that was set by the user, otherwise the output format from the stylesheet.
[ "Get", "the", "output", "properties", "used", "for", "the", "transformation", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1360-L1370
33,377
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.setParameter
public void setParameter(String name, String namespace, Object value) { VariableStack varstack = getXPathContext().getVarStack(); QName qname = new QName(namespace, name); XObject xobject = XObject.create(value, getXPathContext()); StylesheetRoot sroot = m_stylesheetRoot; Vector vars = sroot.getVariablesAndParamsComposed(); int i = vars.size(); while (--i >= 0) { ElemVariable variable = (ElemVariable)vars.elementAt(i); if(variable.getXSLToken() == Constants.ELEMNAME_PARAMVARIABLE && variable.getName().equals(qname)) { varstack.setGlobalVariable(i, xobject); } } }
java
public void setParameter(String name, String namespace, Object value) { VariableStack varstack = getXPathContext().getVarStack(); QName qname = new QName(namespace, name); XObject xobject = XObject.create(value, getXPathContext()); StylesheetRoot sroot = m_stylesheetRoot; Vector vars = sroot.getVariablesAndParamsComposed(); int i = vars.size(); while (--i >= 0) { ElemVariable variable = (ElemVariable)vars.elementAt(i); if(variable.getXSLToken() == Constants.ELEMNAME_PARAMVARIABLE && variable.getName().equals(qname)) { varstack.setGlobalVariable(i, xobject); } } }
[ "public", "void", "setParameter", "(", "String", "name", ",", "String", "namespace", ",", "Object", "value", ")", "{", "VariableStack", "varstack", "=", "getXPathContext", "(", ")", ".", "getVarStack", "(", ")", ";", "QName", "qname", "=", "new", "QName", ...
Set a parameter for the templates. @param name The name of the parameter. @param namespace The namespace of the parameter. @param value The value object. This can be any valid Java object -- it's up to the processor to provide the proper coersion to the object, or simply pass it on for use in extensions.
[ "Set", "a", "parameter", "for", "the", "templates", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1382-L1401
33,378
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.setParameter
public void setParameter(String name, Object value) { if (value == null) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_SET_PARAM_VALUE, new Object[]{name})); } StringTokenizer tokenizer = new StringTokenizer(name, "{}", false); try { // The first string might be the namespace, or it might be // the local name, if the namespace is null. String s1 = tokenizer.nextToken(); String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null; if (null == m_userParams) m_userParams = new Vector(); if (null == s2) { replaceOrPushUserParam(new QName(s1), XObject.create(value, getXPathContext())); setParameter(s1, null, value); } else { replaceOrPushUserParam(new QName(s1, s2), XObject.create(value, getXPathContext())); setParameter(s2, s1, value); } } catch (java.util.NoSuchElementException nsee) { // Should throw some sort of an error. } }
java
public void setParameter(String name, Object value) { if (value == null) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_SET_PARAM_VALUE, new Object[]{name})); } StringTokenizer tokenizer = new StringTokenizer(name, "{}", false); try { // The first string might be the namespace, or it might be // the local name, if the namespace is null. String s1 = tokenizer.nextToken(); String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null; if (null == m_userParams) m_userParams = new Vector(); if (null == s2) { replaceOrPushUserParam(new QName(s1), XObject.create(value, getXPathContext())); setParameter(s1, null, value); } else { replaceOrPushUserParam(new QName(s1, s2), XObject.create(value, getXPathContext())); setParameter(s2, s1, value); } } catch (java.util.NoSuchElementException nsee) { // Should throw some sort of an error. } }
[ "public", "void", "setParameter", "(", "String", "name", ",", "Object", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "XSLMessages", ".", "createMessage", "(", "XSLTErrorResources", ".", "ER_INV...
Set a parameter for the transformation. @param name The name of the parameter, which may have a namespace URI. @param value The value object. This can be any valid Java object -- it's up to the processor to provide the proper coersion to the object, or simply pass it on for use in extensions.
[ "Set", "a", "parameter", "for", "the", "transformation", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1416-L1452
33,379
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.replaceOrPushUserParam
private void replaceOrPushUserParam(QName qname, XObject xval) { int n = m_userParams.size(); for (int i = n - 1; i >= 0; i--) { Arg arg = (Arg) m_userParams.elementAt(i); if (arg.getQName().equals(qname)) { m_userParams.setElementAt(new Arg(qname, xval, true), i); return; } } m_userParams.addElement(new Arg(qname, xval, true)); }
java
private void replaceOrPushUserParam(QName qname, XObject xval) { int n = m_userParams.size(); for (int i = n - 1; i >= 0; i--) { Arg arg = (Arg) m_userParams.elementAt(i); if (arg.getQName().equals(qname)) { m_userParams.setElementAt(new Arg(qname, xval, true), i); return; } } m_userParams.addElement(new Arg(qname, xval, true)); }
[ "private", "void", "replaceOrPushUserParam", "(", "QName", "qname", ",", "XObject", "xval", ")", "{", "int", "n", "=", "m_userParams", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "n", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")...
NEEDSDOC Method replaceOrPushUserParam NEEDSDOC @param qname NEEDSDOC @param xval
[ "NEEDSDOC", "Method", "replaceOrPushUserParam" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1461-L1479
33,380
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.setParameters
public void setParameters(Properties params) { clearParameters(); Enumeration names = params.propertyNames(); while (names.hasMoreElements()) { String name = params.getProperty((String) names.nextElement()); StringTokenizer tokenizer = new StringTokenizer(name, "{}", false); try { // The first string might be the namespace, or it might be // the local name, if the namespace is null. String s1 = tokenizer.nextToken(); String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null; if (null == s2) setParameter(s1, null, params.getProperty(name)); else setParameter(s2, s1, params.getProperty(name)); } catch (java.util.NoSuchElementException nsee) { // Should throw some sort of an error. } } }
java
public void setParameters(Properties params) { clearParameters(); Enumeration names = params.propertyNames(); while (names.hasMoreElements()) { String name = params.getProperty((String) names.nextElement()); StringTokenizer tokenizer = new StringTokenizer(name, "{}", false); try { // The first string might be the namespace, or it might be // the local name, if the namespace is null. String s1 = tokenizer.nextToken(); String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null; if (null == s2) setParameter(s1, null, params.getProperty(name)); else setParameter(s2, s1, params.getProperty(name)); } catch (java.util.NoSuchElementException nsee) { // Should throw some sort of an error. } } }
[ "public", "void", "setParameters", "(", "Properties", "params", ")", "{", "clearParameters", "(", ")", ";", "Enumeration", "names", "=", "params", ".", "propertyNames", "(", ")", ";", "while", "(", "names", ".", "hasMoreElements", "(", ")", ")", "{", "Stri...
Set a bag of parameters for the transformation. Note that these will not be additive, they will replace the existing set of parameters. NEEDSDOC @param params
[ "Set", "a", "bag", "of", "parameters", "for", "the", "transformation", ".", "Note", "that", "these", "will", "not", "be", "additive", "they", "will", "replace", "the", "existing", "set", "of", "parameters", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1572-L1603
33,381
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.clearParameters
public void clearParameters() { synchronized (m_reentryGuard) { VariableStack varstack = new VariableStack(); m_xcontext.setVarStack(varstack); m_userParams = null; } }
java
public void clearParameters() { synchronized (m_reentryGuard) { VariableStack varstack = new VariableStack(); m_xcontext.setVarStack(varstack); m_userParams = null; } }
[ "public", "void", "clearParameters", "(", ")", "{", "synchronized", "(", "m_reentryGuard", ")", "{", "VariableStack", "varstack", "=", "new", "VariableStack", "(", ")", ";", "m_xcontext", ".", "setVarStack", "(", "varstack", ")", ";", "m_userParams", "=", "nul...
Reset the parameters to a null list.
[ "Reset", "the", "parameters", "to", "a", "null", "list", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1608-L1619
33,382
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.setContentHandler
public void setContentHandler(ContentHandler handler) { if (handler == null) { throw new NullPointerException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_CONTENT_HANDLER, null)); //"Null content handler"); } else { m_outputContentHandler = handler; if (null == m_serializationHandler) { ToXMLSAXHandler h = new ToXMLSAXHandler(); h.setContentHandler(handler); h.setTransformer(this); m_serializationHandler = h; } else m_serializationHandler.setContentHandler(handler); } }
java
public void setContentHandler(ContentHandler handler) { if (handler == null) { throw new NullPointerException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_CONTENT_HANDLER, null)); //"Null content handler"); } else { m_outputContentHandler = handler; if (null == m_serializationHandler) { ToXMLSAXHandler h = new ToXMLSAXHandler(); h.setContentHandler(handler); h.setTransformer(this); m_serializationHandler = h; } else m_serializationHandler.setContentHandler(handler); } }
[ "public", "void", "setContentHandler", "(", "ContentHandler", "handler", ")", "{", "if", "(", "handler", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "XSLMessages", ".", "createMessage", "(", "XSLTErrorResources", ".", "ER_NULL_CONTENT_HANDLE...
Set the content event handler. NEEDSDOC @param handler @throws java.lang.NullPointerException If the handler is null. @see org.xml.sax.XMLReader#setContentHandler
[ "Set", "the", "content", "event", "handler", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1703-L1725
33,383
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.transformToGlobalRTF
public int transformToGlobalRTF(ElemTemplateElement templateParent) throws TransformerException { // Retrieve a DTM to contain the RTF. At this writing, this may be a // multi-document DTM (SAX2RTFDTM). DTM dtmFrag = m_xcontext.getGlobalRTFDTM(); return transformToRTF(templateParent,dtmFrag); }
java
public int transformToGlobalRTF(ElemTemplateElement templateParent) throws TransformerException { // Retrieve a DTM to contain the RTF. At this writing, this may be a // multi-document DTM (SAX2RTFDTM). DTM dtmFrag = m_xcontext.getGlobalRTFDTM(); return transformToRTF(templateParent,dtmFrag); }
[ "public", "int", "transformToGlobalRTF", "(", "ElemTemplateElement", "templateParent", ")", "throws", "TransformerException", "{", "// Retrieve a DTM to contain the RTF. At this writing, this may be a", "// multi-document DTM (SAX2RTFDTM).", "DTM", "dtmFrag", "=", "m_xcontext", ".", ...
Given a stylesheet element, create a result tree fragment from it's contents. The fragment will also use the shared DTM system, but will obtain its space from the global variable pool rather than the dynamic variable stack. This allows late binding of XUnresolvedVariables without the risk that their content will be discarded when the variable stack is popped. @param templateParent The template element that holds the fragment. @return the NodeHandle for the root node of the resulting RTF. @throws TransformerException @xsl.usage advanced
[ "Given", "a", "stylesheet", "element", "create", "a", "result", "tree", "fragment", "from", "it", "s", "contents", ".", "The", "fragment", "will", "also", "use", "the", "shared", "DTM", "system", "but", "will", "obtain", "its", "space", "from", "the", "glo...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1771-L1778
33,384
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.transformToString
public String transformToString(ElemTemplateElement elem) throws TransformerException { ElemTemplateElement firstChild = elem.getFirstChildElem(); if(null == firstChild) return ""; if(elem.hasTextLitOnly() && m_optimizer) { return ((ElemTextLiteral)firstChild).getNodeValue(); } // Save the current result tree handler. SerializationHandler savedRTreeHandler = this.m_serializationHandler; // Create a Serializer object that will handle the SAX events // and build the ResultTreeFrag nodes. StringWriter sw = (StringWriter) m_stringWriterObjectPool.getInstance(); m_serializationHandler = (ToTextStream) m_textResultHandlerObjectPool.getInstance(); if (null == m_serializationHandler) { // if we didn't get one from the pool, go make a new one Serializer serializer = org.apache.xml.serializer.SerializerFactory.getSerializer( m_textformat.getProperties()); m_serializationHandler = (SerializationHandler) serializer; } m_serializationHandler.setTransformer(this); m_serializationHandler.setWriter(sw); String result; try { /* Don't call startDocument, the SerializationHandler will * generate its own internal startDocument call anyways */ // this.m_serializationHandler.startDocument(); // Do the transformation of the child elements. executeChildTemplates(elem, true); this.m_serializationHandler.endDocument(); result = sw.toString(); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { sw.getBuffer().setLength(0); try { sw.close(); } catch (Exception ioe){} m_stringWriterObjectPool.freeInstance(sw); m_serializationHandler.reset(); m_textResultHandlerObjectPool.freeInstance(m_serializationHandler); // Restore the previous result tree handler. m_serializationHandler = savedRTreeHandler; } return result; }
java
public String transformToString(ElemTemplateElement elem) throws TransformerException { ElemTemplateElement firstChild = elem.getFirstChildElem(); if(null == firstChild) return ""; if(elem.hasTextLitOnly() && m_optimizer) { return ((ElemTextLiteral)firstChild).getNodeValue(); } // Save the current result tree handler. SerializationHandler savedRTreeHandler = this.m_serializationHandler; // Create a Serializer object that will handle the SAX events // and build the ResultTreeFrag nodes. StringWriter sw = (StringWriter) m_stringWriterObjectPool.getInstance(); m_serializationHandler = (ToTextStream) m_textResultHandlerObjectPool.getInstance(); if (null == m_serializationHandler) { // if we didn't get one from the pool, go make a new one Serializer serializer = org.apache.xml.serializer.SerializerFactory.getSerializer( m_textformat.getProperties()); m_serializationHandler = (SerializationHandler) serializer; } m_serializationHandler.setTransformer(this); m_serializationHandler.setWriter(sw); String result; try { /* Don't call startDocument, the SerializationHandler will * generate its own internal startDocument call anyways */ // this.m_serializationHandler.startDocument(); // Do the transformation of the child elements. executeChildTemplates(elem, true); this.m_serializationHandler.endDocument(); result = sw.toString(); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { sw.getBuffer().setLength(0); try { sw.close(); } catch (Exception ioe){} m_stringWriterObjectPool.freeInstance(sw); m_serializationHandler.reset(); m_textResultHandlerObjectPool.freeInstance(m_serializationHandler); // Restore the previous result tree handler. m_serializationHandler = savedRTreeHandler; } return result; }
[ "public", "String", "transformToString", "(", "ElemTemplateElement", "elem", ")", "throws", "TransformerException", "{", "ElemTemplateElement", "firstChild", "=", "elem", ".", "getFirstChildElem", "(", ")", ";", "if", "(", "null", "==", "firstChild", ")", "return", ...
Take the contents of a template element, process it, and convert it to a string. @param elem The parent element whose children will be output as a string. @return The stringized result of executing the elements children. @throws TransformerException @xsl.usage advanced
[ "Take", "the", "contents", "of", "a", "template", "element", "process", "it", "and", "convert", "it", "to", "a", "string", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1874-L1947
33,385
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.executeChildTemplates
public void executeChildTemplates( ElemTemplateElement elem, org.w3c.dom.Node context, QName mode, ContentHandler handler) throws TransformerException { XPathContext xctxt = m_xcontext; try { if(null != mode) pushMode(mode); xctxt.pushCurrentNode(xctxt.getDTMHandleFromNode(context)); executeChildTemplates(elem, handler); } finally { xctxt.popCurrentNode(); // I'm not sure where or why this was here. It is clearly in // error though, without a corresponding pushMode(). if (null != mode) popMode(); } }
java
public void executeChildTemplates( ElemTemplateElement elem, org.w3c.dom.Node context, QName mode, ContentHandler handler) throws TransformerException { XPathContext xctxt = m_xcontext; try { if(null != mode) pushMode(mode); xctxt.pushCurrentNode(xctxt.getDTMHandleFromNode(context)); executeChildTemplates(elem, handler); } finally { xctxt.popCurrentNode(); // I'm not sure where or why this was here. It is clearly in // error though, without a corresponding pushMode(). if (null != mode) popMode(); } }
[ "public", "void", "executeChildTemplates", "(", "ElemTemplateElement", "elem", ",", "org", ".", "w3c", ".", "dom", ".", "Node", "context", ",", "QName", "mode", ",", "ContentHandler", "handler", ")", "throws", "TransformerException", "{", "XPathContext", "xctxt", ...
Execute each of the children of a template element. This method is only for extension use. @param elem The ElemTemplateElement that contains the children that should execute. NEEDSDOC @param context @param mode The current mode. @param handler The ContentHandler to where the result events should be fed. @throws TransformerException @xsl.usage advanced
[ "Execute", "each", "of", "the", "children", "of", "a", "template", "element", ".", "This", "method", "is", "only", "for", "extension", "use", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L2136-L2159
33,386
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.isRecursiveAttrSet
public boolean isRecursiveAttrSet(ElemAttributeSet attrSet) { if (null == m_attrSetStack) { m_attrSetStack = new Stack(); } if (!m_attrSetStack.empty()) { int loc = m_attrSetStack.search(attrSet); if (loc > -1) { return true; } } return false; }
java
public boolean isRecursiveAttrSet(ElemAttributeSet attrSet) { if (null == m_attrSetStack) { m_attrSetStack = new Stack(); } if (!m_attrSetStack.empty()) { int loc = m_attrSetStack.search(attrSet); if (loc > -1) { return true; } } return false; }
[ "public", "boolean", "isRecursiveAttrSet", "(", "ElemAttributeSet", "attrSet", ")", "{", "if", "(", "null", "==", "m_attrSetStack", ")", "{", "m_attrSetStack", "=", "new", "Stack", "(", ")", ";", "}", "if", "(", "!", "m_attrSetStack", ".", "empty", "(", ")...
Check to see if this is a recursive attribute definition. @param attrSet A non-null ElemAttributeSet reference. @return true if the attribute set is recursive.
[ "Check", "to", "see", "if", "this", "is", "a", "recursive", "attribute", "definition", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L2679-L2698
33,387
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.setErrorListener
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { synchronized (m_reentryGuard) { if (listener == null) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler"); m_errorHandler = listener; } }
java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { synchronized (m_reentryGuard) { if (listener == null) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler"); m_errorHandler = listener; } }
[ "public", "void", "setErrorListener", "(", "ErrorListener", "listener", ")", "throws", "IllegalArgumentException", "{", "synchronized", "(", "m_reentryGuard", ")", "{", "if", "(", "listener", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "XSLMe...
Set the error event listener. @param listener The new error listener. @throws IllegalArgumentException if
[ "Set", "the", "error", "event", "listener", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L2819-L2830
33,388
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.waitTransformThread
public void waitTransformThread() throws SAXException { // This is called to make sure the task is done. // It is possible that the thread has been reused - // but for a different transformation. ( what if we // recycle the transformer ? Not a problem since this is // still in use. ) Thread transformThread = this.getTransformThread(); if (null != transformThread) { try { ThreadControllerWrapper.waitThread(transformThread, this); if (!this.hasTransformThreadErrorCatcher()) { Exception e = this.getExceptionThrown(); if (null != e) { e.printStackTrace(); throw new org.xml.sax.SAXException(e); } } this.setTransformThread(null); } catch (InterruptedException ie){} } }
java
public void waitTransformThread() throws SAXException { // This is called to make sure the task is done. // It is possible that the thread has been reused - // but for a different transformation. ( what if we // recycle the transformer ? Not a problem since this is // still in use. ) Thread transformThread = this.getTransformThread(); if (null != transformThread) { try { ThreadControllerWrapper.waitThread(transformThread, this); if (!this.hasTransformThreadErrorCatcher()) { Exception e = this.getExceptionThrown(); if (null != e) { e.printStackTrace(); throw new org.xml.sax.SAXException(e); } } this.setTransformThread(null); } catch (InterruptedException ie){} } }
[ "public", "void", "waitTransformThread", "(", ")", "throws", "SAXException", "{", "// This is called to make sure the task is done.", "// It is possible that the thread has been reused -", "// but for a different transformation. ( what if we ", "// recycle the transformer ? Not a problem since...
Used by SourceTreeHandler to wait until the transform completes @throws SAXException
[ "Used", "by", "SourceTreeHandler", "to", "wait", "until", "the", "transform", "completes" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L2964-L2995
33,389
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.run
public void run() { m_hasBeenReset = false; try { // int n = ((SourceTreeHandler)getInputContentHandler()).getDTMRoot(); // transformNode(n); try { // m_isTransformDone = false; // android-removed // Should no longer be needed... // if(m_inputContentHandler instanceof TransformerHandlerImpl) // { // TransformerHandlerImpl thi = (TransformerHandlerImpl)m_inputContentHandler; // thi.waitForInitialEvents(); // } transformNode(m_doc); } catch (Exception e) { // e.printStackTrace(); // Strange that the other catch won't catch this... if (null != m_transformThread) postExceptionFromThread(e); // Assume we're on the main thread else throw new RuntimeException(e.getMessage()); } finally { // m_isTransformDone = true; // android-removed if (m_inputContentHandler instanceof TransformerHandlerImpl) { ((TransformerHandlerImpl) m_inputContentHandler).clearCoRoutine(); } // synchronized (this) // { // notifyAll(); // } } } catch (Exception e) { // e.printStackTrace(); if (null != m_transformThread) postExceptionFromThread(e); else throw new RuntimeException(e.getMessage()); // Assume we're on the main thread. } }
java
public void run() { m_hasBeenReset = false; try { // int n = ((SourceTreeHandler)getInputContentHandler()).getDTMRoot(); // transformNode(n); try { // m_isTransformDone = false; // android-removed // Should no longer be needed... // if(m_inputContentHandler instanceof TransformerHandlerImpl) // { // TransformerHandlerImpl thi = (TransformerHandlerImpl)m_inputContentHandler; // thi.waitForInitialEvents(); // } transformNode(m_doc); } catch (Exception e) { // e.printStackTrace(); // Strange that the other catch won't catch this... if (null != m_transformThread) postExceptionFromThread(e); // Assume we're on the main thread else throw new RuntimeException(e.getMessage()); } finally { // m_isTransformDone = true; // android-removed if (m_inputContentHandler instanceof TransformerHandlerImpl) { ((TransformerHandlerImpl) m_inputContentHandler).clearCoRoutine(); } // synchronized (this) // { // notifyAll(); // } } } catch (Exception e) { // e.printStackTrace(); if (null != m_transformThread) postExceptionFromThread(e); else throw new RuntimeException(e.getMessage()); // Assume we're on the main thread. } }
[ "public", "void", "run", "(", ")", "{", "m_hasBeenReset", "=", "false", ";", "try", "{", "// int n = ((SourceTreeHandler)getInputContentHandler()).getDTMRoot();", "// transformNode(n);", "try", "{", "// m_isTransformDone = false; // android-removed", "// Should no longer be needed....
Run the transform thread.
[ "Run", "the", "transform", "thread", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L3087-L3145
33,390
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java
TransformerImpl.init
public void init(ToXMLSAXHandler h,Transformer transformer, ContentHandler realHandler) { h.setTransformer(transformer); h.setContentHandler(realHandler); }
java
public void init(ToXMLSAXHandler h,Transformer transformer, ContentHandler realHandler) { h.setTransformer(transformer); h.setContentHandler(realHandler); }
[ "public", "void", "init", "(", "ToXMLSAXHandler", "h", ",", "Transformer", "transformer", ",", "ContentHandler", "realHandler", ")", "{", "h", ".", "setTransformer", "(", "transformer", ")", ";", "h", ".", "setContentHandler", "(", "realHandler", ")", ";", "}"...
Initializer method. @param transformer non-null transformer instance @param realHandler Content Handler instance
[ "Initializer", "method", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L3190-L3194
33,391
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/VTimeZone.java
VTimeZone.write
public void write(Writer writer) throws IOException { BufferedWriter bw = new BufferedWriter(writer); if (vtzlines != null) { for (String line : vtzlines) { if (line.startsWith(ICAL_TZURL + COLON)) { if (tzurl != null) { bw.write(ICAL_TZURL); bw.write(COLON); bw.write(tzurl); bw.write(NEWLINE); } } else if (line.startsWith(ICAL_LASTMOD + COLON)) { if (lastmod != null) { bw.write(ICAL_LASTMOD); bw.write(COLON); bw.write(getUTCDateTimeString(lastmod.getTime())); bw.write(NEWLINE); } } else { bw.write(line); bw.write(NEWLINE); } } bw.flush(); } else { String[] customProperties = null; if (olsonzid != null && ICU_TZVERSION != null) { customProperties = new String[1]; customProperties[0] = ICU_TZINFO_PROP + COLON + olsonzid + "[" + ICU_TZVERSION + "]"; } writeZone(writer, tz, customProperties); } }
java
public void write(Writer writer) throws IOException { BufferedWriter bw = new BufferedWriter(writer); if (vtzlines != null) { for (String line : vtzlines) { if (line.startsWith(ICAL_TZURL + COLON)) { if (tzurl != null) { bw.write(ICAL_TZURL); bw.write(COLON); bw.write(tzurl); bw.write(NEWLINE); } } else if (line.startsWith(ICAL_LASTMOD + COLON)) { if (lastmod != null) { bw.write(ICAL_LASTMOD); bw.write(COLON); bw.write(getUTCDateTimeString(lastmod.getTime())); bw.write(NEWLINE); } } else { bw.write(line); bw.write(NEWLINE); } } bw.flush(); } else { String[] customProperties = null; if (olsonzid != null && ICU_TZVERSION != null) { customProperties = new String[1]; customProperties[0] = ICU_TZINFO_PROP + COLON + olsonzid + "[" + ICU_TZVERSION + "]"; } writeZone(writer, tz, customProperties); } }
[ "public", "void", "write", "(", "Writer", "writer", ")", "throws", "IOException", "{", "BufferedWriter", "bw", "=", "new", "BufferedWriter", "(", "writer", ")", ";", "if", "(", "vtzlines", "!=", "null", ")", "{", "for", "(", "String", "line", ":", "vtzli...
Writes RFC2445 VTIMEZONE data for this time zone @param writer A <code>Writer</code> used for the output @throws IOException If there were problems creating a buffered writer or writing to it.
[ "Writes", "RFC2445", "VTIMEZONE", "data", "for", "this", "time", "zone" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/VTimeZone.java#L215-L247
33,392
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/VTimeZone.java
VTimeZone.write
public void write(Writer writer, long start) throws IOException { // Extract rules applicable to dates after the start time TimeZoneRule[] rules = tz.getTimeZoneRules(start); // Create a RuleBasedTimeZone with the subset rule RuleBasedTimeZone rbtz = new RuleBasedTimeZone(tz.getID(), (InitialTimeZoneRule)rules[0]); for (int i = 1; i < rules.length; i++) { rbtz.addTransitionRule(rules[i]); } String[] customProperties = null; if (olsonzid != null && ICU_TZVERSION != null) { customProperties = new String[1]; customProperties[0] = ICU_TZINFO_PROP + COLON + olsonzid + "[" + ICU_TZVERSION + "/Partial@" + start + "]"; } writeZone(writer, rbtz, customProperties); }
java
public void write(Writer writer, long start) throws IOException { // Extract rules applicable to dates after the start time TimeZoneRule[] rules = tz.getTimeZoneRules(start); // Create a RuleBasedTimeZone with the subset rule RuleBasedTimeZone rbtz = new RuleBasedTimeZone(tz.getID(), (InitialTimeZoneRule)rules[0]); for (int i = 1; i < rules.length; i++) { rbtz.addTransitionRule(rules[i]); } String[] customProperties = null; if (olsonzid != null && ICU_TZVERSION != null) { customProperties = new String[1]; customProperties[0] = ICU_TZINFO_PROP + COLON + olsonzid + "[" + ICU_TZVERSION + "/Partial@" + start + "]"; } writeZone(writer, rbtz, customProperties); }
[ "public", "void", "write", "(", "Writer", "writer", ",", "long", "start", ")", "throws", "IOException", "{", "// Extract rules applicable to dates after the start time", "TimeZoneRule", "[", "]", "rules", "=", "tz", ".", "getTimeZoneRules", "(", "start", ")", ";", ...
Writes RFC2445 VTIMEZONE data applicable for dates after the specified start time. @param writer The <code>Writer</code> used for the output @param start The start time @throws IOException If there were problems reading and writing to the writer.
[ "Writes", "RFC2445", "VTIMEZONE", "data", "applicable", "for", "dates", "after", "the", "specified", "start", "time", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/VTimeZone.java#L258-L274
33,393
google/j2objc
jre_emul/Classes/com/google/j2objc/util/NativeTimeZone.java
NativeTimeZone.getOffset
@Override public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { long calc = (year / 400) * MILLISECONDS_PER_400_YEARS; year %= 400; calc += year * (365 * MILLISECONDS_PER_DAY); calc += ((year + 3) / 4) * MILLISECONDS_PER_DAY; if (year > 0) { calc -= ((year - 1) / 100) * MILLISECONDS_PER_DAY; } boolean isLeap = (year == 0 || (year % 4 == 0 && year % 100 != 0)); int[] mlen = isLeap ? LEAP : NORMAL; calc += mlen[month] * MILLISECONDS_PER_DAY; calc += (day - 1) * MILLISECONDS_PER_DAY; calc += millis; calc -= rawOffset; calc -= UNIX_OFFSET; return getOffset(calc); }
java
@Override public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) { long calc = (year / 400) * MILLISECONDS_PER_400_YEARS; year %= 400; calc += year * (365 * MILLISECONDS_PER_DAY); calc += ((year + 3) / 4) * MILLISECONDS_PER_DAY; if (year > 0) { calc -= ((year - 1) / 100) * MILLISECONDS_PER_DAY; } boolean isLeap = (year == 0 || (year % 4 == 0 && year % 100 != 0)); int[] mlen = isLeap ? LEAP : NORMAL; calc += mlen[month] * MILLISECONDS_PER_DAY; calc += (day - 1) * MILLISECONDS_PER_DAY; calc += millis; calc -= rawOffset; calc -= UNIX_OFFSET; return getOffset(calc); }
[ "@", "Override", "public", "int", "getOffset", "(", "int", "era", ",", "int", "year", ",", "int", "month", ",", "int", "day", ",", "int", "dayOfWeek", ",", "int", "millis", ")", "{", "long", "calc", "=", "(", "year", "/", "400", ")", "*", "MILLISEC...
This implementation is adapted from libcore's ZoneInfo. The method always assumes Gregorian calendar, and uses a simple formula to first derive the instant of the local datetime arguments and then call {@link #getOffset(long)} to get the actual offset. The local datetime used here is always in the non-DST time zone, i.e. the time zone with the "raw" offset, as evidenced by actual JDK implementation and the code below. This means it's possible to call getOffset with a practically non-existent date time, such as 2:30 AM, March 13, 2016, which does not exist in US Pacific Time -- it falls in the DST gap of that day. When we compute the milliseconds for the year component, we need to take leap years into consideration. According to http://aa.usno.navy.mil/faq/docs/calendars.php: "The Gregorian leap year rule is: Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100, but these centurial years are leap years if they are exactly divisible by 400. For example, the years 1700, 1800, and 1900 are not leap years, but the year 2000 is." Hence the rules and constants used here. Since this method only supports Gregorian calendar, the return value of any date before October 4, 1582 is not reliable. In addition, the era and dayOfWeek arguments are not used in this method.
[ "This", "implementation", "is", "adapted", "from", "libcore", "s", "ZoneInfo", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/Classes/com/google/j2objc/util/NativeTimeZone.java#L217-L240
33,394
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/operations/UnaryOperation.java
UnaryOperation.execute
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return operate(m_right.execute(xctxt)); }
java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return operate(m_right.execute(xctxt)); }
[ "public", "XObject", "execute", "(", "XPathContext", "xctxt", ")", "throws", "javax", ".", "xml", ".", "transform", ".", "TransformerException", "{", "return", "operate", "(", "m_right", ".", "execute", "(", "xctxt", ")", ")", ";", "}" ]
Execute the operand and apply the unary operation to the result. @param xctxt The runtime execution context. @return An XObject that represents the result of applying the unary operation to the evaluated operand. @throws javax.xml.transform.TransformerException
[ "Execute", "the", "operand", "and", "apply", "the", "unary", "operation", "to", "the", "result", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/operations/UnaryOperation.java#L94-L98
33,395
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/duration/BasicDurationFormat.java
BasicDurationFormat.formatDuration
public String formatDuration(Object obj) { javax.xml.datatype.DatatypeConstants.Field inFields[] = { javax.xml.datatype.DatatypeConstants.YEARS, javax.xml.datatype.DatatypeConstants.MONTHS, javax.xml.datatype.DatatypeConstants.DAYS, javax.xml.datatype.DatatypeConstants.HOURS, javax.xml.datatype.DatatypeConstants.MINUTES, javax.xml.datatype.DatatypeConstants.SECONDS, }; TimeUnit outFields[] = { TimeUnit.YEAR, TimeUnit.MONTH, TimeUnit.DAY, TimeUnit.HOUR, TimeUnit.MINUTE, TimeUnit.SECOND, }; javax.xml.datatype.Duration inDuration = (javax.xml.datatype.Duration)obj; Period p = null; javax.xml.datatype.Duration duration = inDuration; boolean inPast = false; if(inDuration.getSign()<0) { duration = inDuration.negate(); inPast = true; } // convert a Duration to a Period boolean sawNonZero = false; // did we have a set, non-zero field? for(int i=0;i<inFields.length;i++) { if(duration.isSet(inFields[i])) { Number n = duration.getField(inFields[i]); if(n.intValue() == 0 && !sawNonZero) { continue; // ignore zero fields larger than the largest nonzero field } else { sawNonZero = true; } float floatVal = n.floatValue(); // is there a 'secondary' unit to set? TimeUnit alternateUnit = null; float alternateVal = 0; // see if there is a fractional part if(outFields[i]==TimeUnit.SECOND) { double fullSeconds = floatVal; double intSeconds = Math.floor(floatVal); double millis = (fullSeconds-intSeconds)*1000.0; if(millis > 0.0) { alternateUnit = TimeUnit.MILLISECOND; alternateVal=(float)millis; floatVal=(float)intSeconds; } } if(p == null) { p = Period.at(floatVal, outFields[i]); } else { p = p.and(floatVal, outFields[i]); } if(alternateUnit != null) { p = p.and(alternateVal, alternateUnit); // add in MILLISECONDs } } } if(p == null) { // no fields set = 0 seconds return formatDurationFromNow(0); } else { if(inPast) {// was negated, above. p = p.inPast(); } else { p = p.inFuture(); } } // now, format it. return pformatter.format(p); }
java
public String formatDuration(Object obj) { javax.xml.datatype.DatatypeConstants.Field inFields[] = { javax.xml.datatype.DatatypeConstants.YEARS, javax.xml.datatype.DatatypeConstants.MONTHS, javax.xml.datatype.DatatypeConstants.DAYS, javax.xml.datatype.DatatypeConstants.HOURS, javax.xml.datatype.DatatypeConstants.MINUTES, javax.xml.datatype.DatatypeConstants.SECONDS, }; TimeUnit outFields[] = { TimeUnit.YEAR, TimeUnit.MONTH, TimeUnit.DAY, TimeUnit.HOUR, TimeUnit.MINUTE, TimeUnit.SECOND, }; javax.xml.datatype.Duration inDuration = (javax.xml.datatype.Duration)obj; Period p = null; javax.xml.datatype.Duration duration = inDuration; boolean inPast = false; if(inDuration.getSign()<0) { duration = inDuration.negate(); inPast = true; } // convert a Duration to a Period boolean sawNonZero = false; // did we have a set, non-zero field? for(int i=0;i<inFields.length;i++) { if(duration.isSet(inFields[i])) { Number n = duration.getField(inFields[i]); if(n.intValue() == 0 && !sawNonZero) { continue; // ignore zero fields larger than the largest nonzero field } else { sawNonZero = true; } float floatVal = n.floatValue(); // is there a 'secondary' unit to set? TimeUnit alternateUnit = null; float alternateVal = 0; // see if there is a fractional part if(outFields[i]==TimeUnit.SECOND) { double fullSeconds = floatVal; double intSeconds = Math.floor(floatVal); double millis = (fullSeconds-intSeconds)*1000.0; if(millis > 0.0) { alternateUnit = TimeUnit.MILLISECOND; alternateVal=(float)millis; floatVal=(float)intSeconds; } } if(p == null) { p = Period.at(floatVal, outFields[i]); } else { p = p.and(floatVal, outFields[i]); } if(alternateUnit != null) { p = p.and(alternateVal, alternateUnit); // add in MILLISECONDs } } } if(p == null) { // no fields set = 0 seconds return formatDurationFromNow(0); } else { if(inPast) {// was negated, above. p = p.inPast(); } else { p = p.inFuture(); } } // now, format it. return pformatter.format(p); }
[ "public", "String", "formatDuration", "(", "Object", "obj", ")", "{", "javax", ".", "xml", ".", "datatype", ".", "DatatypeConstants", ".", "Field", "inFields", "[", "]", "=", "{", "javax", ".", "xml", ".", "datatype", ".", "DatatypeConstants", ".", "YEARS"...
JDK 1.5+ only @param obj Object being passed. @return The PeriodFormatter object formatted to the object passed. @see "http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/datatype/Duration.html"
[ "JDK", "1", ".", "5", "+", "only" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/duration/BasicDurationFormat.java#L94-L172
33,396
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java
Calendar.getInstance
public static Calendar getInstance(TimeZone zone, Locale aLocale) { return getInstanceInternal(zone, ULocale.forLocale(aLocale)); }
java
public static Calendar getInstance(TimeZone zone, Locale aLocale) { return getInstanceInternal(zone, ULocale.forLocale(aLocale)); }
[ "public", "static", "Calendar", "getInstance", "(", "TimeZone", "zone", ",", "Locale", "aLocale", ")", "{", "return", "getInstanceInternal", "(", "zone", ",", "ULocale", ".", "forLocale", "(", "aLocale", ")", ")", ";", "}" ]
Returns a calendar with the specified time zone and locale. @param zone the time zone to use @param aLocale the locale for the week data @return a Calendar.
[ "Returns", "a", "calendar", "with", "the", "specified", "time", "zone", "and", "locale", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java#L1667-L1669
33,397
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java
Calendar.set
public final void set(int field, int value) { if (areFieldsVirtuallySet) { computeFields(); } fields[field] = value; /* Ensure that the fNextStamp value doesn't go pass max value for 32 bit integer */ if (nextStamp == STAMP_MAX) { recalculateStamp(); } stamp[field] = nextStamp++; isTimeSet = areFieldsSet = areFieldsVirtuallySet = false; }
java
public final void set(int field, int value) { if (areFieldsVirtuallySet) { computeFields(); } fields[field] = value; /* Ensure that the fNextStamp value doesn't go pass max value for 32 bit integer */ if (nextStamp == STAMP_MAX) { recalculateStamp(); } stamp[field] = nextStamp++; isTimeSet = areFieldsSet = areFieldsVirtuallySet = false; }
[ "public", "final", "void", "set", "(", "int", "field", ",", "int", "value", ")", "{", "if", "(", "areFieldsVirtuallySet", ")", "{", "computeFields", "(", ")", ";", "}", "fields", "[", "field", "]", "=", "value", ";", "/* Ensure that the fNextStamp value does...
Sets the time field with the given value. @param field the given time field. @param value the value to be set for the given time field.
[ "Sets", "the", "time", "field", "with", "the", "given", "value", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java#L1997-L2009
33,398
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java
Calendar.gregoYearFromIslamicStart
private static int gregoYearFromIslamicStart(int year) { // ad hoc conversion, improve under #10752 // rough est for now, ok for grego 1846-2138, // otherwise occasionally wrong (for 3% of years) int cycle, offset, shift = 0; if (year >= 1397) { cycle = (year - 1397) / 67; offset = (year - 1397) % 67; shift = 2*cycle + ((offset >= 33)? 1: 0); } else { cycle = (year - 1396) / 67 - 1; offset = -(year - 1396) % 67; shift = 2*cycle + ((offset <= 33)? 1: 0); } return year + 579 - shift; }
java
private static int gregoYearFromIslamicStart(int year) { // ad hoc conversion, improve under #10752 // rough est for now, ok for grego 1846-2138, // otherwise occasionally wrong (for 3% of years) int cycle, offset, shift = 0; if (year >= 1397) { cycle = (year - 1397) / 67; offset = (year - 1397) % 67; shift = 2*cycle + ((offset >= 33)? 1: 0); } else { cycle = (year - 1396) / 67 - 1; offset = -(year - 1396) % 67; shift = 2*cycle + ((offset <= 33)? 1: 0); } return year + 579 - shift; }
[ "private", "static", "int", "gregoYearFromIslamicStart", "(", "int", "year", ")", "{", "// ad hoc conversion, improve under #10752", "// rough est for now, ok for grego 1846-2138,", "// otherwise occasionally wrong (for 3% of years)", "int", "cycle", ",", "offset", ",", "shift", ...
utility function for getRelatedYear
[ "utility", "function", "for", "getRelatedYear" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java#L2078-L2093
33,399
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java
Calendar.firstIslamicStartYearFromGrego
private static int firstIslamicStartYearFromGrego(int year) { // ad hoc conversion, improve under #10752 // rough est for now, ok for grego 1846-2138, // otherwise occasionally wrong (for 3% of years) int cycle, offset, shift = 0; if (year >= 1977) { cycle = (year - 1977) / 65; offset = (year - 1977) % 65; shift = 2*cycle + ((offset >= 32)? 1: 0); } else { cycle = (year - 1976) / 65 - 1; offset = -(year - 1976) % 65; shift = 2*cycle + ((offset <= 32)? 1: 0); } return year - 579 + shift; }
java
private static int firstIslamicStartYearFromGrego(int year) { // ad hoc conversion, improve under #10752 // rough est for now, ok for grego 1846-2138, // otherwise occasionally wrong (for 3% of years) int cycle, offset, shift = 0; if (year >= 1977) { cycle = (year - 1977) / 65; offset = (year - 1977) % 65; shift = 2*cycle + ((offset >= 32)? 1: 0); } else { cycle = (year - 1976) / 65 - 1; offset = -(year - 1976) % 65; shift = 2*cycle + ((offset <= 32)? 1: 0); } return year - 579 + shift; }
[ "private", "static", "int", "firstIslamicStartYearFromGrego", "(", "int", "year", ")", "{", "// ad hoc conversion, improve under #10752", "// rough est for now, ok for grego 1846-2138,", "// otherwise occasionally wrong (for 3% of years)", "int", "cycle", ",", "offset", ",", "shift...
utility function for setRelatedYear
[ "utility", "function", "for", "setRelatedYear" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java#L2154-L2169