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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
35,000 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/ConstraintsChecker.java | ConstraintsChecker.mergeNameConstraints | static NameConstraintsExtension mergeNameConstraints(
X509Certificate currCert, NameConstraintsExtension prevNC)
throws CertPathValidatorException
{
X509CertImpl currCertImpl;
try {
currCertImpl = X509CertImpl.toImpl(currCert);
} catch (CertificateException ce) {
throw new CertPathValidatorException(ce);
}
NameConstraintsExtension newConstraints =
currCertImpl.getNameConstraintsExtension();
if (debug != null) {
debug.println("prevNC = " + prevNC +
", newNC = " + String.valueOf(newConstraints));
}
// if there are no previous name constraints, we just return the
// new name constraints.
if (prevNC == null) {
if (debug != null) {
debug.println("mergedNC = " + String.valueOf(newConstraints));
}
if (newConstraints == null) {
return newConstraints;
} else {
// Make sure we do a clone here, because we're probably
// going to modify this object later and we don't want to
// be sharing it with a Certificate object!
return (NameConstraintsExtension)newConstraints.clone();
}
} else {
try {
// after merge, prevNC should contain the merged constraints
prevNC.merge(newConstraints);
} catch (IOException ioe) {
throw new CertPathValidatorException(ioe);
}
if (debug != null) {
debug.println("mergedNC = " + prevNC);
}
return prevNC;
}
} | java | static NameConstraintsExtension mergeNameConstraints(
X509Certificate currCert, NameConstraintsExtension prevNC)
throws CertPathValidatorException
{
X509CertImpl currCertImpl;
try {
currCertImpl = X509CertImpl.toImpl(currCert);
} catch (CertificateException ce) {
throw new CertPathValidatorException(ce);
}
NameConstraintsExtension newConstraints =
currCertImpl.getNameConstraintsExtension();
if (debug != null) {
debug.println("prevNC = " + prevNC +
", newNC = " + String.valueOf(newConstraints));
}
// if there are no previous name constraints, we just return the
// new name constraints.
if (prevNC == null) {
if (debug != null) {
debug.println("mergedNC = " + String.valueOf(newConstraints));
}
if (newConstraints == null) {
return newConstraints;
} else {
// Make sure we do a clone here, because we're probably
// going to modify this object later and we don't want to
// be sharing it with a Certificate object!
return (NameConstraintsExtension)newConstraints.clone();
}
} else {
try {
// after merge, prevNC should contain the merged constraints
prevNC.merge(newConstraints);
} catch (IOException ioe) {
throw new CertPathValidatorException(ioe);
}
if (debug != null) {
debug.println("mergedNC = " + prevNC);
}
return prevNC;
}
} | [
"static",
"NameConstraintsExtension",
"mergeNameConstraints",
"(",
"X509Certificate",
"currCert",
",",
"NameConstraintsExtension",
"prevNC",
")",
"throws",
"CertPathValidatorException",
"{",
"X509CertImpl",
"currCertImpl",
";",
"try",
"{",
"currCertImpl",
"=",
"X509CertImpl",... | Helper to fold sets of name constraints together | [
"Helper",
"to",
"fold",
"sets",
"of",
"name",
"constraints",
"together"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/ConstraintsChecker.java#L172-L217 |
35,001 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/ConstraintsChecker.java | ConstraintsChecker.checkBasicConstraints | private void checkBasicConstraints(X509Certificate currCert)
throws CertPathValidatorException
{
String msg = "basic constraints";
if (debug != null) {
debug.println("---checking " + msg + "...");
debug.println("i = " + i +
", maxPathLength = " + maxPathLength);
}
/* check if intermediate cert */
if (i < certPathLength) {
// RFC5280: If certificate i is a version 3 certificate, verify
// that the basicConstraints extension is present and that cA is
// set to TRUE. (If certificate i is a version 1 or version 2
// certificate, then the application MUST either verify that
// certificate i is a CA certificate through out-of-band means
// or reject the certificate. Conforming implementations may
// choose to reject all version 1 and version 2 intermediate
// certificates.)
//
// We choose to reject all version 1 and version 2 intermediate
// certificates except that it is self issued by the trust
// anchor in order to support key rollover or changes in
// certificate policies.
int pathLenConstraint = -1;
if (currCert.getVersion() < 3) { // version 1 or version 2
if (i == 1) { // issued by a trust anchor
if (X509CertImpl.isSelfIssued(currCert)) {
pathLenConstraint = Integer.MAX_VALUE;
}
}
} else {
pathLenConstraint = currCert.getBasicConstraints();
}
if (pathLenConstraint == -1) {
throw new CertPathValidatorException
(msg + " check failed: this is not a CA certificate",
null, null, -1, PKIXReason.NOT_CA_CERT);
}
if (!X509CertImpl.isSelfIssued(currCert)) {
if (maxPathLength <= 0) {
throw new CertPathValidatorException
(msg + " check failed: pathLenConstraint violated - "
+ "this cert must be the last cert in the "
+ "certification path", null, null, -1,
PKIXReason.PATH_TOO_LONG);
}
maxPathLength--;
}
if (pathLenConstraint < maxPathLength)
maxPathLength = pathLenConstraint;
}
if (debug != null) {
debug.println("after processing, maxPathLength = " + maxPathLength);
debug.println(msg + " verified.");
}
} | java | private void checkBasicConstraints(X509Certificate currCert)
throws CertPathValidatorException
{
String msg = "basic constraints";
if (debug != null) {
debug.println("---checking " + msg + "...");
debug.println("i = " + i +
", maxPathLength = " + maxPathLength);
}
/* check if intermediate cert */
if (i < certPathLength) {
// RFC5280: If certificate i is a version 3 certificate, verify
// that the basicConstraints extension is present and that cA is
// set to TRUE. (If certificate i is a version 1 or version 2
// certificate, then the application MUST either verify that
// certificate i is a CA certificate through out-of-band means
// or reject the certificate. Conforming implementations may
// choose to reject all version 1 and version 2 intermediate
// certificates.)
//
// We choose to reject all version 1 and version 2 intermediate
// certificates except that it is self issued by the trust
// anchor in order to support key rollover or changes in
// certificate policies.
int pathLenConstraint = -1;
if (currCert.getVersion() < 3) { // version 1 or version 2
if (i == 1) { // issued by a trust anchor
if (X509CertImpl.isSelfIssued(currCert)) {
pathLenConstraint = Integer.MAX_VALUE;
}
}
} else {
pathLenConstraint = currCert.getBasicConstraints();
}
if (pathLenConstraint == -1) {
throw new CertPathValidatorException
(msg + " check failed: this is not a CA certificate",
null, null, -1, PKIXReason.NOT_CA_CERT);
}
if (!X509CertImpl.isSelfIssued(currCert)) {
if (maxPathLength <= 0) {
throw new CertPathValidatorException
(msg + " check failed: pathLenConstraint violated - "
+ "this cert must be the last cert in the "
+ "certification path", null, null, -1,
PKIXReason.PATH_TOO_LONG);
}
maxPathLength--;
}
if (pathLenConstraint < maxPathLength)
maxPathLength = pathLenConstraint;
}
if (debug != null) {
debug.println("after processing, maxPathLength = " + maxPathLength);
debug.println(msg + " verified.");
}
} | [
"private",
"void",
"checkBasicConstraints",
"(",
"X509Certificate",
"currCert",
")",
"throws",
"CertPathValidatorException",
"{",
"String",
"msg",
"=",
"\"basic constraints\"",
";",
"if",
"(",
"debug",
"!=",
"null",
")",
"{",
"debug",
".",
"println",
"(",
"\"---ch... | Internal method to check that a given cert meets basic constraints. | [
"Internal",
"method",
"to",
"check",
"that",
"a",
"given",
"cert",
"meets",
"basic",
"constraints",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/ConstraintsChecker.java#L222-L282 |
35,002 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/ConstraintsChecker.java | ConstraintsChecker.mergeBasicConstraints | static int mergeBasicConstraints(X509Certificate cert, int maxPathLength) {
int pathLenConstraint = cert.getBasicConstraints();
if (!X509CertImpl.isSelfIssued(cert)) {
maxPathLength--;
}
if (pathLenConstraint < maxPathLength) {
maxPathLength = pathLenConstraint;
}
return maxPathLength;
} | java | static int mergeBasicConstraints(X509Certificate cert, int maxPathLength) {
int pathLenConstraint = cert.getBasicConstraints();
if (!X509CertImpl.isSelfIssued(cert)) {
maxPathLength--;
}
if (pathLenConstraint < maxPathLength) {
maxPathLength = pathLenConstraint;
}
return maxPathLength;
} | [
"static",
"int",
"mergeBasicConstraints",
"(",
"X509Certificate",
"cert",
",",
"int",
"maxPathLength",
")",
"{",
"int",
"pathLenConstraint",
"=",
"cert",
".",
"getBasicConstraints",
"(",
")",
";",
"if",
"(",
"!",
"X509CertImpl",
".",
"isSelfIssued",
"(",
"cert",... | Merges the specified maxPathLength with the pathLenConstraint
obtained from the certificate.
@param cert the <code>X509Certificate</code>
@param maxPathLength the previous maximum path length
@return the new maximum path length constraint (-1 means no more
certificates can follow, Integer.MAX_VALUE means path length is
unconstrained) | [
"Merges",
"the",
"specified",
"maxPathLength",
"with",
"the",
"pathLenConstraint",
"obtained",
"from",
"the",
"certificate",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/ConstraintsChecker.java#L294-L307 |
35,003 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java | CoroutineManager.co_entry_pause | public synchronized Object co_entry_pause(int thisCoroutine) throws java.lang.NoSuchMethodException
{
if(!m_activeIDs.get(thisCoroutine))
throw new java.lang.NoSuchMethodException();
while(m_nextCoroutine != thisCoroutine)
{
try
{
wait();
}
catch(java.lang.InterruptedException e)
{
// %TBD% -- Declare? Encapsulate? Ignore? Or
// dance widdershins about the instruction cache?
}
}
return m_yield;
} | java | public synchronized Object co_entry_pause(int thisCoroutine) throws java.lang.NoSuchMethodException
{
if(!m_activeIDs.get(thisCoroutine))
throw new java.lang.NoSuchMethodException();
while(m_nextCoroutine != thisCoroutine)
{
try
{
wait();
}
catch(java.lang.InterruptedException e)
{
// %TBD% -- Declare? Encapsulate? Ignore? Or
// dance widdershins about the instruction cache?
}
}
return m_yield;
} | [
"public",
"synchronized",
"Object",
"co_entry_pause",
"(",
"int",
"thisCoroutine",
")",
"throws",
"java",
".",
"lang",
".",
"NoSuchMethodException",
"{",
"if",
"(",
"!",
"m_activeIDs",
".",
"get",
"(",
"thisCoroutine",
")",
")",
"throw",
"new",
"java",
".",
... | In the standard coroutine architecture, coroutines are
identified by their method names and are launched and run up to
their first yield by simply resuming them; its's presumed that
this recognizes the not-already-running case and does the right
thing. We seem to need a way to achieve that same threadsafe
run-up... eg, start the coroutine with a wait.
%TBD% whether this makes any sense...
@param thisCoroutine the identifier of this coroutine, so we can
recognize when we are being resumed.
@exception java.lang.NoSuchMethodException if thisCoroutine isn't
a registered member of this group. %REVIEW% whether this is the
best choice. | [
"In",
"the",
"standard",
"coroutine",
"architecture",
"coroutines",
"are",
"identified",
"by",
"their",
"method",
"names",
"and",
"are",
"launched",
"and",
"run",
"up",
"to",
"their",
"first",
"yield",
"by",
"simply",
"resuming",
"them",
";",
"its",
"s",
"pr... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java#L226-L245 |
35,004 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java | CoroutineManager.co_resume | public synchronized Object co_resume(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException
{
if(!m_activeIDs.get(toCoroutine))
throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine);
// We expect these values to be overwritten during the notify()/wait()
// periods, as other coroutines in this set get their opportunity to run.
m_yield=arg_object;
m_nextCoroutine=toCoroutine;
notify();
while(m_nextCoroutine != thisCoroutine || m_nextCoroutine==ANYBODY || m_nextCoroutine==NOBODY)
{
try
{
// System.out.println("waiting...");
wait();
}
catch(java.lang.InterruptedException e)
{
// %TBD% -- Declare? Encapsulate? Ignore? Or
// dance deasil about the program counter?
}
}
if(m_nextCoroutine==NOBODY)
{
// Pass it along
co_exit(thisCoroutine);
// And inform this coroutine that its partners are Going Away
// %REVIEW% Should this throw/return something more useful?
throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_CO_EXIT, null)); //"CoroutineManager recieved co_exit() request");
}
return m_yield;
} | java | public synchronized Object co_resume(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException
{
if(!m_activeIDs.get(toCoroutine))
throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine);
// We expect these values to be overwritten during the notify()/wait()
// periods, as other coroutines in this set get their opportunity to run.
m_yield=arg_object;
m_nextCoroutine=toCoroutine;
notify();
while(m_nextCoroutine != thisCoroutine || m_nextCoroutine==ANYBODY || m_nextCoroutine==NOBODY)
{
try
{
// System.out.println("waiting...");
wait();
}
catch(java.lang.InterruptedException e)
{
// %TBD% -- Declare? Encapsulate? Ignore? Or
// dance deasil about the program counter?
}
}
if(m_nextCoroutine==NOBODY)
{
// Pass it along
co_exit(thisCoroutine);
// And inform this coroutine that its partners are Going Away
// %REVIEW% Should this throw/return something more useful?
throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_CO_EXIT, null)); //"CoroutineManager recieved co_exit() request");
}
return m_yield;
} | [
"public",
"synchronized",
"Object",
"co_resume",
"(",
"Object",
"arg_object",
",",
"int",
"thisCoroutine",
",",
"int",
"toCoroutine",
")",
"throws",
"java",
".",
"lang",
".",
"NoSuchMethodException",
"{",
"if",
"(",
"!",
"m_activeIDs",
".",
"get",
"(",
"toCoro... | Transfer control to another coroutine which has already been started and
is waiting on this CoroutineManager. We won't return from this call
until that routine has relinquished control.
%TBD% What should we do if toCoroutine isn't registered? Exception?
@param arg_object A value to be passed to the other coroutine.
@param thisCoroutine Integer identifier for this coroutine. This is the
ID we watch for to see if we're the ones being resumed.
@param toCoroutine Integer identifier for the coroutine we wish to
invoke.
@exception java.lang.NoSuchMethodException if toCoroutine isn't a
registered member of this group. %REVIEW% whether this is the best choice. | [
"Transfer",
"control",
"to",
"another",
"coroutine",
"which",
"has",
"already",
"been",
"started",
"and",
"is",
"waiting",
"on",
"this",
"CoroutineManager",
".",
"We",
"won",
"t",
"return",
"from",
"this",
"call",
"until",
"that",
"routine",
"has",
"relinquish... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java#L261-L296 |
35,005 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java | CoroutineManager.co_exit_to | public synchronized void co_exit_to(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException
{
if(!m_activeIDs.get(toCoroutine))
throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine);
// We expect these values to be overwritten during the notify()/wait()
// periods, as other coroutines in this set get their opportunity to run.
m_yield=arg_object;
m_nextCoroutine=toCoroutine;
m_activeIDs.clear(thisCoroutine);
notify();
} | java | public synchronized void co_exit_to(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException
{
if(!m_activeIDs.get(toCoroutine))
throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine);
// We expect these values to be overwritten during the notify()/wait()
// periods, as other coroutines in this set get their opportunity to run.
m_yield=arg_object;
m_nextCoroutine=toCoroutine;
m_activeIDs.clear(thisCoroutine);
notify();
} | [
"public",
"synchronized",
"void",
"co_exit_to",
"(",
"Object",
"arg_object",
",",
"int",
"thisCoroutine",
",",
"int",
"toCoroutine",
")",
"throws",
"java",
".",
"lang",
".",
"NoSuchMethodException",
"{",
"if",
"(",
"!",
"m_activeIDs",
".",
"get",
"(",
"toCorou... | Make the ID available for reuse and terminate this coroutine,
transferring control to the specified coroutine. Note that this
returns immediately rather than waiting for any further coroutine
traffic, so the thread can proceed with other shutdown activities.
@param arg_object A value to be passed to the other coroutine.
@param thisCoroutine Integer identifier for the coroutine leaving the set.
@param toCoroutine Integer identifier for the coroutine we wish to
invoke.
@exception java.lang.NoSuchMethodException if toCoroutine isn't a
registered member of this group. %REVIEW% whether this is the best choice. | [
"Make",
"the",
"ID",
"available",
"for",
"reuse",
"and",
"terminate",
"this",
"coroutine",
"transferring",
"control",
"to",
"the",
"specified",
"coroutine",
".",
"Note",
"that",
"this",
"returns",
"immediately",
"rather",
"than",
"waiting",
"for",
"any",
"furthe... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java#L330-L343 |
35,006 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ConcurrentLinkedQueue.java | ConcurrentLinkedQueue.newNode | static <E> Node<E> newNode(E item) {
Node<E> node = new Node<E>();
U.putObject(node, ITEM, item);
return node;
} | java | static <E> Node<E> newNode(E item) {
Node<E> node = new Node<E>();
U.putObject(node, ITEM, item);
return node;
} | [
"static",
"<",
"E",
">",
"Node",
"<",
"E",
">",
"newNode",
"(",
"E",
"item",
")",
"{",
"Node",
"<",
"E",
">",
"node",
"=",
"new",
"Node",
"<",
"E",
">",
"(",
")",
";",
"U",
".",
"putObject",
"(",
"node",
",",
"ITEM",
",",
"item",
")",
";",
... | Returns a new node holding item. Uses relaxed write because item
can only be seen after piggy-backing publication via casNext. | [
"Returns",
"a",
"new",
"node",
"holding",
"item",
".",
"Uses",
"relaxed",
"write",
"because",
"item",
"can",
"only",
"be",
"seen",
"after",
"piggy",
"-",
"backing",
"publication",
"via",
"casNext",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ConcurrentLinkedQueue.java#L190-L194 |
35,007 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/regex/Pattern.java | Pattern.split | public String[] split(CharSequence input, int limit) {
String[] fast = fastSplit(pattern, input.toString(), limit);
if (fast != null) {
return fast;
}
int index = 0;
boolean matchLimited = limit > 0;
ArrayList<String> matchList = new ArrayList<>();
Matcher m = matcher(input);
// Add segments before each match found
while(m.find()) {
if (!matchLimited || matchList.size() < limit - 1) {
String match = input.subSequence(index, m.start()).toString();
matchList.add(match);
index = m.end();
} else if (matchList.size() == limit - 1) { // last one
String match = input.subSequence(index,
input.length()).toString();
matchList.add(match);
index = m.end();
}
}
// If no match was found, return this
if (index == 0)
return new String[] {input.toString()};
// Add remaining segment
if (!matchLimited || matchList.size() < limit)
matchList.add(input.subSequence(index, input.length()).toString());
// Construct result
int resultSize = matchList.size();
if (limit == 0)
while (resultSize > 0 && matchList.get(resultSize-1).equals(""))
resultSize--;
String[] result = new String[resultSize];
return matchList.subList(0, resultSize).toArray(result);
} | java | public String[] split(CharSequence input, int limit) {
String[] fast = fastSplit(pattern, input.toString(), limit);
if (fast != null) {
return fast;
}
int index = 0;
boolean matchLimited = limit > 0;
ArrayList<String> matchList = new ArrayList<>();
Matcher m = matcher(input);
// Add segments before each match found
while(m.find()) {
if (!matchLimited || matchList.size() < limit - 1) {
String match = input.subSequence(index, m.start()).toString();
matchList.add(match);
index = m.end();
} else if (matchList.size() == limit - 1) { // last one
String match = input.subSequence(index,
input.length()).toString();
matchList.add(match);
index = m.end();
}
}
// If no match was found, return this
if (index == 0)
return new String[] {input.toString()};
// Add remaining segment
if (!matchLimited || matchList.size() < limit)
matchList.add(input.subSequence(index, input.length()).toString());
// Construct result
int resultSize = matchList.size();
if (limit == 0)
while (resultSize > 0 && matchList.get(resultSize-1).equals(""))
resultSize--;
String[] result = new String[resultSize];
return matchList.subList(0, resultSize).toArray(result);
} | [
"public",
"String",
"[",
"]",
"split",
"(",
"CharSequence",
"input",
",",
"int",
"limit",
")",
"{",
"String",
"[",
"]",
"fast",
"=",
"fastSplit",
"(",
"pattern",
",",
"input",
".",
"toString",
"(",
")",
",",
"limit",
")",
";",
"if",
"(",
"fast",
"!... | Splits the given input sequence around matches of this pattern.
<p> The array returned by this method contains each substring of the
input sequence that is terminated by another subsequence that matches
this pattern or is terminated by the end of the input sequence. The
substrings in the array are in the order in which they occur in the
input. If this pattern does not match any subsequence of the input then
the resulting array has just one element, namely the input sequence in
string form.
<p> The <tt>limit</tt> parameter controls the number of times the
pattern is applied and therefore affects the length of the resulting
array. If the limit <i>n</i> is greater than zero then the pattern
will be applied at most <i>n</i> - 1 times, the array's
length will be no greater than <i>n</i>, and the array's last entry
will contain all input beyond the last matched delimiter. If <i>n</i>
is non-positive then the pattern will be applied as many times as
possible and the array can have any length. If <i>n</i> is zero then
the pattern will be applied as many times as possible, the array can
have any length, and trailing empty strings will be discarded.
<p> The input <tt>"boo:and:foo"</tt>, for example, yields the following
results with these parameters:
<blockquote><table cellpadding=1 cellspacing=0
summary="Split examples showing regex, limit, and result">
<tr><th><P align="left"><i>Regex </i></th>
<th><P align="left"><i>Limit </i></th>
<th><P align="left"><i>Result </i></th></tr>
<tr><td align=center>:</td>
<td align=center>2</td>
<td><tt>{ "boo", "and:foo" }</tt></td></tr>
<tr><td align=center>:</td>
<td align=center>5</td>
<td><tt>{ "boo", "and", "foo" }</tt></td></tr>
<tr><td align=center>:</td>
<td align=center>-2</td>
<td><tt>{ "boo", "and", "foo" }</tt></td></tr>
<tr><td align=center>o</td>
<td align=center>5</td>
<td><tt>{ "b", "", ":and:f", "", "" }</tt></td></tr>
<tr><td align=center>o</td>
<td align=center>-2</td>
<td><tt>{ "b", "", ":and:f", "", "" }</tt></td></tr>
<tr><td align=center>o</td>
<td align=center>0</td>
<td><tt>{ "b", "", ":and:f" }</tt></td></tr>
</table></blockquote>
@param input
The character sequence to be split
@param limit
The result threshold, as described above
@return The array of strings computed by splitting the input
around matches of this pattern | [
"Splits",
"the",
"given",
"input",
"sequence",
"around",
"matches",
"of",
"this",
"pattern",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/regex/Pattern.java#L1119-L1159 |
35,008 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/regex/Pattern.java | Pattern.readObject | private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
// Read in all fields
s.defaultReadObject();
compile();
} | java | private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
// Read in all fields
s.defaultReadObject();
compile();
} | [
"private",
"void",
"readObject",
"(",
"java",
".",
"io",
".",
"ObjectInputStream",
"s",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
",",
"ClassNotFoundException",
"{",
"// Read in all fields",
"s",
".",
"defaultReadObject",
"(",
")",
";",
"compile",
... | Recompile the Pattern instance from a stream. The original pattern
string is read in and the object tree is recompiled from it. | [
"Recompile",
"the",
"Pattern",
"instance",
"from",
"a",
"stream",
".",
"The",
"original",
"pattern",
"string",
"is",
"read",
"in",
"and",
"the",
"object",
"tree",
"is",
"recompiled",
"from",
"it",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/regex/Pattern.java#L1309-L1315 |
35,009 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/regex/Pattern.java | Pattern.splitAsStream | public Stream<String> splitAsStream(final CharSequence input) {
class MatcherIterator implements Iterator<String> {
private final Matcher matcher;
// The start position of the next sub-sequence of input
// when current == input.length there are no more elements
private int current;
// null if the next element, if any, needs to obtained
private String nextElement;
// > 0 if there are N next empty elements
private int emptyElementCount;
MatcherIterator() {
this.matcher = matcher(input);
}
public String next() {
if (!hasNext())
throw new NoSuchElementException();
if (emptyElementCount == 0) {
String n = nextElement;
nextElement = null;
return n;
} else {
emptyElementCount--;
return "";
}
}
public boolean hasNext() {
if (nextElement != null || emptyElementCount > 0)
return true;
if (current == input.length())
return false;
// Consume the next matching element
// Count sequence of matching empty elements
while (matcher.find()) {
nextElement = input.subSequence(current, matcher.start()).toString();
current = matcher.end();
if (!nextElement.isEmpty()) {
return true;
} else if (current > 0) { // no empty leading substring for zero-width
// match at the beginning of the input
emptyElementCount++;
}
}
// Consume last matching element
nextElement = input.subSequence(current, input.length()).toString();
current = input.length();
if (!nextElement.isEmpty()) {
return true;
} else {
// Ignore a terminal sequence of matching empty elements
emptyElementCount = 0;
nextElement = null;
return false;
}
}
}
return StreamSupport.stream(Spliterators.spliteratorUnknownSize(
new MatcherIterator(), Spliterator.ORDERED | Spliterator.NONNULL), false);
} | java | public Stream<String> splitAsStream(final CharSequence input) {
class MatcherIterator implements Iterator<String> {
private final Matcher matcher;
// The start position of the next sub-sequence of input
// when current == input.length there are no more elements
private int current;
// null if the next element, if any, needs to obtained
private String nextElement;
// > 0 if there are N next empty elements
private int emptyElementCount;
MatcherIterator() {
this.matcher = matcher(input);
}
public String next() {
if (!hasNext())
throw new NoSuchElementException();
if (emptyElementCount == 0) {
String n = nextElement;
nextElement = null;
return n;
} else {
emptyElementCount--;
return "";
}
}
public boolean hasNext() {
if (nextElement != null || emptyElementCount > 0)
return true;
if (current == input.length())
return false;
// Consume the next matching element
// Count sequence of matching empty elements
while (matcher.find()) {
nextElement = input.subSequence(current, matcher.start()).toString();
current = matcher.end();
if (!nextElement.isEmpty()) {
return true;
} else if (current > 0) { // no empty leading substring for zero-width
// match at the beginning of the input
emptyElementCount++;
}
}
// Consume last matching element
nextElement = input.subSequence(current, input.length()).toString();
current = input.length();
if (!nextElement.isEmpty()) {
return true;
} else {
// Ignore a terminal sequence of matching empty elements
emptyElementCount = 0;
nextElement = null;
return false;
}
}
}
return StreamSupport.stream(Spliterators.spliteratorUnknownSize(
new MatcherIterator(), Spliterator.ORDERED | Spliterator.NONNULL), false);
} | [
"public",
"Stream",
"<",
"String",
">",
"splitAsStream",
"(",
"final",
"CharSequence",
"input",
")",
"{",
"class",
"MatcherIterator",
"implements",
"Iterator",
"<",
"String",
">",
"{",
"private",
"final",
"Matcher",
"matcher",
";",
"// The start position of the next... | Creates a stream from the given input sequence around matches of this
pattern.
<p> The stream returned by this method contains each substring of the
input sequence that is terminated by another subsequence that matches
this pattern or is terminated by the end of the input sequence. The
substrings in the stream are in the order in which they occur in the
input. Trailing empty strings will be discarded and not encountered in
the stream.
<p> If this pattern does not match any subsequence of the input then
the resulting stream has just one element, namely the input sequence in
string form.
<p> When there is a positive-width match at the beginning of the input
sequence then an empty leading substring is included at the beginning
of the stream. A zero-width match at the beginning however never produces
such empty leading substring.
<p> If the input sequence is mutable, it must remain constant during the
execution of the terminal stream operation. Otherwise, the result of the
terminal stream operation is undefined.
@param input
The character sequence to be split
@return The stream of strings computed by splitting the input
around matches of this pattern
@see #split(CharSequence)
@since 1.8 | [
"Creates",
"a",
"stream",
"from",
"the",
"given",
"input",
"sequence",
"around",
"matches",
"of",
"this",
"pattern",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/regex/Pattern.java#L1401-L1465 |
35,010 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/FilteredNormalizer2.java | FilteredNormalizer2.normalize | private Appendable normalize(CharSequence src, Appendable dest,
UnicodeSet.SpanCondition spanCondition) {
// Don't throw away destination buffer between iterations.
StringBuilder tempDest=new StringBuilder();
try {
for(int prevSpanLimit=0; prevSpanLimit<src.length();) {
int spanLimit=set.span(src, prevSpanLimit, spanCondition);
int spanLength=spanLimit-prevSpanLimit;
if(spanCondition==UnicodeSet.SpanCondition.NOT_CONTAINED) {
if(spanLength!=0) {
dest.append(src, prevSpanLimit, spanLimit);
}
spanCondition=UnicodeSet.SpanCondition.SIMPLE;
} else {
if(spanLength!=0) {
// Not norm2.normalizeSecondAndAppend() because we do not want
// to modify the non-filter part of dest.
dest.append(norm2.normalize(src.subSequence(prevSpanLimit, spanLimit), tempDest));
}
spanCondition=UnicodeSet.SpanCondition.NOT_CONTAINED;
}
prevSpanLimit=spanLimit;
}
} catch(IOException e) {
throw new ICUUncheckedIOException(e);
}
return dest;
} | java | private Appendable normalize(CharSequence src, Appendable dest,
UnicodeSet.SpanCondition spanCondition) {
// Don't throw away destination buffer between iterations.
StringBuilder tempDest=new StringBuilder();
try {
for(int prevSpanLimit=0; prevSpanLimit<src.length();) {
int spanLimit=set.span(src, prevSpanLimit, spanCondition);
int spanLength=spanLimit-prevSpanLimit;
if(spanCondition==UnicodeSet.SpanCondition.NOT_CONTAINED) {
if(spanLength!=0) {
dest.append(src, prevSpanLimit, spanLimit);
}
spanCondition=UnicodeSet.SpanCondition.SIMPLE;
} else {
if(spanLength!=0) {
// Not norm2.normalizeSecondAndAppend() because we do not want
// to modify the non-filter part of dest.
dest.append(norm2.normalize(src.subSequence(prevSpanLimit, spanLimit), tempDest));
}
spanCondition=UnicodeSet.SpanCondition.NOT_CONTAINED;
}
prevSpanLimit=spanLimit;
}
} catch(IOException e) {
throw new ICUUncheckedIOException(e);
}
return dest;
} | [
"private",
"Appendable",
"normalize",
"(",
"CharSequence",
"src",
",",
"Appendable",
"dest",
",",
"UnicodeSet",
".",
"SpanCondition",
"spanCondition",
")",
"{",
"// Don't throw away destination buffer between iterations.",
"StringBuilder",
"tempDest",
"=",
"new",
"StringBui... | an in-filter prefix. | [
"an",
"in",
"-",
"filter",
"prefix",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/FilteredNormalizer2.java#L214-L241 |
35,011 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java | ZoneMeta.getAvailableIDs | public static Set<String> getAvailableIDs(SystemTimeZoneType type, String region, Integer rawOffset) {
Set<String> baseSet = null;
switch (type) {
case ANY:
baseSet = getSystemZIDs();
break;
case CANONICAL:
baseSet = getCanonicalSystemZIDs();
break;
case CANONICAL_LOCATION:
baseSet = getCanonicalSystemLocationZIDs();
break;
default:
// never occur
throw new IllegalArgumentException("Unknown SystemTimeZoneType");
}
if (region == null && rawOffset == null) {
return baseSet;
}
if (region != null) {
region = region.toUpperCase(Locale.ENGLISH);
}
// Filter by region/rawOffset
Set<String> result = new TreeSet<String>();
for (String id : baseSet) {
if (region != null) {
String r = getRegion(id);
if (!region.equals(r)) {
continue;
}
}
if (rawOffset != null) {
// This is VERY inefficient.
TimeZone z = getSystemTimeZone(id);
if (z == null || !rawOffset.equals(z.getRawOffset())) {
continue;
}
}
result.add(id);
}
if (result.isEmpty()) {
return Collections.emptySet();
}
return Collections.unmodifiableSet(result);
} | java | public static Set<String> getAvailableIDs(SystemTimeZoneType type, String region, Integer rawOffset) {
Set<String> baseSet = null;
switch (type) {
case ANY:
baseSet = getSystemZIDs();
break;
case CANONICAL:
baseSet = getCanonicalSystemZIDs();
break;
case CANONICAL_LOCATION:
baseSet = getCanonicalSystemLocationZIDs();
break;
default:
// never occur
throw new IllegalArgumentException("Unknown SystemTimeZoneType");
}
if (region == null && rawOffset == null) {
return baseSet;
}
if (region != null) {
region = region.toUpperCase(Locale.ENGLISH);
}
// Filter by region/rawOffset
Set<String> result = new TreeSet<String>();
for (String id : baseSet) {
if (region != null) {
String r = getRegion(id);
if (!region.equals(r)) {
continue;
}
}
if (rawOffset != null) {
// This is VERY inefficient.
TimeZone z = getSystemTimeZone(id);
if (z == null || !rawOffset.equals(z.getRawOffset())) {
continue;
}
}
result.add(id);
}
if (result.isEmpty()) {
return Collections.emptySet();
}
return Collections.unmodifiableSet(result);
} | [
"public",
"static",
"Set",
"<",
"String",
">",
"getAvailableIDs",
"(",
"SystemTimeZoneType",
"type",
",",
"String",
"region",
",",
"Integer",
"rawOffset",
")",
"{",
"Set",
"<",
"String",
">",
"baseSet",
"=",
"null",
";",
"switch",
"(",
"type",
")",
"{",
... | Returns an immutable set of system IDs for the given conditions.
@param type a system time zone type.
@param region a region, or null.
@param rawOffset a zone raw offset or null.
@return An immutable set of system IDs for the given conditions. | [
"Returns",
"an",
"immutable",
"set",
"of",
"system",
"IDs",
"for",
"the",
"given",
"conditions",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java#L160-L208 |
35,012 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java | ZoneMeta.countEquivalentIDs | public static synchronized int countEquivalentIDs(String id) {
int count = 0;
UResourceBundle res = openOlsonResource(null, id);
if (res != null) {
try {
UResourceBundle links = res.get("links");
int[] v = links.getIntVector();
count = v.length;
} catch (MissingResourceException ex) {
// throw away
}
}
return count;
} | java | public static synchronized int countEquivalentIDs(String id) {
int count = 0;
UResourceBundle res = openOlsonResource(null, id);
if (res != null) {
try {
UResourceBundle links = res.get("links");
int[] v = links.getIntVector();
count = v.length;
} catch (MissingResourceException ex) {
// throw away
}
}
return count;
} | [
"public",
"static",
"synchronized",
"int",
"countEquivalentIDs",
"(",
"String",
"id",
")",
"{",
"int",
"count",
"=",
"0",
";",
"UResourceBundle",
"res",
"=",
"openOlsonResource",
"(",
"null",
",",
"id",
")",
";",
"if",
"(",
"res",
"!=",
"null",
")",
"{",... | Returns the number of IDs in the equivalency group that
includes the given ID. An equivalency group contains zones
that behave identically to the given zone.
<p>If there are no equivalent zones, then this method returns
0. This means either the given ID is not a valid zone, or it
is and there are no other equivalent zones.
@param id a system time zone ID
@return the number of zones in the equivalency group containing
'id', or zero if there are no equivalent zones.
@see #getEquivalentID | [
"Returns",
"the",
"number",
"of",
"IDs",
"in",
"the",
"equivalency",
"group",
"that",
"includes",
"the",
"given",
"ID",
".",
"An",
"equivalency",
"group",
"contains",
"zones",
"that",
"behave",
"identically",
"to",
"the",
"given",
"zone",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java#L223-L236 |
35,013 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java | ZoneMeta.getEquivalentID | public static synchronized String getEquivalentID(String id, int index) {
String result = "";
if (index >= 0) {
UResourceBundle res = openOlsonResource(null, id);
if (res != null) {
int zoneIdx = -1;
try {
UResourceBundle links = res.get("links");
int[] zones = links.getIntVector();
if (index < zones.length) {
zoneIdx = zones[index];
}
} catch (MissingResourceException ex) {
// throw away
}
if (zoneIdx >= 0) {
String tmp = getZoneID(zoneIdx);
if (tmp != null) {
result = tmp;
}
}
}
}
return result;
} | java | public static synchronized String getEquivalentID(String id, int index) {
String result = "";
if (index >= 0) {
UResourceBundle res = openOlsonResource(null, id);
if (res != null) {
int zoneIdx = -1;
try {
UResourceBundle links = res.get("links");
int[] zones = links.getIntVector();
if (index < zones.length) {
zoneIdx = zones[index];
}
} catch (MissingResourceException ex) {
// throw away
}
if (zoneIdx >= 0) {
String tmp = getZoneID(zoneIdx);
if (tmp != null) {
result = tmp;
}
}
}
}
return result;
} | [
"public",
"static",
"synchronized",
"String",
"getEquivalentID",
"(",
"String",
"id",
",",
"int",
"index",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"if",
"(",
"index",
">=",
"0",
")",
"{",
"UResourceBundle",
"res",
"=",
"openOlsonResource",
"(",
"nu... | Returns an ID in the equivalency group that includes the given
ID. An equivalency group contains zones that behave
identically to the given zone.
<p>The given index must be in the range 0..n-1, where n is the
value returned by <code>countEquivalentIDs(id)</code>. For
some value of 'index', the returned value will be equal to the
given id. If the given id is not a valid system time zone, or
if 'index' is out of range, then returns an empty string.
@param id a system time zone ID
@param index a value from 0 to n-1, where n is the value
returned by <code>countEquivalentIDs(id)</code>
@return the ID of the index-th zone in the equivalency group
containing 'id', or an empty string if 'id' is not a valid
system ID or 'index' is out of range
@see #countEquivalentIDs | [
"Returns",
"an",
"ID",
"in",
"the",
"equivalency",
"group",
"that",
"includes",
"the",
"given",
"ID",
".",
"An",
"equivalency",
"group",
"contains",
"zones",
"that",
"behave",
"identically",
"to",
"the",
"given",
"zone",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java#L256-L280 |
35,014 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java | ZoneMeta.getCanonicalCLDRID | public static String getCanonicalCLDRID(String tzid) {
String canonical = CANONICAL_ID_CACHE.get(tzid);
if (canonical == null) {
canonical = findCLDRCanonicalID(tzid);
if (canonical == null) {
// Resolve Olson link and try it again if necessary
try {
int zoneIdx = getZoneIndex(tzid);
if (zoneIdx >= 0) {
UResourceBundle top = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,
ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
UResourceBundle zones = top.get(kZONES);
UResourceBundle zone = zones.get(zoneIdx);
if (zone.getType() == UResourceBundle.INT) {
// It's a link - resolve link and lookup
tzid = getZoneID(zone.getInt());
canonical = findCLDRCanonicalID(tzid);
}
if (canonical == null) {
canonical = tzid;
}
}
} catch (MissingResourceException e) {
// fall through
}
}
if (canonical != null) {
CANONICAL_ID_CACHE.put(tzid, canonical);
}
}
return canonical;
} | java | public static String getCanonicalCLDRID(String tzid) {
String canonical = CANONICAL_ID_CACHE.get(tzid);
if (canonical == null) {
canonical = findCLDRCanonicalID(tzid);
if (canonical == null) {
// Resolve Olson link and try it again if necessary
try {
int zoneIdx = getZoneIndex(tzid);
if (zoneIdx >= 0) {
UResourceBundle top = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME,
ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
UResourceBundle zones = top.get(kZONES);
UResourceBundle zone = zones.get(zoneIdx);
if (zone.getType() == UResourceBundle.INT) {
// It's a link - resolve link and lookup
tzid = getZoneID(zone.getInt());
canonical = findCLDRCanonicalID(tzid);
}
if (canonical == null) {
canonical = tzid;
}
}
} catch (MissingResourceException e) {
// fall through
}
}
if (canonical != null) {
CANONICAL_ID_CACHE.put(tzid, canonical);
}
}
return canonical;
} | [
"public",
"static",
"String",
"getCanonicalCLDRID",
"(",
"String",
"tzid",
")",
"{",
"String",
"canonical",
"=",
"CANONICAL_ID_CACHE",
".",
"get",
"(",
"tzid",
")",
";",
"if",
"(",
"canonical",
"==",
"null",
")",
"{",
"canonical",
"=",
"findCLDRCanonicalID",
... | Return the canonical id for this tzid defined by CLDR, which might be
the id itself. If the given tzid is not known, return null.
Note: This internal API supports all known system IDs and "Etc/Unknown" (which is
NOT a system ID). | [
"Return",
"the",
"canonical",
"id",
"for",
"this",
"tzid",
"defined",
"by",
"CLDR",
"which",
"might",
"be",
"the",
"id",
"itself",
".",
"If",
"the",
"given",
"tzid",
"is",
"not",
"known",
"return",
"null",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java#L361-L392 |
35,015 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java | ZoneMeta.getRegion | public static String getRegion(String tzid) {
String region = REGION_CACHE.get(tzid);
if (region == null) {
int zoneIdx = getZoneIndex(tzid);
if (zoneIdx >= 0) {
try {
UResourceBundle top = UResourceBundle.getBundleInstance(
ICUData.ICU_BASE_NAME, ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
UResourceBundle regions = top.get(kREGIONS);
if (zoneIdx < regions.getSize()) {
region = regions.getString(zoneIdx);
}
} catch (MissingResourceException e) {
// throw away
}
if (region != null) {
REGION_CACHE.put(tzid, region);
}
}
}
return region;
} | java | public static String getRegion(String tzid) {
String region = REGION_CACHE.get(tzid);
if (region == null) {
int zoneIdx = getZoneIndex(tzid);
if (zoneIdx >= 0) {
try {
UResourceBundle top = UResourceBundle.getBundleInstance(
ICUData.ICU_BASE_NAME, ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
UResourceBundle regions = top.get(kREGIONS);
if (zoneIdx < regions.getSize()) {
region = regions.getString(zoneIdx);
}
} catch (MissingResourceException e) {
// throw away
}
if (region != null) {
REGION_CACHE.put(tzid, region);
}
}
}
return region;
} | [
"public",
"static",
"String",
"getRegion",
"(",
"String",
"tzid",
")",
"{",
"String",
"region",
"=",
"REGION_CACHE",
".",
"get",
"(",
"tzid",
")",
";",
"if",
"(",
"region",
"==",
"null",
")",
"{",
"int",
"zoneIdx",
"=",
"getZoneIndex",
"(",
"tzid",
")"... | Return the region code for this tzid.
If tzid is not a system zone ID, this method returns null. | [
"Return",
"the",
"region",
"code",
"for",
"this",
"tzid",
".",
"If",
"tzid",
"is",
"not",
"a",
"system",
"zone",
"ID",
"this",
"method",
"returns",
"null",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java#L427-L448 |
35,016 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java | ZoneMeta.getCanonicalCountry | public static String getCanonicalCountry(String tzid) {
String country = getRegion(tzid);
if (country != null && country.equals(kWorld)) {
country = null;
}
return country;
} | java | public static String getCanonicalCountry(String tzid) {
String country = getRegion(tzid);
if (country != null && country.equals(kWorld)) {
country = null;
}
return country;
} | [
"public",
"static",
"String",
"getCanonicalCountry",
"(",
"String",
"tzid",
")",
"{",
"String",
"country",
"=",
"getRegion",
"(",
"tzid",
")",
";",
"if",
"(",
"country",
"!=",
"null",
"&&",
"country",
".",
"equals",
"(",
"kWorld",
")",
")",
"{",
"country... | Return the canonical country code for this tzid. If we have none, or if the time zone
is not associated with a country or unknown, return null. | [
"Return",
"the",
"canonical",
"country",
"code",
"for",
"this",
"tzid",
".",
"If",
"we",
"have",
"none",
"or",
"if",
"the",
"time",
"zone",
"is",
"not",
"associated",
"with",
"a",
"country",
"or",
"unknown",
"return",
"null",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java#L454-L460 |
35,017 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java | ZoneMeta.getCanonicalCountry | public static String getCanonicalCountry(String tzid, Output<Boolean> isPrimary) {
isPrimary.value = Boolean.FALSE;
String country = getRegion(tzid);
if (country != null && country.equals(kWorld)) {
return null;
}
// Check the cache
Boolean singleZone = SINGLE_COUNTRY_CACHE.get(tzid);
if (singleZone == null) {
Set<String> ids = TimeZone.getAvailableIDs(SystemTimeZoneType.CANONICAL_LOCATION, country, null);
assert(ids.size() >= 1);
singleZone = Boolean.valueOf(ids.size() <= 1);
SINGLE_COUNTRY_CACHE.put(tzid, singleZone);
}
if (singleZone) {
isPrimary.value = Boolean.TRUE;
} else {
// Note: We may cache the primary zone map in future.
// Even a country has multiple zones, one of them might be
// dominant and treated as a primary zone.
try {
UResourceBundle bundle = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "metaZones");
UResourceBundle primaryZones = bundle.get("primaryZones");
String primaryZone = primaryZones.getString(country);
if (tzid.equals(primaryZone)) {
isPrimary.value = Boolean.TRUE;
} else {
// The given ID might not be a canonical ID
String canonicalID = getCanonicalCLDRID(tzid);
if (canonicalID != null && canonicalID.equals(primaryZone)) {
isPrimary.value = Boolean.TRUE;
}
}
} catch (MissingResourceException e) {
// ignore
}
}
return country;
} | java | public static String getCanonicalCountry(String tzid, Output<Boolean> isPrimary) {
isPrimary.value = Boolean.FALSE;
String country = getRegion(tzid);
if (country != null && country.equals(kWorld)) {
return null;
}
// Check the cache
Boolean singleZone = SINGLE_COUNTRY_CACHE.get(tzid);
if (singleZone == null) {
Set<String> ids = TimeZone.getAvailableIDs(SystemTimeZoneType.CANONICAL_LOCATION, country, null);
assert(ids.size() >= 1);
singleZone = Boolean.valueOf(ids.size() <= 1);
SINGLE_COUNTRY_CACHE.put(tzid, singleZone);
}
if (singleZone) {
isPrimary.value = Boolean.TRUE;
} else {
// Note: We may cache the primary zone map in future.
// Even a country has multiple zones, one of them might be
// dominant and treated as a primary zone.
try {
UResourceBundle bundle = UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, "metaZones");
UResourceBundle primaryZones = bundle.get("primaryZones");
String primaryZone = primaryZones.getString(country);
if (tzid.equals(primaryZone)) {
isPrimary.value = Boolean.TRUE;
} else {
// The given ID might not be a canonical ID
String canonicalID = getCanonicalCLDRID(tzid);
if (canonicalID != null && canonicalID.equals(primaryZone)) {
isPrimary.value = Boolean.TRUE;
}
}
} catch (MissingResourceException e) {
// ignore
}
}
return country;
} | [
"public",
"static",
"String",
"getCanonicalCountry",
"(",
"String",
"tzid",
",",
"Output",
"<",
"Boolean",
">",
"isPrimary",
")",
"{",
"isPrimary",
".",
"value",
"=",
"Boolean",
".",
"FALSE",
";",
"String",
"country",
"=",
"getRegion",
"(",
"tzid",
")",
";... | Return the canonical country code for this tzid. If we have none, or if the time zone
is not associated with a country or unknown, return null. When the given zone is the
primary zone of the country, true is set to isPrimary. | [
"Return",
"the",
"canonical",
"country",
"code",
"for",
"this",
"tzid",
".",
"If",
"we",
"have",
"none",
"or",
"if",
"the",
"time",
"zone",
"is",
"not",
"associated",
"with",
"a",
"country",
"or",
"unknown",
"return",
"null",
".",
"When",
"the",
"given",... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java#L467-L510 |
35,018 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java | ZoneMeta.openOlsonResource | public static UResourceBundle openOlsonResource(UResourceBundle top, String id)
{
UResourceBundle res = null;
int zoneIdx = getZoneIndex(id);
if (zoneIdx >= 0) {
try {
if (top == null) {
top = UResourceBundle.getBundleInstance(
ICUData.ICU_BASE_NAME, ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
}
UResourceBundle zones = top.get(kZONES);
UResourceBundle zone = zones.get(zoneIdx);
if (zone.getType() == UResourceBundle.INT) {
// resolve link
zone = zones.get(zone.getInt());
}
res = zone;
} catch (MissingResourceException e) {
res = null;
}
}
return res;
} | java | public static UResourceBundle openOlsonResource(UResourceBundle top, String id)
{
UResourceBundle res = null;
int zoneIdx = getZoneIndex(id);
if (zoneIdx >= 0) {
try {
if (top == null) {
top = UResourceBundle.getBundleInstance(
ICUData.ICU_BASE_NAME, ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
}
UResourceBundle zones = top.get(kZONES);
UResourceBundle zone = zones.get(zoneIdx);
if (zone.getType() == UResourceBundle.INT) {
// resolve link
zone = zones.get(zone.getInt());
}
res = zone;
} catch (MissingResourceException e) {
res = null;
}
}
return res;
} | [
"public",
"static",
"UResourceBundle",
"openOlsonResource",
"(",
"UResourceBundle",
"top",
",",
"String",
"id",
")",
"{",
"UResourceBundle",
"res",
"=",
"null",
";",
"int",
"zoneIdx",
"=",
"getZoneIndex",
"(",
"id",
")",
";",
"if",
"(",
"zoneIdx",
">=",
"0",... | Given an ID and the top-level resource of the zoneinfo resource,
open the appropriate resource for the given time zone.
Dereference links if necessary.
@param top the top level resource of the zoneinfo resource or null.
@param id zone id
@return the corresponding zone resource or null if not found | [
"Given",
"an",
"ID",
"and",
"the",
"top",
"-",
"level",
"resource",
"of",
"the",
"zoneinfo",
"resource",
"open",
"the",
"appropriate",
"resource",
"for",
"the",
"given",
"time",
"zone",
".",
"Dereference",
"links",
"if",
"necessary",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java#L520-L542 |
35,019 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java | ZoneMeta.getCustomTimeZone | public static SimpleTimeZone getCustomTimeZone(String id){
int[] fields = new int[4];
if (parseCustomID(id, fields)) {
// fields[0] - sign
// fields[1] - hour / 5-bit
// fields[2] - min / 6-bit
// fields[3] - sec / 6-bit
Integer key = Integer.valueOf(
fields[0] * (fields[1] | fields[2] << 5 | fields[3] << 11));
return CUSTOM_ZONE_CACHE.getInstance(key, fields);
}
return null;
} | java | public static SimpleTimeZone getCustomTimeZone(String id){
int[] fields = new int[4];
if (parseCustomID(id, fields)) {
// fields[0] - sign
// fields[1] - hour / 5-bit
// fields[2] - min / 6-bit
// fields[3] - sec / 6-bit
Integer key = Integer.valueOf(
fields[0] * (fields[1] | fields[2] << 5 | fields[3] << 11));
return CUSTOM_ZONE_CACHE.getInstance(key, fields);
}
return null;
} | [
"public",
"static",
"SimpleTimeZone",
"getCustomTimeZone",
"(",
"String",
"id",
")",
"{",
"int",
"[",
"]",
"fields",
"=",
"new",
"int",
"[",
"4",
"]",
";",
"if",
"(",
"parseCustomID",
"(",
"id",
",",
"fields",
")",
")",
"{",
"// fields[0] - sign",
"// fi... | Parse a custom time zone identifier and return a corresponding zone.
@param id a string of the form GMT[+-]hh:mm, GMT[+-]hhmm, or
GMT[+-]hh.
@return a frozen SimpleTimeZone with the given offset and
no Daylight Savings Time, or null if the id cannot be parsed. | [
"Parse",
"a",
"custom",
"time",
"zone",
"identifier",
"and",
"return",
"a",
"corresponding",
"zone",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java#L618-L630 |
35,020 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java | ZoneMeta.getCustomID | public static String getCustomID(String id) {
int[] fields = new int[4];
if (parseCustomID(id, fields)) {
return formatCustomID(fields[1], fields[2], fields[3], fields[0] < 0);
}
return null;
} | java | public static String getCustomID(String id) {
int[] fields = new int[4];
if (parseCustomID(id, fields)) {
return formatCustomID(fields[1], fields[2], fields[3], fields[0] < 0);
}
return null;
} | [
"public",
"static",
"String",
"getCustomID",
"(",
"String",
"id",
")",
"{",
"int",
"[",
"]",
"fields",
"=",
"new",
"int",
"[",
"4",
"]",
";",
"if",
"(",
"parseCustomID",
"(",
"id",
",",
"fields",
")",
")",
"{",
"return",
"formatCustomID",
"(",
"field... | Parse a custom time zone identifier and return the normalized
custom time zone identifier for the given custom id string.
@param id a string of the form GMT[+-]hh:mm, GMT[+-]hhmm, or
GMT[+-]hh.
@return The normalized custom id string. | [
"Parse",
"a",
"custom",
"time",
"zone",
"identifier",
"and",
"return",
"the",
"normalized",
"custom",
"time",
"zone",
"identifier",
"for",
"the",
"given",
"custom",
"id",
"string",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java#L639-L645 |
35,021 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java | ZoneMeta.getCustomTimeZone | public static SimpleTimeZone getCustomTimeZone(int offset) {
boolean negative = false;
int tmp = offset;
if (offset < 0) {
negative = true;
tmp = -offset;
}
int hour, min, sec;
if (ASSERT) {
Assert.assrt("millis!=0", tmp % 1000 != 0);
}
tmp /= 1000;
sec = tmp % 60;
tmp /= 60;
min = tmp % 60;
hour = tmp / 60;
// Note: No millisecond part included in TZID for now
String zid = formatCustomID(hour, min, sec, negative);
return new SimpleTimeZone(offset, zid);
} | java | public static SimpleTimeZone getCustomTimeZone(int offset) {
boolean negative = false;
int tmp = offset;
if (offset < 0) {
negative = true;
tmp = -offset;
}
int hour, min, sec;
if (ASSERT) {
Assert.assrt("millis!=0", tmp % 1000 != 0);
}
tmp /= 1000;
sec = tmp % 60;
tmp /= 60;
min = tmp % 60;
hour = tmp / 60;
// Note: No millisecond part included in TZID for now
String zid = formatCustomID(hour, min, sec, negative);
return new SimpleTimeZone(offset, zid);
} | [
"public",
"static",
"SimpleTimeZone",
"getCustomTimeZone",
"(",
"int",
"offset",
")",
"{",
"boolean",
"negative",
"=",
"false",
";",
"int",
"tmp",
"=",
"offset",
";",
"if",
"(",
"offset",
"<",
"0",
")",
"{",
"negative",
"=",
"true",
";",
"tmp",
"=",
"-... | Creates a custom zone for the offset
@param offset GMT offset in milliseconds
@return A custom TimeZone for the offset with normalized time zone id | [
"Creates",
"a",
"custom",
"zone",
"for",
"the",
"offset"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java#L775-L798 |
35,022 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/CertificateX509Key.java | CertificateX509Key.encode | public void encode(OutputStream out) throws IOException {
DerOutputStream tmp = new DerOutputStream();
tmp.write(key.getEncoded());
out.write(tmp.toByteArray());
} | java | public void encode(OutputStream out) throws IOException {
DerOutputStream tmp = new DerOutputStream();
tmp.write(key.getEncoded());
out.write(tmp.toByteArray());
} | [
"public",
"void",
"encode",
"(",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"DerOutputStream",
"tmp",
"=",
"new",
"DerOutputStream",
"(",
")",
";",
"tmp",
".",
"write",
"(",
"key",
".",
"getEncoded",
"(",
")",
")",
";",
"out",
".",
"write"... | Encode the key in DER form to the stream.
@param out the OutputStream to marshal the contents to.
@exception IOException on errors. | [
"Encode",
"the",
"key",
"in",
"DER",
"form",
"to",
"the",
"stream",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/CertificateX509Key.java#L103-L108 |
35,023 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DOM2Helper.java | DOM2Helper.getLocalNameOfNode | public String getLocalNameOfNode(Node n)
{
String name = n.getLocalName();
return (null == name) ? super.getLocalNameOfNode(n) : name;
} | java | public String getLocalNameOfNode(Node n)
{
String name = n.getLocalName();
return (null == name) ? super.getLocalNameOfNode(n) : name;
} | [
"public",
"String",
"getLocalNameOfNode",
"(",
"Node",
"n",
")",
"{",
"String",
"name",
"=",
"n",
".",
"getLocalName",
"(",
")",
";",
"return",
"(",
"null",
"==",
"name",
")",
"?",
"super",
".",
"getLocalNameOfNode",
"(",
"n",
")",
":",
"name",
";",
... | Returns the local name of the given node, as defined by the
XML Namespaces specification. This is prepared to handle documents
built using DOM Level 1 methods by falling back upon explicitly
parsing the node name.
@param n Node to be examined
@return String containing the local name, or null if the node
was not assigned a Namespace. | [
"Returns",
"the",
"local",
"name",
"of",
"the",
"given",
"node",
"as",
"defined",
"by",
"the",
"XML",
"Namespaces",
"specification",
".",
"This",
"is",
"prepared",
"to",
"handle",
"documents",
"built",
"using",
"DOM",
"Level",
"1",
"methods",
"by",
"falling"... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DOM2Helper.java#L281-L287 |
35,024 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/Expression.java | Expression.num | public double num(XPathContext xctxt)
throws javax.xml.transform.TransformerException
{
return execute(xctxt).num();
} | java | public double num(XPathContext xctxt)
throws javax.xml.transform.TransformerException
{
return execute(xctxt).num();
} | [
"public",
"double",
"num",
"(",
"XPathContext",
"xctxt",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"return",
"execute",
"(",
"xctxt",
")",
".",
"num",
"(",
")",
";",
"}"
] | Evaluate expression to a number.
@param xctxt The XPath runtime context.
@return The expression evaluated as a double.
@throws javax.xml.transform.TransformerException | [
"Evaluate",
"expression",
"to",
"a",
"number",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/Expression.java#L168-L172 |
35,025 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/Expression.java | Expression.bool | public boolean bool(XPathContext xctxt)
throws javax.xml.transform.TransformerException
{
return execute(xctxt).bool();
} | java | public boolean bool(XPathContext xctxt)
throws javax.xml.transform.TransformerException
{
return execute(xctxt).bool();
} | [
"public",
"boolean",
"bool",
"(",
"XPathContext",
"xctxt",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"return",
"execute",
"(",
"xctxt",
")",
".",
"bool",
"(",
")",
";",
"}"
] | Evaluate expression to a boolean.
@param xctxt The XPath runtime context.
@return false
@throws javax.xml.transform.TransformerException | [
"Evaluate",
"expression",
"to",
"a",
"boolean",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/Expression.java#L183-L187 |
35,026 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/Expression.java | Expression.asIteratorRaw | public DTMIterator asIteratorRaw(XPathContext xctxt, int contextNode)
throws javax.xml.transform.TransformerException
{
try
{
xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
XNodeSet nodeset = (XNodeSet)execute(xctxt);
return nodeset.iterRaw();
}
finally
{
xctxt.popCurrentNodeAndExpression();
}
} | java | public DTMIterator asIteratorRaw(XPathContext xctxt, int contextNode)
throws javax.xml.transform.TransformerException
{
try
{
xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
XNodeSet nodeset = (XNodeSet)execute(xctxt);
return nodeset.iterRaw();
}
finally
{
xctxt.popCurrentNodeAndExpression();
}
} | [
"public",
"DTMIterator",
"asIteratorRaw",
"(",
"XPathContext",
"xctxt",
",",
"int",
"contextNode",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"try",
"{",
"xctxt",
".",
"pushCurrentNodeAndExpression",
"(",
"contextNode",
... | Given an select expression and a context, evaluate the XPath
and return the resulting iterator, but do not clone.
@param xctxt The execution context.
@param contextNode The node that "." expresses.
@return A valid DTMIterator.
@throws TransformerException thrown if the active ProblemListener decides
the error condition is severe enough to halt processing.
@throws javax.xml.transform.TransformerException
@xsl.usage experimental | [
"Given",
"an",
"select",
"expression",
"and",
"a",
"context",
"evaluate",
"the",
"XPath",
"and",
"return",
"the",
"resulting",
"iterator",
"but",
"do",
"not",
"clone",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/Expression.java#L275-L290 |
35,027 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/PluralRanges.java | PluralRanges.add | @Deprecated
public void add(StandardPlural rangeStart, StandardPlural rangeEnd,
StandardPlural result) {
if (isFrozen) {
throw new UnsupportedOperationException();
}
explicit[result.ordinal()] = true;
if (rangeStart == null) {
for (StandardPlural rs : StandardPlural.values()) {
if (rangeEnd == null) {
for (StandardPlural re : StandardPlural.values()) {
matrix.setIfNew(rs, re, result);
}
} else {
explicit[rangeEnd.ordinal()] = true;
matrix.setIfNew(rs, rangeEnd, result);
}
}
} else if (rangeEnd == null) {
explicit[rangeStart.ordinal()] = true;
for (StandardPlural re : StandardPlural.values()) {
matrix.setIfNew(rangeStart, re, result);
}
} else {
explicit[rangeStart.ordinal()] = true;
explicit[rangeEnd.ordinal()] = true;
matrix.setIfNew(rangeStart, rangeEnd, result);
}
} | java | @Deprecated
public void add(StandardPlural rangeStart, StandardPlural rangeEnd,
StandardPlural result) {
if (isFrozen) {
throw new UnsupportedOperationException();
}
explicit[result.ordinal()] = true;
if (rangeStart == null) {
for (StandardPlural rs : StandardPlural.values()) {
if (rangeEnd == null) {
for (StandardPlural re : StandardPlural.values()) {
matrix.setIfNew(rs, re, result);
}
} else {
explicit[rangeEnd.ordinal()] = true;
matrix.setIfNew(rs, rangeEnd, result);
}
}
} else if (rangeEnd == null) {
explicit[rangeStart.ordinal()] = true;
for (StandardPlural re : StandardPlural.values()) {
matrix.setIfNew(rangeStart, re, result);
}
} else {
explicit[rangeStart.ordinal()] = true;
explicit[rangeEnd.ordinal()] = true;
matrix.setIfNew(rangeStart, rangeEnd, result);
}
} | [
"@",
"Deprecated",
"public",
"void",
"add",
"(",
"StandardPlural",
"rangeStart",
",",
"StandardPlural",
"rangeEnd",
",",
"StandardPlural",
"result",
")",
"{",
"if",
"(",
"isFrozen",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
")",
";",
"}",
... | Internal method for building. If the start or end are null, it means everything of that type.
@param rangeStart
plural category for the start of the range
@param rangeEnd
plural category for the end of the range
@param result
the resulting plural category
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android | [
"Internal",
"method",
"for",
"building",
".",
"If",
"the",
"start",
"or",
"end",
"are",
"null",
"it",
"means",
"everything",
"of",
"that",
"type",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/PluralRanges.java#L202-L230 |
35,028 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/CharInfo.java | CharInfo.getCharInfo | static CharInfo getCharInfo(String entitiesFileName, String method)
{
CharInfo charInfo = (CharInfo) m_getCharInfoCache.get(entitiesFileName);
if (charInfo != null) {
return mutableCopyOf(charInfo);
}
// try to load it internally - cache
try {
charInfo = getCharInfoBasedOnPrivilege(entitiesFileName,
method, true);
// Put the common copy of charInfo in the cache, but return
// a copy of it.
m_getCharInfoCache.put(entitiesFileName, charInfo);
return mutableCopyOf(charInfo);
} catch (Exception e) {}
// try to load it externally - do not cache
try {
return getCharInfoBasedOnPrivilege(entitiesFileName,
method, false);
} catch (Exception e) {}
String absoluteEntitiesFileName;
if (entitiesFileName.indexOf(':') < 0) {
absoluteEntitiesFileName =
SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName);
} else {
try {
absoluteEntitiesFileName =
SystemIDResolver.getAbsoluteURI(entitiesFileName, null);
} catch (TransformerException te) {
throw new WrappedRuntimeException(te);
}
}
return getCharInfoBasedOnPrivilege(entitiesFileName,
method, false);
} | java | static CharInfo getCharInfo(String entitiesFileName, String method)
{
CharInfo charInfo = (CharInfo) m_getCharInfoCache.get(entitiesFileName);
if (charInfo != null) {
return mutableCopyOf(charInfo);
}
// try to load it internally - cache
try {
charInfo = getCharInfoBasedOnPrivilege(entitiesFileName,
method, true);
// Put the common copy of charInfo in the cache, but return
// a copy of it.
m_getCharInfoCache.put(entitiesFileName, charInfo);
return mutableCopyOf(charInfo);
} catch (Exception e) {}
// try to load it externally - do not cache
try {
return getCharInfoBasedOnPrivilege(entitiesFileName,
method, false);
} catch (Exception e) {}
String absoluteEntitiesFileName;
if (entitiesFileName.indexOf(':') < 0) {
absoluteEntitiesFileName =
SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName);
} else {
try {
absoluteEntitiesFileName =
SystemIDResolver.getAbsoluteURI(entitiesFileName, null);
} catch (TransformerException te) {
throw new WrappedRuntimeException(te);
}
}
return getCharInfoBasedOnPrivilege(entitiesFileName,
method, false);
} | [
"static",
"CharInfo",
"getCharInfo",
"(",
"String",
"entitiesFileName",
",",
"String",
"method",
")",
"{",
"CharInfo",
"charInfo",
"=",
"(",
"CharInfo",
")",
"m_getCharInfoCache",
".",
"get",
"(",
"entitiesFileName",
")",
";",
"if",
"(",
"charInfo",
"!=",
"nul... | Factory that reads in a resource file that describes the mapping of
characters to entity references.
Resource files must be encoded in UTF-8 and have a format like:
<pre>
# First char # is a comment
Entity numericValue
quot 34
amp 38
</pre>
(Note: Why don't we just switch to .properties files? Oct-01 -sc)
@param entitiesResource Name of entities resource file that should
be loaded, which describes that mapping of characters to entity references.
@param method the output method type, which should be one of "xml", "html", "text"...
@xsl.usage internal | [
"Factory",
"that",
"reads",
"in",
"a",
"resource",
"file",
"that",
"describes",
"the",
"mapping",
"of",
"characters",
"to",
"entity",
"references",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/CharInfo.java#L498-L537 |
35,029 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/CharInfo.java | CharInfo.mutableCopyOf | private static CharInfo mutableCopyOf(CharInfo charInfo) {
CharInfo copy = new CharInfo();
int max = charInfo.array_of_bits.length;
System.arraycopy(charInfo.array_of_bits,0,copy.array_of_bits,0,max);
copy.firstWordNotUsed = charInfo.firstWordNotUsed;
max = charInfo.shouldMapAttrChar_ASCII.length;
System.arraycopy(charInfo.shouldMapAttrChar_ASCII,0,copy.shouldMapAttrChar_ASCII,0,max);
max = charInfo.shouldMapTextChar_ASCII.length;
System.arraycopy(charInfo.shouldMapTextChar_ASCII,0,copy.shouldMapTextChar_ASCII,0,max);
// utility field copy.m_charKey is already created in the default constructor
copy.m_charToString = (HashMap) charInfo.m_charToString.clone();
copy.onlyQuotAmpLtGt = charInfo.onlyQuotAmpLtGt;
return copy;
} | java | private static CharInfo mutableCopyOf(CharInfo charInfo) {
CharInfo copy = new CharInfo();
int max = charInfo.array_of_bits.length;
System.arraycopy(charInfo.array_of_bits,0,copy.array_of_bits,0,max);
copy.firstWordNotUsed = charInfo.firstWordNotUsed;
max = charInfo.shouldMapAttrChar_ASCII.length;
System.arraycopy(charInfo.shouldMapAttrChar_ASCII,0,copy.shouldMapAttrChar_ASCII,0,max);
max = charInfo.shouldMapTextChar_ASCII.length;
System.arraycopy(charInfo.shouldMapTextChar_ASCII,0,copy.shouldMapTextChar_ASCII,0,max);
// utility field copy.m_charKey is already created in the default constructor
copy.m_charToString = (HashMap) charInfo.m_charToString.clone();
copy.onlyQuotAmpLtGt = charInfo.onlyQuotAmpLtGt;
return copy;
} | [
"private",
"static",
"CharInfo",
"mutableCopyOf",
"(",
"CharInfo",
"charInfo",
")",
"{",
"CharInfo",
"copy",
"=",
"new",
"CharInfo",
"(",
")",
";",
"int",
"max",
"=",
"charInfo",
".",
"array_of_bits",
".",
"length",
";",
"System",
".",
"arraycopy",
"(",
"c... | Create a mutable copy of the cached one.
@param charInfo The cached one.
@return | [
"Create",
"a",
"mutable",
"copy",
"of",
"the",
"cached",
"one",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/CharInfo.java#L544-L565 |
35,030 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/CharInfo.java | CharInfo.extraEntity | private boolean extraEntity(String outputString, int charToMap)
{
boolean extra = false;
if (charToMap < ASCII_MAX)
{
switch (charToMap)
{
case '"' : // quot
if (!outputString.equals("""))
extra = true;
break;
case '&' : // amp
if (!outputString.equals("&"))
extra = true;
break;
case '<' : // lt
if (!outputString.equals("<"))
extra = true;
break;
case '>' : // gt
if (!outputString.equals(">"))
extra = true;
break;
default : // other entity in range 0 to 127
extra = true;
}
}
return extra;
} | java | private boolean extraEntity(String outputString, int charToMap)
{
boolean extra = false;
if (charToMap < ASCII_MAX)
{
switch (charToMap)
{
case '"' : // quot
if (!outputString.equals("""))
extra = true;
break;
case '&' : // amp
if (!outputString.equals("&"))
extra = true;
break;
case '<' : // lt
if (!outputString.equals("<"))
extra = true;
break;
case '>' : // gt
if (!outputString.equals(">"))
extra = true;
break;
default : // other entity in range 0 to 127
extra = true;
}
}
return extra;
} | [
"private",
"boolean",
"extraEntity",
"(",
"String",
"outputString",
",",
"int",
"charToMap",
")",
"{",
"boolean",
"extra",
"=",
"false",
";",
"if",
"(",
"charToMap",
"<",
"ASCII_MAX",
")",
"{",
"switch",
"(",
"charToMap",
")",
"{",
"case",
"'",
"'",
":",... | This method returns true if there are some non-standard mappings to
entities other than quot, amp, lt, gt, and its only purpose is for
performance.
@param charToMap The value of the character that is mapped to a String
@param outputString The String to which the character is mapped, usually
an entity reference such as "<".
@return true if the mapping is not one of:
<ul>
<li> '<' to "<"
<li> '>' to ">"
<li> '&' to "&"
<li> '"' to """
</ul> | [
"This",
"method",
"returns",
"true",
"if",
"there",
"are",
"some",
"non",
"-",
"standard",
"mappings",
"to",
"entities",
"other",
"than",
"quot",
"amp",
"lt",
"gt",
"and",
"its",
"only",
"purpose",
"is",
"for",
"performance",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/CharInfo.java#L666-L694 |
35,031 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/CharInfo.java | CharInfo.defineChar2StringMapping | boolean defineChar2StringMapping(String outputString, char inputChar)
{
CharKey character = new CharKey(inputChar);
m_charToString.put(character, outputString);
set(inputChar); // mark the character has having a mapping to a String
boolean extraMapping = extraEntity(outputString, inputChar);
return extraMapping;
} | java | boolean defineChar2StringMapping(String outputString, char inputChar)
{
CharKey character = new CharKey(inputChar);
m_charToString.put(character, outputString);
set(inputChar); // mark the character has having a mapping to a String
boolean extraMapping = extraEntity(outputString, inputChar);
return extraMapping;
} | [
"boolean",
"defineChar2StringMapping",
"(",
"String",
"outputString",
",",
"char",
"inputChar",
")",
"{",
"CharKey",
"character",
"=",
"new",
"CharKey",
"(",
"inputChar",
")",
";",
"m_charToString",
".",
"put",
"(",
"character",
",",
"outputString",
")",
";",
... | Call this method to register a char to String mapping, for example
to map '<' to "<".
@param outputString The String to map to.
@param inputChar The char to map from.
@return true if the mapping is not one of:
<ul>
<li> '<' to "<"
<li> '>' to ">"
<li> '&' to "&"
<li> '"' to """
</ul> | [
"Call",
"this",
"method",
"to",
"register",
"a",
"char",
"to",
"String",
"mapping",
"for",
"example",
"to",
"map",
"<",
"to",
"<",
";",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/CharInfo.java#L738-L747 |
35,032 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.bounds | public static int bounds(String source, int offset16) {
char ch = source.charAt(offset16);
if (isSurrogate(ch)) {
if (isLeadSurrogate(ch)) {
if (++offset16 < source.length() && isTrailSurrogate(source.charAt(offset16))) {
return LEAD_SURROGATE_BOUNDARY;
}
} else {
// isTrailSurrogate(ch), so
--offset16;
if (offset16 >= 0 && isLeadSurrogate(source.charAt(offset16))) {
return TRAIL_SURROGATE_BOUNDARY;
}
}
}
return SINGLE_CHAR_BOUNDARY;
} | java | public static int bounds(String source, int offset16) {
char ch = source.charAt(offset16);
if (isSurrogate(ch)) {
if (isLeadSurrogate(ch)) {
if (++offset16 < source.length() && isTrailSurrogate(source.charAt(offset16))) {
return LEAD_SURROGATE_BOUNDARY;
}
} else {
// isTrailSurrogate(ch), so
--offset16;
if (offset16 >= 0 && isLeadSurrogate(source.charAt(offset16))) {
return TRAIL_SURROGATE_BOUNDARY;
}
}
}
return SINGLE_CHAR_BOUNDARY;
} | [
"public",
"static",
"int",
"bounds",
"(",
"String",
"source",
",",
"int",
"offset16",
")",
"{",
"char",
"ch",
"=",
"source",
".",
"charAt",
"(",
"offset16",
")",
";",
"if",
"(",
"isSurrogate",
"(",
"ch",
")",
")",
"{",
"if",
"(",
"isLeadSurrogate",
"... | Returns the type of the boundaries around the char at offset16. Used for random access.
@param source Text to analyse
@param offset16 UTF-16 offset
@return
<ul>
<li> SINGLE_CHAR_BOUNDARY : a single char; the bounds are [offset16, offset16+1]
<li> LEAD_SURROGATE_BOUNDARY : a surrogate pair starting at offset16; the bounds
are [offset16, offset16 + 2]
<li> TRAIL_SURROGATE_BOUNDARY : a surrogate pair starting at offset16 - 1; the
bounds are [offset16 - 1, offset16 + 1]
</ul>
For bit-twiddlers, the return values for these are chosen so that the boundaries
can be gotten by: [offset16 - (value >> 2), offset16 + (value & 3)].
@exception IndexOutOfBoundsException If offset16 is out of bounds. | [
"Returns",
"the",
"type",
"of",
"the",
"boundaries",
"around",
"the",
"char",
"at",
"offset16",
".",
"Used",
"for",
"random",
"access",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L474-L490 |
35,033 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.append | public static int append(char[] target, int limit, int char32) {
// Check for irregular values
if (char32 < CODEPOINT_MIN_VALUE || char32 > CODEPOINT_MAX_VALUE) {
throw new IllegalArgumentException("Illegal codepoint");
}
// Write the UTF-16 values
if (char32 >= SUPPLEMENTARY_MIN_VALUE) {
target[limit++] = getLeadSurrogate(char32);
target[limit++] = getTrailSurrogate(char32);
} else {
target[limit++] = (char) char32;
}
return limit;
} | java | public static int append(char[] target, int limit, int char32) {
// Check for irregular values
if (char32 < CODEPOINT_MIN_VALUE || char32 > CODEPOINT_MAX_VALUE) {
throw new IllegalArgumentException("Illegal codepoint");
}
// Write the UTF-16 values
if (char32 >= SUPPLEMENTARY_MIN_VALUE) {
target[limit++] = getLeadSurrogate(char32);
target[limit++] = getTrailSurrogate(char32);
} else {
target[limit++] = (char) char32;
}
return limit;
} | [
"public",
"static",
"int",
"append",
"(",
"char",
"[",
"]",
"target",
",",
"int",
"limit",
",",
"int",
"char32",
")",
"{",
"// Check for irregular values",
"if",
"(",
"char32",
"<",
"CODEPOINT_MIN_VALUE",
"||",
"char32",
">",
"CODEPOINT_MAX_VALUE",
")",
"{",
... | Adds a codepoint to offset16 position of the argument char array.
@param target Char array to be append with the new code point
@param limit UTF16 offset which the codepoint will be appended.
@param char32 Code point to be appended
@return offset after char32 in the array.
@exception IllegalArgumentException Thrown if there is not enough space for the append, or when char32 does not
lie within the range of the Unicode codepoints. | [
"Adds",
"a",
"codepoint",
"to",
"offset16",
"position",
"of",
"the",
"argument",
"char",
"array",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L1017-L1030 |
35,034 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.countCodePoint | public static int countCodePoint(String source) {
if (source == null || source.length() == 0) {
return 0;
}
return findCodePointOffset(source, source.length());
} | java | public static int countCodePoint(String source) {
if (source == null || source.length() == 0) {
return 0;
}
return findCodePointOffset(source, source.length());
} | [
"public",
"static",
"int",
"countCodePoint",
"(",
"String",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
"||",
"source",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"return",
"findCodePointOffset",
"(",
"source",
",... | Number of codepoints in a UTF16 String
@param source UTF16 string
@return number of codepoint in string | [
"Number",
"of",
"codepoints",
"in",
"a",
"UTF16",
"String"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L1038-L1043 |
35,035 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.countCodePoint | public static int countCodePoint(StringBuffer source) {
if (source == null || source.length() == 0) {
return 0;
}
return findCodePointOffset(source, source.length());
} | java | public static int countCodePoint(StringBuffer source) {
if (source == null || source.length() == 0) {
return 0;
}
return findCodePointOffset(source, source.length());
} | [
"public",
"static",
"int",
"countCodePoint",
"(",
"StringBuffer",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
"||",
"source",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"return",
"findCodePointOffset",
"(",
"source"... | Number of codepoints in a UTF16 String buffer
@param source UTF16 string buffer
@return number of codepoint in string | [
"Number",
"of",
"codepoints",
"in",
"a",
"UTF16",
"String",
"buffer"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L1051-L1056 |
35,036 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.countCodePoint | public static int countCodePoint(char source[], int start, int limit) {
if (source == null || source.length == 0) {
return 0;
}
return findCodePointOffset(source, start, limit, limit - start);
} | java | public static int countCodePoint(char source[], int start, int limit) {
if (source == null || source.length == 0) {
return 0;
}
return findCodePointOffset(source, start, limit, limit - start);
} | [
"public",
"static",
"int",
"countCodePoint",
"(",
"char",
"source",
"[",
"]",
",",
"int",
"start",
",",
"int",
"limit",
")",
"{",
"if",
"(",
"source",
"==",
"null",
"||",
"source",
".",
"length",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"retur... | Number of codepoints in a UTF16 char array substring
@param source UTF16 char array
@param start Offset of the substring
@param limit Offset of the substring
@return number of codepoint in the substring
@exception IndexOutOfBoundsException If start and limit are not valid. | [
"Number",
"of",
"codepoints",
"in",
"a",
"UTF16",
"char",
"array",
"substring"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L1067-L1072 |
35,037 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.setCharAt | public static void setCharAt(StringBuffer target, int offset16, int char32) {
int count = 1;
char single = target.charAt(offset16);
if (isSurrogate(single)) {
// pairs of the surrogate with offset16 at the lead char found
if (isLeadSurrogate(single) && (target.length() > offset16 + 1)
&& isTrailSurrogate(target.charAt(offset16 + 1))) {
count++;
} else {
// pairs of the surrogate with offset16 at the trail char
// found
if (isTrailSurrogate(single) && (offset16 > 0)
&& isLeadSurrogate(target.charAt(offset16 - 1))) {
offset16--;
count++;
}
}
}
target.replace(offset16, offset16 + count, valueOf(char32));
} | java | public static void setCharAt(StringBuffer target, int offset16, int char32) {
int count = 1;
char single = target.charAt(offset16);
if (isSurrogate(single)) {
// pairs of the surrogate with offset16 at the lead char found
if (isLeadSurrogate(single) && (target.length() > offset16 + 1)
&& isTrailSurrogate(target.charAt(offset16 + 1))) {
count++;
} else {
// pairs of the surrogate with offset16 at the trail char
// found
if (isTrailSurrogate(single) && (offset16 > 0)
&& isLeadSurrogate(target.charAt(offset16 - 1))) {
offset16--;
count++;
}
}
}
target.replace(offset16, offset16 + count, valueOf(char32));
} | [
"public",
"static",
"void",
"setCharAt",
"(",
"StringBuffer",
"target",
",",
"int",
"offset16",
",",
"int",
"char32",
")",
"{",
"int",
"count",
"=",
"1",
";",
"char",
"single",
"=",
"target",
".",
"charAt",
"(",
"offset16",
")",
";",
"if",
"(",
"isSurr... | Set a code point into a UTF16 position. Adjusts target according if we are replacing a
non-supplementary codepoint with a supplementary and vice versa.
@param target Stringbuffer
@param offset16 UTF16 position to insert into
@param char32 Code point | [
"Set",
"a",
"code",
"point",
"into",
"a",
"UTF16",
"position",
".",
"Adjusts",
"target",
"according",
"if",
"we",
"are",
"replacing",
"a",
"non",
"-",
"supplementary",
"codepoint",
"with",
"a",
"supplementary",
"and",
"vice",
"versa",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L1082-L1102 |
35,038 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.setCharAt | public static int setCharAt(char target[], int limit, int offset16, int char32) {
if (offset16 >= limit) {
throw new ArrayIndexOutOfBoundsException(offset16);
}
int count = 1;
char single = target[offset16];
if (isSurrogate(single)) {
// pairs of the surrogate with offset16 at the lead char found
if (isLeadSurrogate(single) && (target.length > offset16 + 1)
&& isTrailSurrogate(target[offset16 + 1])) {
count++;
} else {
// pairs of the surrogate with offset16 at the trail char
// found
if (isTrailSurrogate(single) && (offset16 > 0)
&& isLeadSurrogate(target[offset16 - 1])) {
offset16--;
count++;
}
}
}
String str = valueOf(char32);
int result = limit;
int strlength = str.length();
target[offset16] = str.charAt(0);
if (count == strlength) {
if (count == 2) {
target[offset16 + 1] = str.charAt(1);
}
} else {
// this is not exact match in space, we'll have to do some
// shifting
System.arraycopy(target, offset16 + count, target, offset16 + strlength, limit
- (offset16 + count));
if (count < strlength) {
// char32 is a supplementary character trying to squeeze into
// a non-supplementary space
target[offset16 + 1] = str.charAt(1);
result++;
if (result < target.length) {
target[result] = 0;
}
} else {
// char32 is a non-supplementary character trying to fill
// into a supplementary space
result--;
target[result] = 0;
}
}
return result;
} | java | public static int setCharAt(char target[], int limit, int offset16, int char32) {
if (offset16 >= limit) {
throw new ArrayIndexOutOfBoundsException(offset16);
}
int count = 1;
char single = target[offset16];
if (isSurrogate(single)) {
// pairs of the surrogate with offset16 at the lead char found
if (isLeadSurrogate(single) && (target.length > offset16 + 1)
&& isTrailSurrogate(target[offset16 + 1])) {
count++;
} else {
// pairs of the surrogate with offset16 at the trail char
// found
if (isTrailSurrogate(single) && (offset16 > 0)
&& isLeadSurrogate(target[offset16 - 1])) {
offset16--;
count++;
}
}
}
String str = valueOf(char32);
int result = limit;
int strlength = str.length();
target[offset16] = str.charAt(0);
if (count == strlength) {
if (count == 2) {
target[offset16 + 1] = str.charAt(1);
}
} else {
// this is not exact match in space, we'll have to do some
// shifting
System.arraycopy(target, offset16 + count, target, offset16 + strlength, limit
- (offset16 + count));
if (count < strlength) {
// char32 is a supplementary character trying to squeeze into
// a non-supplementary space
target[offset16 + 1] = str.charAt(1);
result++;
if (result < target.length) {
target[result] = 0;
}
} else {
// char32 is a non-supplementary character trying to fill
// into a supplementary space
result--;
target[result] = 0;
}
}
return result;
} | [
"public",
"static",
"int",
"setCharAt",
"(",
"char",
"target",
"[",
"]",
",",
"int",
"limit",
",",
"int",
"offset16",
",",
"int",
"char32",
")",
"{",
"if",
"(",
"offset16",
">=",
"limit",
")",
"{",
"throw",
"new",
"ArrayIndexOutOfBoundsException",
"(",
"... | Set a code point into a UTF16 position in a char array. Adjusts target according if we are
replacing a non-supplementary codepoint with a supplementary and vice versa.
@param target char array
@param limit numbers of valid chars in target, different from target.length. limit counts the
number of chars in target that represents a string, not the size of array target.
@param offset16 UTF16 position to insert into
@param char32 code point
@return new number of chars in target that represents a string
@exception IndexOutOfBoundsException if offset16 is out of range | [
"Set",
"a",
"code",
"point",
"into",
"a",
"UTF16",
"position",
"in",
"a",
"char",
"array",
".",
"Adjusts",
"target",
"according",
"if",
"we",
"are",
"replacing",
"a",
"non",
"-",
"supplementary",
"codepoint",
"with",
"a",
"supplementary",
"and",
"vice",
"v... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L1116-L1168 |
35,039 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.moveCodePointOffset | public static int moveCodePointOffset(String source, int offset16, int shift32) {
int result = offset16;
int size = source.length();
int count;
char ch;
if (offset16 < 0 || offset16 > size) {
throw new StringIndexOutOfBoundsException(offset16);
}
if (shift32 > 0) {
if (shift32 + offset16 > size) {
throw new StringIndexOutOfBoundsException(offset16);
}
count = shift32;
while (result < size && count > 0) {
ch = source.charAt(result);
if (isLeadSurrogate(ch) && ((result + 1) < size)
&& isTrailSurrogate(source.charAt(result + 1))) {
result++;
}
count--;
result++;
}
} else {
if (offset16 + shift32 < 0) {
throw new StringIndexOutOfBoundsException(offset16);
}
for (count = -shift32; count > 0; count--) {
result--;
if (result < 0) {
break;
}
ch = source.charAt(result);
if (isTrailSurrogate(ch) && result > 0
&& isLeadSurrogate(source.charAt(result - 1))) {
result--;
}
}
}
if (count != 0) {
throw new StringIndexOutOfBoundsException(shift32);
}
return result;
} | java | public static int moveCodePointOffset(String source, int offset16, int shift32) {
int result = offset16;
int size = source.length();
int count;
char ch;
if (offset16 < 0 || offset16 > size) {
throw new StringIndexOutOfBoundsException(offset16);
}
if (shift32 > 0) {
if (shift32 + offset16 > size) {
throw new StringIndexOutOfBoundsException(offset16);
}
count = shift32;
while (result < size && count > 0) {
ch = source.charAt(result);
if (isLeadSurrogate(ch) && ((result + 1) < size)
&& isTrailSurrogate(source.charAt(result + 1))) {
result++;
}
count--;
result++;
}
} else {
if (offset16 + shift32 < 0) {
throw new StringIndexOutOfBoundsException(offset16);
}
for (count = -shift32; count > 0; count--) {
result--;
if (result < 0) {
break;
}
ch = source.charAt(result);
if (isTrailSurrogate(ch) && result > 0
&& isLeadSurrogate(source.charAt(result - 1))) {
result--;
}
}
}
if (count != 0) {
throw new StringIndexOutOfBoundsException(shift32);
}
return result;
} | [
"public",
"static",
"int",
"moveCodePointOffset",
"(",
"String",
"source",
",",
"int",
"offset16",
",",
"int",
"shift32",
")",
"{",
"int",
"result",
"=",
"offset16",
";",
"int",
"size",
"=",
"source",
".",
"length",
"(",
")",
";",
"int",
"count",
";",
... | Shifts offset16 by the argument number of codepoints
@param source string
@param offset16 UTF16 position to shift
@param shift32 number of codepoints to shift
@return new shifted offset16
@exception IndexOutOfBoundsException if the new offset16 is out of bounds. | [
"Shifts",
"offset16",
"by",
"the",
"argument",
"number",
"of",
"codepoints"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L1179-L1221 |
35,040 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.moveCodePointOffset | public static int moveCodePointOffset(char source[], int start, int limit, int offset16,
int shift32) {
int size = source.length;
int count;
char ch;
int result = offset16 + start;
if (start < 0 || limit < start) {
throw new StringIndexOutOfBoundsException(start);
}
if (limit > size) {
throw new StringIndexOutOfBoundsException(limit);
}
if (offset16 < 0 || result > limit) {
throw new StringIndexOutOfBoundsException(offset16);
}
if (shift32 > 0) {
if (shift32 + result > size) {
throw new StringIndexOutOfBoundsException(result);
}
count = shift32;
while (result < limit && count > 0) {
ch = source[result];
if (isLeadSurrogate(ch) && (result + 1 < limit)
&& isTrailSurrogate(source[result + 1])) {
result++;
}
count--;
result++;
}
} else {
if (result + shift32 < start) {
throw new StringIndexOutOfBoundsException(result);
}
for (count = -shift32; count > 0; count--) {
result--;
if (result < start) {
break;
}
ch = source[result];
if (isTrailSurrogate(ch) && result > start && isLeadSurrogate(source[result - 1])) {
result--;
}
}
}
if (count != 0) {
throw new StringIndexOutOfBoundsException(shift32);
}
result -= start;
return result;
} | java | public static int moveCodePointOffset(char source[], int start, int limit, int offset16,
int shift32) {
int size = source.length;
int count;
char ch;
int result = offset16 + start;
if (start < 0 || limit < start) {
throw new StringIndexOutOfBoundsException(start);
}
if (limit > size) {
throw new StringIndexOutOfBoundsException(limit);
}
if (offset16 < 0 || result > limit) {
throw new StringIndexOutOfBoundsException(offset16);
}
if (shift32 > 0) {
if (shift32 + result > size) {
throw new StringIndexOutOfBoundsException(result);
}
count = shift32;
while (result < limit && count > 0) {
ch = source[result];
if (isLeadSurrogate(ch) && (result + 1 < limit)
&& isTrailSurrogate(source[result + 1])) {
result++;
}
count--;
result++;
}
} else {
if (result + shift32 < start) {
throw new StringIndexOutOfBoundsException(result);
}
for (count = -shift32; count > 0; count--) {
result--;
if (result < start) {
break;
}
ch = source[result];
if (isTrailSurrogate(ch) && result > start && isLeadSurrogate(source[result - 1])) {
result--;
}
}
}
if (count != 0) {
throw new StringIndexOutOfBoundsException(shift32);
}
result -= start;
return result;
} | [
"public",
"static",
"int",
"moveCodePointOffset",
"(",
"char",
"source",
"[",
"]",
",",
"int",
"start",
",",
"int",
"limit",
",",
"int",
"offset16",
",",
"int",
"shift32",
")",
"{",
"int",
"size",
"=",
"source",
".",
"length",
";",
"int",
"count",
";",... | Shifts offset16 by the argument number of codepoints within a subarray.
@param source Char array
@param start Position of the subarray to be performed on
@param limit Position of the subarray to be performed on
@param offset16 UTF16 position to shift relative to start
@param shift32 Number of codepoints to shift
@return new shifted offset16 relative to start
@exception IndexOutOfBoundsException If the new offset16 is out of bounds with respect to the subarray or the
subarray bounds are out of range. | [
"Shifts",
"offset16",
"by",
"the",
"argument",
"number",
"of",
"codepoints",
"within",
"a",
"subarray",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L1288-L1337 |
35,041 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.newString | public static String newString(int[] codePoints, int offset, int count) {
if (count < 0) {
throw new IllegalArgumentException();
}
char[] chars = new char[count];
int w = 0;
for (int r = offset, e = offset + count; r < e; ++r) {
int cp = codePoints[r];
if (cp < 0 || cp > 0x10ffff) {
throw new IllegalArgumentException();
}
while (true) {
try {
if (cp < 0x010000) {
chars[w] = (char) cp;
w++;
} else {
chars[w] = (char) (LEAD_SURROGATE_OFFSET_ + (cp >> LEAD_SURROGATE_SHIFT_));
chars[w + 1] = (char) (TRAIL_SURROGATE_MIN_VALUE + (cp & TRAIL_SURROGATE_MASK_));
w += 2;
}
break;
} catch (IndexOutOfBoundsException ex) {
int newlen = (int) (Math.ceil((double) codePoints.length * (w + 2)
/ (r - offset + 1)));
char[] temp = new char[newlen];
System.arraycopy(chars, 0, temp, 0, w);
chars = temp;
}
}
}
return new String(chars, 0, w);
} | java | public static String newString(int[] codePoints, int offset, int count) {
if (count < 0) {
throw new IllegalArgumentException();
}
char[] chars = new char[count];
int w = 0;
for (int r = offset, e = offset + count; r < e; ++r) {
int cp = codePoints[r];
if (cp < 0 || cp > 0x10ffff) {
throw new IllegalArgumentException();
}
while (true) {
try {
if (cp < 0x010000) {
chars[w] = (char) cp;
w++;
} else {
chars[w] = (char) (LEAD_SURROGATE_OFFSET_ + (cp >> LEAD_SURROGATE_SHIFT_));
chars[w + 1] = (char) (TRAIL_SURROGATE_MIN_VALUE + (cp & TRAIL_SURROGATE_MASK_));
w += 2;
}
break;
} catch (IndexOutOfBoundsException ex) {
int newlen = (int) (Math.ceil((double) codePoints.length * (w + 2)
/ (r - offset + 1)));
char[] temp = new char[newlen];
System.arraycopy(chars, 0, temp, 0, w);
chars = temp;
}
}
}
return new String(chars, 0, w);
} | [
"public",
"static",
"String",
"newString",
"(",
"int",
"[",
"]",
"codePoints",
",",
"int",
"offset",
",",
"int",
"count",
")",
"{",
"if",
"(",
"count",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"char",
"[",
"... | Cover JDK 1.5 API. Create a String from an array of codePoints.
@param codePoints The code array
@param offset The start of the text in the code point array
@param count The number of code points
@return a String representing the code points between offset and count
@throws IllegalArgumentException If an invalid code point is encountered
@throws IndexOutOfBoundsException If the offset or count are out of bounds. | [
"Cover",
"JDK",
"1",
".",
"5",
"API",
".",
"Create",
"a",
"String",
"from",
"an",
"array",
"of",
"codePoints",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L2207-L2239 |
35,042 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java | UTF16.getSingleCodePoint | public static int getSingleCodePoint(CharSequence s) {
if (s == null || s.length() == 0) {
return -1;
} else if (s.length() == 1) {
return s.charAt(0);
} else if (s.length() > 2) {
return -1;
}
// at this point, len = 2
int cp = Character.codePointAt(s, 0);
if (cp > 0xFFFF) { // is surrogate pair
return cp;
}
return -1;
} | java | public static int getSingleCodePoint(CharSequence s) {
if (s == null || s.length() == 0) {
return -1;
} else if (s.length() == 1) {
return s.charAt(0);
} else if (s.length() > 2) {
return -1;
}
// at this point, len = 2
int cp = Character.codePointAt(s, 0);
if (cp > 0xFFFF) { // is surrogate pair
return cp;
}
return -1;
} | [
"public",
"static",
"int",
"getSingleCodePoint",
"(",
"CharSequence",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"-",
"1",
";",
"}",
"else",
"if",
"(",
"s",
".",
"length",
"(",
... | Utility for getting a code point from a CharSequence that contains exactly one code point.
@return the code point IF the string is non-null and consists of a single code point.
otherwise returns -1.
@param s to test | [
"Utility",
"for",
"getting",
"a",
"code",
"point",
"from",
"a",
"CharSequence",
"that",
"contains",
"exactly",
"one",
"code",
"point",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UTF16.java#L2528-L2543 |
35,043 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/Executors.java | Executors.newCachedThreadPool | public static ExecutorService newCachedThreadPool(ThreadFactory threadFactory) {
return new ThreadPoolExecutor(0, Integer.MAX_VALUE,
60L, TimeUnit.SECONDS,
new SynchronousQueue<Runnable>(),
threadFactory);
} | java | public static ExecutorService newCachedThreadPool(ThreadFactory threadFactory) {
return new ThreadPoolExecutor(0, Integer.MAX_VALUE,
60L, TimeUnit.SECONDS,
new SynchronousQueue<Runnable>(),
threadFactory);
} | [
"public",
"static",
"ExecutorService",
"newCachedThreadPool",
"(",
"ThreadFactory",
"threadFactory",
")",
"{",
"return",
"new",
"ThreadPoolExecutor",
"(",
"0",
",",
"Integer",
".",
"MAX_VALUE",
",",
"60L",
",",
"TimeUnit",
".",
"SECONDS",
",",
"new",
"SynchronousQ... | Creates a thread pool that creates new threads as needed, but
will reuse previously constructed threads when they are
available, and uses the provided
ThreadFactory to create new threads when needed.
@param threadFactory the factory to use when creating new threads
@return the newly created thread pool
@throws NullPointerException if threadFactory is null | [
"Creates",
"a",
"thread",
"pool",
"that",
"creates",
"new",
"threads",
"as",
"needed",
"but",
"will",
"reuse",
"previously",
"constructed",
"threads",
"when",
"they",
"are",
"available",
"and",
"uses",
"the",
"provided",
"ThreadFactory",
"to",
"create",
"new",
... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/Executors.java#L234-L239 |
35,044 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/javax/crypto/CipherInputStream.java | CipherInputStream.getMoreData | private int getMoreData() throws IOException {
if (done) return -1;
int readin = input.read(ibuffer);
if (readin == -1) {
done = true;
try {
obuffer = cipher.doFinal();
}
catch (IllegalBlockSizeException e) {obuffer = null;}
catch (BadPaddingException e) {obuffer = null;}
if (obuffer == null)
return -1;
else {
ostart = 0;
ofinish = obuffer.length;
return ofinish;
}
}
try {
obuffer = cipher.update(ibuffer, 0, readin);
} catch (IllegalStateException e) {obuffer = null;};
ostart = 0;
if (obuffer == null)
ofinish = 0;
else ofinish = obuffer.length;
return ofinish;
} | java | private int getMoreData() throws IOException {
if (done) return -1;
int readin = input.read(ibuffer);
if (readin == -1) {
done = true;
try {
obuffer = cipher.doFinal();
}
catch (IllegalBlockSizeException e) {obuffer = null;}
catch (BadPaddingException e) {obuffer = null;}
if (obuffer == null)
return -1;
else {
ostart = 0;
ofinish = obuffer.length;
return ofinish;
}
}
try {
obuffer = cipher.update(ibuffer, 0, readin);
} catch (IllegalStateException e) {obuffer = null;};
ostart = 0;
if (obuffer == null)
ofinish = 0;
else ofinish = obuffer.length;
return ofinish;
} | [
"private",
"int",
"getMoreData",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"done",
")",
"return",
"-",
"1",
";",
"int",
"readin",
"=",
"input",
".",
"read",
"(",
"ibuffer",
")",
";",
"if",
"(",
"readin",
"==",
"-",
"1",
")",
"{",
"done",
... | private convenience function.
Entry condition: ostart = ofinish
Exit condition: ostart <= ofinish
return (ofinish-ostart) (we have this many bytes for you)
return 0 (no data now, but could have more later)
return -1 (absolutely no more data) | [
"private",
"convenience",
"function",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/javax/crypto/CipherInputStream.java#L101-L127 |
35,045 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/TemplateSubPatternAssociation.java | TemplateSubPatternAssociation.matchModes | private boolean matchModes(QName m1, QName m2)
{
return (((null == m1) && (null == m2))
|| ((null != m1) && (null != m2) && m1.equals(m2)));
} | java | private boolean matchModes(QName m1, QName m2)
{
return (((null == m1) && (null == m2))
|| ((null != m1) && (null != m2) && m1.equals(m2)));
} | [
"private",
"boolean",
"matchModes",
"(",
"QName",
"m1",
",",
"QName",
"m2",
")",
"{",
"return",
"(",
"(",
"(",
"null",
"==",
"m1",
")",
"&&",
"(",
"null",
"==",
"m2",
")",
")",
"||",
"(",
"(",
"null",
"!=",
"m1",
")",
"&&",
"(",
"null",
"!=",
... | Tell if two modes match according to the rules of XSLT.
@param m1 First mode to match
@param m2 Second mode to match
@return True if the two given modes match | [
"Tell",
"if",
"two",
"modes",
"match",
"according",
"to",
"the",
"rules",
"of",
"XSLT",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/TemplateSubPatternAssociation.java#L134-L138 |
35,046 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/TemplateSubPatternAssociation.java | TemplateSubPatternAssociation.matches | public boolean matches(XPathContext xctxt, int targetNode, QName mode)
throws TransformerException
{
double score = m_stepPattern.getMatchScore(xctxt, targetNode);
return (XPath.MATCH_SCORE_NONE != score)
&& matchModes(mode, m_template.getMode());
} | java | public boolean matches(XPathContext xctxt, int targetNode, QName mode)
throws TransformerException
{
double score = m_stepPattern.getMatchScore(xctxt, targetNode);
return (XPath.MATCH_SCORE_NONE != score)
&& matchModes(mode, m_template.getMode());
} | [
"public",
"boolean",
"matches",
"(",
"XPathContext",
"xctxt",
",",
"int",
"targetNode",
",",
"QName",
"mode",
")",
"throws",
"TransformerException",
"{",
"double",
"score",
"=",
"m_stepPattern",
".",
"getMatchScore",
"(",
"xctxt",
",",
"targetNode",
")",
";",
... | Return the mode associated with the template.
@param xctxt XPath context to use with this template
@param targetNode Target node
@param mode reference, which may be null, to the <a href="http://www.w3.org/TR/xslt#modes">current mode</a>.
@return The mode associated with the template.
@throws TransformerException | [
"Return",
"the",
"mode",
"associated",
"with",
"the",
"template",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/TemplateSubPatternAssociation.java#L151-L159 |
35,047 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java | ThreadGroup.setMaxPriority | public final void setMaxPriority(int pri) {
int ngroupsSnapshot;
ThreadGroup[] groupsSnapshot;
synchronized (this) {
checkAccess();
// Android-changed: Clamp to MIN_PRIORITY, MAX_PRIORITY.
// if (pri < Thread.MIN_PRIORITY || pri > Thread.MAX_PRIORITY) {
// return;
// }
if (pri < Thread.MIN_PRIORITY) {
pri = Thread.MIN_PRIORITY;
}
if (pri > Thread.MAX_PRIORITY) {
pri = Thread.MAX_PRIORITY;
}
maxPriority = (parent != null) ? Math.min(pri, parent.maxPriority) : pri;
ngroupsSnapshot = ngroups;
if (groups != null) {
groupsSnapshot = Arrays.copyOf(groups, ngroupsSnapshot);
} else {
groupsSnapshot = null;
}
}
for (int i = 0 ; i < ngroupsSnapshot ; i++) {
groupsSnapshot[i].setMaxPriority(pri);
}
} | java | public final void setMaxPriority(int pri) {
int ngroupsSnapshot;
ThreadGroup[] groupsSnapshot;
synchronized (this) {
checkAccess();
// Android-changed: Clamp to MIN_PRIORITY, MAX_PRIORITY.
// if (pri < Thread.MIN_PRIORITY || pri > Thread.MAX_PRIORITY) {
// return;
// }
if (pri < Thread.MIN_PRIORITY) {
pri = Thread.MIN_PRIORITY;
}
if (pri > Thread.MAX_PRIORITY) {
pri = Thread.MAX_PRIORITY;
}
maxPriority = (parent != null) ? Math.min(pri, parent.maxPriority) : pri;
ngroupsSnapshot = ngroups;
if (groups != null) {
groupsSnapshot = Arrays.copyOf(groups, ngroupsSnapshot);
} else {
groupsSnapshot = null;
}
}
for (int i = 0 ; i < ngroupsSnapshot ; i++) {
groupsSnapshot[i].setMaxPriority(pri);
}
} | [
"public",
"final",
"void",
"setMaxPriority",
"(",
"int",
"pri",
")",
"{",
"int",
"ngroupsSnapshot",
";",
"ThreadGroup",
"[",
"]",
"groupsSnapshot",
";",
"synchronized",
"(",
"this",
")",
"{",
"checkAccess",
"(",
")",
";",
"// Android-changed: Clamp to MIN_PRIORITY... | before using it. | [
"before",
"using",
"it",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java#L265-L292 |
35,048 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java | ThreadGroup.parentOf | public final boolean parentOf(ThreadGroup g) {
for (; g != null ; g = g.parent) {
if (g == this) {
return true;
}
}
return false;
} | java | public final boolean parentOf(ThreadGroup g) {
for (; g != null ; g = g.parent) {
if (g == this) {
return true;
}
}
return false;
} | [
"public",
"final",
"boolean",
"parentOf",
"(",
"ThreadGroup",
"g",
")",
"{",
"for",
"(",
";",
"g",
"!=",
"null",
";",
"g",
"=",
"g",
".",
"parent",
")",
"{",
"if",
"(",
"g",
"==",
"this",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
"fa... | Tests if this thread group is either the thread group
argument or one of its ancestor thread groups.
@param g a thread group.
@return <code>true</code> if this thread group is the thread group
argument or one of its ancestor thread groups;
<code>false</code> otherwise.
@since JDK1.0 | [
"Tests",
"if",
"this",
"thread",
"group",
"is",
"either",
"the",
"thread",
"group",
"argument",
"or",
"one",
"of",
"its",
"ancestor",
"thread",
"groups",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java#L304-L311 |
35,049 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java | ThreadGroup.activeCount | public int activeCount() {
int result;
// Snapshot sub-group data so we don't hold this lock
// while our children are computing.
int ngroupsSnapshot;
ThreadGroup[] groupsSnapshot;
synchronized (this) {
if (destroyed) {
return 0;
}
result = nthreads;
ngroupsSnapshot = ngroups;
if (groups != null) {
groupsSnapshot = Arrays.copyOf(groups, ngroupsSnapshot);
} else {
groupsSnapshot = null;
}
}
for (int i = 0 ; i < ngroupsSnapshot ; i++) {
result += groupsSnapshot[i].activeCount();
}
return result;
} | java | public int activeCount() {
int result;
// Snapshot sub-group data so we don't hold this lock
// while our children are computing.
int ngroupsSnapshot;
ThreadGroup[] groupsSnapshot;
synchronized (this) {
if (destroyed) {
return 0;
}
result = nthreads;
ngroupsSnapshot = ngroups;
if (groups != null) {
groupsSnapshot = Arrays.copyOf(groups, ngroupsSnapshot);
} else {
groupsSnapshot = null;
}
}
for (int i = 0 ; i < ngroupsSnapshot ; i++) {
result += groupsSnapshot[i].activeCount();
}
return result;
} | [
"public",
"int",
"activeCount",
"(",
")",
"{",
"int",
"result",
";",
"// Snapshot sub-group data so we don't hold this lock",
"// while our children are computing.",
"int",
"ngroupsSnapshot",
";",
"ThreadGroup",
"[",
"]",
"groupsSnapshot",
";",
"synchronized",
"(",
"this",
... | Returns an estimate of the number of active threads in this thread
group and its subgroups. Recursively iterates over all subgroups in
this thread group.
<p> The value returned is only an estimate because the number of
threads may change dynamically while this method traverses internal
data structures, and might be affected by the presence of certain
system threads. This method is intended primarily for debugging
and monitoring purposes.
@return an estimate of the number of active threads in this thread
group and in any other thread group that has this thread
group as an ancestor
@since JDK1.0 | [
"Returns",
"an",
"estimate",
"of",
"the",
"number",
"of",
"active",
"threads",
"in",
"this",
"thread",
"group",
"and",
"its",
"subgroups",
".",
"Recursively",
"iterates",
"over",
"all",
"subgroups",
"in",
"this",
"thread",
"group",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java#L346-L368 |
35,050 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java | ThreadGroup.activeGroupCount | public int activeGroupCount() {
int ngroupsSnapshot;
ThreadGroup[] groupsSnapshot;
synchronized (this) {
if (destroyed) {
return 0;
}
ngroupsSnapshot = ngroups;
if (groups != null) {
groupsSnapshot = Arrays.copyOf(groups, ngroupsSnapshot);
} else {
groupsSnapshot = null;
}
}
int n = ngroupsSnapshot;
for (int i = 0 ; i < ngroupsSnapshot ; i++) {
n += groupsSnapshot[i].activeGroupCount();
}
return n;
} | java | public int activeGroupCount() {
int ngroupsSnapshot;
ThreadGroup[] groupsSnapshot;
synchronized (this) {
if (destroyed) {
return 0;
}
ngroupsSnapshot = ngroups;
if (groups != null) {
groupsSnapshot = Arrays.copyOf(groups, ngroupsSnapshot);
} else {
groupsSnapshot = null;
}
}
int n = ngroupsSnapshot;
for (int i = 0 ; i < ngroupsSnapshot ; i++) {
n += groupsSnapshot[i].activeGroupCount();
}
return n;
} | [
"public",
"int",
"activeGroupCount",
"(",
")",
"{",
"int",
"ngroupsSnapshot",
";",
"ThreadGroup",
"[",
"]",
"groupsSnapshot",
";",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"destroyed",
")",
"{",
"return",
"0",
";",
"}",
"ngroupsSnapshot",
"=",
"ng... | Returns an estimate of the number of active groups in this
thread group and its subgroups. Recursively iterates over
all subgroups in this thread group.
<p> The value returned is only an estimate because the number of
thread groups may change dynamically while this method traverses
internal data structures. This method is intended primarily for
debugging and monitoring purposes.
@return the number of active thread groups with this thread group as
an ancestor
@since JDK1.0 | [
"Returns",
"an",
"estimate",
"of",
"the",
"number",
"of",
"active",
"groups",
"in",
"this",
"thread",
"group",
"and",
"its",
"subgroups",
".",
"Recursively",
"iterates",
"over",
"all",
"subgroups",
"in",
"this",
"thread",
"group",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java#L483-L502 |
35,051 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java | ThreadGroup.add | private final void add(ThreadGroup g){
synchronized (this) {
if (destroyed) {
throw new IllegalThreadStateException();
}
if (groups == null) {
groups = new ThreadGroup[4];
} else if (ngroups == groups.length) {
groups = Arrays.copyOf(groups, ngroups * 2);
}
groups[ngroups] = g;
// This is done last so it doesn't matter in case the
// thread is killed
ngroups++;
}
} | java | private final void add(ThreadGroup g){
synchronized (this) {
if (destroyed) {
throw new IllegalThreadStateException();
}
if (groups == null) {
groups = new ThreadGroup[4];
} else if (ngroups == groups.length) {
groups = Arrays.copyOf(groups, ngroups * 2);
}
groups[ngroups] = g;
// This is done last so it doesn't matter in case the
// thread is killed
ngroups++;
}
} | [
"private",
"final",
"void",
"add",
"(",
"ThreadGroup",
"g",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"destroyed",
")",
"{",
"throw",
"new",
"IllegalThreadStateException",
"(",
")",
";",
"}",
"if",
"(",
"groups",
"==",
"null",
")",
"{... | Adds the specified Thread group to this group.
@param g the specified Thread group to be added
@exception IllegalThreadStateException If the Thread group has been destroyed. | [
"Adds",
"the",
"specified",
"Thread",
"group",
"to",
"this",
"group",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java#L817-L833 |
35,052 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java | ThreadGroup.remove | private void remove(ThreadGroup g) {
synchronized (this) {
if (destroyed) {
return;
}
for (int i = 0 ; i < ngroups ; i++) {
if (groups[i] == g) {
ngroups -= 1;
System.arraycopy(groups, i + 1, groups, i, ngroups - i);
// Zap dangling reference to the dead group so that
// the garbage collector will collect it.
groups[ngroups] = null;
break;
}
}
if (nthreads == 0) {
notifyAll();
}
if (daemon && (nthreads == 0) &&
(nUnstartedThreads == 0) && (ngroups == 0))
{
destroy();
}
}
} | java | private void remove(ThreadGroup g) {
synchronized (this) {
if (destroyed) {
return;
}
for (int i = 0 ; i < ngroups ; i++) {
if (groups[i] == g) {
ngroups -= 1;
System.arraycopy(groups, i + 1, groups, i, ngroups - i);
// Zap dangling reference to the dead group so that
// the garbage collector will collect it.
groups[ngroups] = null;
break;
}
}
if (nthreads == 0) {
notifyAll();
}
if (daemon && (nthreads == 0) &&
(nUnstartedThreads == 0) && (ngroups == 0))
{
destroy();
}
}
} | [
"private",
"void",
"remove",
"(",
"ThreadGroup",
"g",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"destroyed",
")",
"{",
"return",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"ngroups",
";",
"i",
"++",
")",
"{",
"... | Removes the specified Thread group from this group.
@param g the Thread group to be removed
@return if this Thread has already been destroyed. | [
"Removes",
"the",
"specified",
"Thread",
"group",
"from",
"this",
"group",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java#L840-L864 |
35,053 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java | ThreadGroup.add | void add(Thread t) {
synchronized (this) {
if (destroyed) {
throw new IllegalThreadStateException();
}
if (threads == null) {
threads = new Thread[4];
} else if (nthreads == threads.length) {
threads = Arrays.copyOf(threads, nthreads * 2);
}
threads[nthreads] = t;
// This is done last so it doesn't matter in case the
// thread is killed
nthreads++;
// The thread is now a fully fledged member of the group, even
// though it may, or may not, have been started yet. It will prevent
// the group from being destroyed so the unstarted Threads count is
// decremented.
nUnstartedThreads--;
}
} | java | void add(Thread t) {
synchronized (this) {
if (destroyed) {
throw new IllegalThreadStateException();
}
if (threads == null) {
threads = new Thread[4];
} else if (nthreads == threads.length) {
threads = Arrays.copyOf(threads, nthreads * 2);
}
threads[nthreads] = t;
// This is done last so it doesn't matter in case the
// thread is killed
nthreads++;
// The thread is now a fully fledged member of the group, even
// though it may, or may not, have been started yet. It will prevent
// the group from being destroyed so the unstarted Threads count is
// decremented.
nUnstartedThreads--;
}
} | [
"void",
"add",
"(",
"Thread",
"t",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"destroyed",
")",
"{",
"throw",
"new",
"IllegalThreadStateException",
"(",
")",
";",
"}",
"if",
"(",
"threads",
"==",
"null",
")",
"{",
"threads",
"=",
"ne... | Adds the specified thread to this thread group.
<p> Note: This method is called from both library code
and the Virtual Machine. It is called from VM to add
certain system threads to the system thread group.
@param t
the Thread to be added
@throws IllegalThreadStateException
if the Thread group has been destroyed | [
"Adds",
"the",
"specified",
"thread",
"to",
"this",
"thread",
"group",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java#L896-L918 |
35,054 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java | ThreadGroup.remove | private void remove(Thread t) {
synchronized (this) {
if (destroyed) {
return;
}
for (int i = 0 ; i < nthreads ; i++) {
if (threads[i] == t) {
System.arraycopy(threads, i + 1, threads, i, --nthreads - i);
// Zap dangling reference to the dead thread so that
// the garbage collector will collect it.
threads[nthreads] = null;
break;
}
}
}
} | java | private void remove(Thread t) {
synchronized (this) {
if (destroyed) {
return;
}
for (int i = 0 ; i < nthreads ; i++) {
if (threads[i] == t) {
System.arraycopy(threads, i + 1, threads, i, --nthreads - i);
// Zap dangling reference to the dead thread so that
// the garbage collector will collect it.
threads[nthreads] = null;
break;
}
}
}
} | [
"private",
"void",
"remove",
"(",
"Thread",
"t",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"destroyed",
")",
"{",
"return",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"nthreads",
";",
"i",
"++",
")",
"{",
"if",... | Removes the specified Thread from this group. Invoking this method
on a thread group that has been destroyed has no effect.
@param t
the Thread to be removed | [
"Removes",
"the",
"specified",
"Thread",
"from",
"this",
"group",
".",
"Invoking",
"this",
"method",
"on",
"a",
"thread",
"group",
"that",
"has",
"been",
"destroyed",
"has",
"no",
"effect",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadGroup.java#L972-L987 |
35,055 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.getCharFromName | public int getCharFromName(int choice, String name)
{
// checks for illegal arguments
if (choice >= UCharacterNameChoice.CHAR_NAME_CHOICE_COUNT ||
name == null || name.length() == 0) {
return -1;
}
// try extended names first
int result = getExtendedChar(name.toLowerCase(Locale.ENGLISH), choice);
if (result >= -1) {
return result;
}
String upperCaseName = name.toUpperCase(Locale.ENGLISH);
// try algorithmic names first, if fails then try group names
// int result = getAlgorithmChar(choice, uppercasename);
if (choice == UCharacterNameChoice.UNICODE_CHAR_NAME ||
choice == UCharacterNameChoice.EXTENDED_CHAR_NAME
) {
int count = 0;
if (m_algorithm_ != null) {
count = m_algorithm_.length;
}
for (count --; count >= 0; count --) {
result = m_algorithm_[count].getChar(upperCaseName);
if (result >= 0) {
return result;
}
}
}
if (choice == UCharacterNameChoice.EXTENDED_CHAR_NAME) {
result = getGroupChar(upperCaseName,
UCharacterNameChoice.UNICODE_CHAR_NAME);
if (result == -1) {
result = getGroupChar(upperCaseName,
UCharacterNameChoice.CHAR_NAME_ALIAS);
}
}
else {
result = getGroupChar(upperCaseName, choice);
}
return result;
} | java | public int getCharFromName(int choice, String name)
{
// checks for illegal arguments
if (choice >= UCharacterNameChoice.CHAR_NAME_CHOICE_COUNT ||
name == null || name.length() == 0) {
return -1;
}
// try extended names first
int result = getExtendedChar(name.toLowerCase(Locale.ENGLISH), choice);
if (result >= -1) {
return result;
}
String upperCaseName = name.toUpperCase(Locale.ENGLISH);
// try algorithmic names first, if fails then try group names
// int result = getAlgorithmChar(choice, uppercasename);
if (choice == UCharacterNameChoice.UNICODE_CHAR_NAME ||
choice == UCharacterNameChoice.EXTENDED_CHAR_NAME
) {
int count = 0;
if (m_algorithm_ != null) {
count = m_algorithm_.length;
}
for (count --; count >= 0; count --) {
result = m_algorithm_[count].getChar(upperCaseName);
if (result >= 0) {
return result;
}
}
}
if (choice == UCharacterNameChoice.EXTENDED_CHAR_NAME) {
result = getGroupChar(upperCaseName,
UCharacterNameChoice.UNICODE_CHAR_NAME);
if (result == -1) {
result = getGroupChar(upperCaseName,
UCharacterNameChoice.CHAR_NAME_ALIAS);
}
}
else {
result = getGroupChar(upperCaseName, choice);
}
return result;
} | [
"public",
"int",
"getCharFromName",
"(",
"int",
"choice",
",",
"String",
"name",
")",
"{",
"// checks for illegal arguments",
"if",
"(",
"choice",
">=",
"UCharacterNameChoice",
".",
"CHAR_NAME_CHOICE_COUNT",
"||",
"name",
"==",
"null",
"||",
"name",
".",
"length",... | Find a character by its name and return its code point value
@param choice selector to indicate if argument name is a Unicode 1.0
or the most current version
@param name the name to search for
@return code point | [
"Find",
"a",
"character",
"by",
"its",
"name",
"and",
"return",
"its",
"code",
"point",
"value"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L112-L157 |
35,056 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.getExtendedName | public String getExtendedName(int ch)
{
String result = getName(ch, UCharacterNameChoice.UNICODE_CHAR_NAME);
if (result == null) {
// TODO: Return Name_Alias/control names for control codes 0..1F & 7F..9F.
result = getExtendedOr10Name(ch);
}
return result;
} | java | public String getExtendedName(int ch)
{
String result = getName(ch, UCharacterNameChoice.UNICODE_CHAR_NAME);
if (result == null) {
// TODO: Return Name_Alias/control names for control codes 0..1F & 7F..9F.
result = getExtendedOr10Name(ch);
}
return result;
} | [
"public",
"String",
"getExtendedName",
"(",
"int",
"ch",
")",
"{",
"String",
"result",
"=",
"getName",
"(",
"ch",
",",
"UCharacterNameChoice",
".",
"UNICODE_CHAR_NAME",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"// TODO: Return Name_Alias/control na... | Retrieves the extended name | [
"Retrieves",
"the",
"extended",
"name"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L317-L325 |
35,057 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.getGroup | public int getGroup(int codepoint)
{
int endGroup = m_groupcount_;
int msb = getCodepointMSB(codepoint);
int result = 0;
// binary search for the group of names that contains the one for
// code
// find the group that contains codepoint, or the highest before it
while (result < endGroup - 1) {
int gindex = (result + endGroup) >> 1;
if (msb < getGroupMSB(gindex)) {
endGroup = gindex;
}
else {
result = gindex;
}
}
return result;
} | java | public int getGroup(int codepoint)
{
int endGroup = m_groupcount_;
int msb = getCodepointMSB(codepoint);
int result = 0;
// binary search for the group of names that contains the one for
// code
// find the group that contains codepoint, or the highest before it
while (result < endGroup - 1) {
int gindex = (result + endGroup) >> 1;
if (msb < getGroupMSB(gindex)) {
endGroup = gindex;
}
else {
result = gindex;
}
}
return result;
} | [
"public",
"int",
"getGroup",
"(",
"int",
"codepoint",
")",
"{",
"int",
"endGroup",
"=",
"m_groupcount_",
";",
"int",
"msb",
"=",
"getCodepointMSB",
"(",
"codepoint",
")",
";",
"int",
"result",
"=",
"0",
";",
"// binary search for the group of names that contains t... | Gets the group index for the codepoint, or the group before it.
@param codepoint The codepoint index.
@return group index containing codepoint or the group before it. | [
"Gets",
"the",
"group",
"index",
"for",
"the",
"codepoint",
"or",
"the",
"group",
"before",
"it",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L332-L350 |
35,058 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.getExtendedOr10Name | public String getExtendedOr10Name(int ch)
{
String result = null;
// TODO: Return Name_Alias/control names for control codes 0..1F & 7F..9F.
if (result == null) {
int type = getType(ch);
// Return unknown if the table of names above is not up to
// date.
if (type >= TYPE_NAMES_.length) {
result = UNKNOWN_TYPE_NAME_;
}
else {
result = TYPE_NAMES_[type];
}
synchronized (m_utilStringBuffer_) {
m_utilStringBuffer_.setLength(0);
m_utilStringBuffer_.append('<');
m_utilStringBuffer_.append(result);
m_utilStringBuffer_.append('-');
String chStr = Integer.toHexString(ch).toUpperCase(Locale.ENGLISH);
int zeros = 4 - chStr.length();
while (zeros > 0) {
m_utilStringBuffer_.append('0');
zeros --;
}
m_utilStringBuffer_.append(chStr);
m_utilStringBuffer_.append('>');
result = m_utilStringBuffer_.toString();
}
}
return result;
} | java | public String getExtendedOr10Name(int ch)
{
String result = null;
// TODO: Return Name_Alias/control names for control codes 0..1F & 7F..9F.
if (result == null) {
int type = getType(ch);
// Return unknown if the table of names above is not up to
// date.
if (type >= TYPE_NAMES_.length) {
result = UNKNOWN_TYPE_NAME_;
}
else {
result = TYPE_NAMES_[type];
}
synchronized (m_utilStringBuffer_) {
m_utilStringBuffer_.setLength(0);
m_utilStringBuffer_.append('<');
m_utilStringBuffer_.append(result);
m_utilStringBuffer_.append('-');
String chStr = Integer.toHexString(ch).toUpperCase(Locale.ENGLISH);
int zeros = 4 - chStr.length();
while (zeros > 0) {
m_utilStringBuffer_.append('0');
zeros --;
}
m_utilStringBuffer_.append(chStr);
m_utilStringBuffer_.append('>');
result = m_utilStringBuffer_.toString();
}
}
return result;
} | [
"public",
"String",
"getExtendedOr10Name",
"(",
"int",
"ch",
")",
"{",
"String",
"result",
"=",
"null",
";",
"// TODO: Return Name_Alias/control names for control codes 0..1F & 7F..9F.",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"int",
"type",
"=",
"getType",
"("... | Gets the extended and 1.0 name when the most current unicode names
fail
@param ch codepoint
@return name of codepoint extended or 1.0 | [
"Gets",
"the",
"extended",
"and",
"1",
".",
"0",
"name",
"when",
"the",
"most",
"current",
"unicode",
"names",
"fail"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L358-L389 |
35,059 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.getAlgorithmName | public String getAlgorithmName(int index, int codepoint)
{
String result = null;
synchronized (m_utilStringBuffer_) {
m_utilStringBuffer_.setLength(0);
m_algorithm_[index].appendName(codepoint, m_utilStringBuffer_);
result = m_utilStringBuffer_.toString();
}
return result;
} | java | public String getAlgorithmName(int index, int codepoint)
{
String result = null;
synchronized (m_utilStringBuffer_) {
m_utilStringBuffer_.setLength(0);
m_algorithm_[index].appendName(codepoint, m_utilStringBuffer_);
result = m_utilStringBuffer_.toString();
}
return result;
} | [
"public",
"String",
"getAlgorithmName",
"(",
"int",
"index",
",",
"int",
"codepoint",
")",
"{",
"String",
"result",
"=",
"null",
";",
"synchronized",
"(",
"m_utilStringBuffer_",
")",
"{",
"m_utilStringBuffer_",
".",
"setLength",
"(",
"0",
")",
";",
"m_algorith... | Gets the Algorithmic name of the codepoint
@param index algorithmic range index
@param codepoint The codepoint value.
@return algorithmic name of codepoint | [
"Gets",
"the",
"Algorithmic",
"name",
"of",
"the",
"codepoint"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L491-L500 |
35,060 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.getGroupName | public synchronized String getGroupName(int ch, int choice)
{
// gets the msb
int msb = getCodepointMSB(ch);
int group = getGroup(ch);
// return this if it is an exact match
if (msb == m_groupinfo_[group * m_groupsize_]) {
int index = getGroupLengths(group, m_groupoffsets_,
m_grouplengths_);
int offset = ch & GROUP_MASK_;
return getGroupName(index + m_groupoffsets_[offset],
m_grouplengths_[offset], choice);
}
return null;
} | java | public synchronized String getGroupName(int ch, int choice)
{
// gets the msb
int msb = getCodepointMSB(ch);
int group = getGroup(ch);
// return this if it is an exact match
if (msb == m_groupinfo_[group * m_groupsize_]) {
int index = getGroupLengths(group, m_groupoffsets_,
m_grouplengths_);
int offset = ch & GROUP_MASK_;
return getGroupName(index + m_groupoffsets_[offset],
m_grouplengths_[offset], choice);
}
return null;
} | [
"public",
"synchronized",
"String",
"getGroupName",
"(",
"int",
"ch",
",",
"int",
"choice",
")",
"{",
"// gets the msb",
"int",
"msb",
"=",
"getCodepointMSB",
"(",
"ch",
")",
";",
"int",
"group",
"=",
"getGroup",
"(",
"ch",
")",
";",
"// return this if it is... | Gets the group name of the character
@param ch character to get the group name
@param choice name choice selector to choose a unicode 1.0 or newer name | [
"Gets",
"the",
"group",
"name",
"of",
"the",
"character"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L507-L523 |
35,061 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.setToken | boolean setToken(char token[], byte tokenstring[])
{
if (token != null && tokenstring != null && token.length > 0 &&
tokenstring.length > 0) {
m_tokentable_ = token;
m_tokenstring_ = tokenstring;
return true;
}
return false;
} | java | boolean setToken(char token[], byte tokenstring[])
{
if (token != null && tokenstring != null && token.length > 0 &&
tokenstring.length > 0) {
m_tokentable_ = token;
m_tokenstring_ = tokenstring;
return true;
}
return false;
} | [
"boolean",
"setToken",
"(",
"char",
"token",
"[",
"]",
",",
"byte",
"tokenstring",
"[",
"]",
")",
"{",
"if",
"(",
"token",
"!=",
"null",
"&&",
"tokenstring",
"!=",
"null",
"&&",
"token",
".",
"length",
">",
"0",
"&&",
"tokenstring",
".",
"length",
">... | Sets the token data
@param token array of tokens
@param tokenstring array of string values of the tokens
@return false if there is a data error | [
"Sets",
"the",
"token",
"data"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L965-L974 |
35,062 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.setAlgorithm | boolean setAlgorithm(AlgorithmName alg[])
{
if (alg != null && alg.length != 0) {
m_algorithm_ = alg;
return true;
}
return false;
} | java | boolean setAlgorithm(AlgorithmName alg[])
{
if (alg != null && alg.length != 0) {
m_algorithm_ = alg;
return true;
}
return false;
} | [
"boolean",
"setAlgorithm",
"(",
"AlgorithmName",
"alg",
"[",
"]",
")",
"{",
"if",
"(",
"alg",
"!=",
"null",
"&&",
"alg",
".",
"length",
"!=",
"0",
")",
"{",
"m_algorithm_",
"=",
"alg",
";",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
] | Set the algorithm name information array
@param alg Algorithm information array
@return true if the group string offset has been set correctly | [
"Set",
"the",
"algorithm",
"name",
"information",
"array"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L981-L988 |
35,063 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.setGroupCountSize | boolean setGroupCountSize(int count, int size)
{
if (count <= 0 || size <= 0) {
return false;
}
m_groupcount_ = count;
m_groupsize_ = size;
return true;
} | java | boolean setGroupCountSize(int count, int size)
{
if (count <= 0 || size <= 0) {
return false;
}
m_groupcount_ = count;
m_groupsize_ = size;
return true;
} | [
"boolean",
"setGroupCountSize",
"(",
"int",
"count",
",",
"int",
"size",
")",
"{",
"if",
"(",
"count",
"<=",
"0",
"||",
"size",
"<=",
"0",
")",
"{",
"return",
"false",
";",
"}",
"m_groupcount_",
"=",
"count",
";",
"m_groupsize_",
"=",
"size",
";",
"r... | Sets the number of group and size of each group in number of char
@param count number of groups
@param size size of group in char
@return true if group size is set correctly | [
"Sets",
"the",
"number",
"of",
"group",
"and",
"size",
"of",
"each",
"group",
"in",
"number",
"of",
"char"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L996-L1004 |
35,064 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.setGroup | boolean setGroup(char group[], byte groupstring[])
{
if (group != null && groupstring != null && group.length > 0 &&
groupstring.length > 0) {
m_groupinfo_ = group;
m_groupstring_ = groupstring;
return true;
}
return false;
} | java | boolean setGroup(char group[], byte groupstring[])
{
if (group != null && groupstring != null && group.length > 0 &&
groupstring.length > 0) {
m_groupinfo_ = group;
m_groupstring_ = groupstring;
return true;
}
return false;
} | [
"boolean",
"setGroup",
"(",
"char",
"group",
"[",
"]",
",",
"byte",
"groupstring",
"[",
"]",
")",
"{",
"if",
"(",
"group",
"!=",
"null",
"&&",
"groupstring",
"!=",
"null",
"&&",
"group",
".",
"length",
">",
"0",
"&&",
"groupstring",
".",
"length",
">... | Sets the group name data
@param group index information array
@param groupstring name information array
@return false if there is a data error | [
"Sets",
"the",
"group",
"name",
"data"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L1012-L1021 |
35,065 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.getAlgName | private String getAlgName(int ch, int choice)
{
/* Only the normative character name can be algorithmic. */
if (choice == UCharacterNameChoice.UNICODE_CHAR_NAME ||
choice == UCharacterNameChoice.EXTENDED_CHAR_NAME
) {
// index in terms integer index
synchronized (m_utilStringBuffer_) {
m_utilStringBuffer_.setLength(0);
for (int index = m_algorithm_.length - 1; index >= 0; index --)
{
if (m_algorithm_[index].contains(ch)) {
m_algorithm_[index].appendName(ch, m_utilStringBuffer_);
return m_utilStringBuffer_.toString();
}
}
}
}
return null;
} | java | private String getAlgName(int ch, int choice)
{
/* Only the normative character name can be algorithmic. */
if (choice == UCharacterNameChoice.UNICODE_CHAR_NAME ||
choice == UCharacterNameChoice.EXTENDED_CHAR_NAME
) {
// index in terms integer index
synchronized (m_utilStringBuffer_) {
m_utilStringBuffer_.setLength(0);
for (int index = m_algorithm_.length - 1; index >= 0; index --)
{
if (m_algorithm_[index].contains(ch)) {
m_algorithm_[index].appendName(ch, m_utilStringBuffer_);
return m_utilStringBuffer_.toString();
}
}
}
}
return null;
} | [
"private",
"String",
"getAlgName",
"(",
"int",
"ch",
",",
"int",
"choice",
")",
"{",
"/* Only the normative character name can be algorithmic. */",
"if",
"(",
"choice",
"==",
"UCharacterNameChoice",
".",
"UNICODE_CHAR_NAME",
"||",
"choice",
"==",
"UCharacterNameChoice",
... | Gets the algorithmic name for the argument character
@param ch character to determine name for
@param choice name choice
@return the algorithmic name or null if not found | [
"Gets",
"the",
"algorithmic",
"name",
"for",
"the",
"argument",
"character"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L1185-L1205 |
35,066 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.getGroupChar | private synchronized int getGroupChar(String name, int choice)
{
for (int i = 0; i < m_groupcount_; i ++) {
// populating the data set of grouptable
int startgpstrindex = getGroupLengths(i, m_groupoffsets_,
m_grouplengths_);
// shift out to function
int result = getGroupChar(startgpstrindex, m_grouplengths_, name,
choice);
if (result != -1) {
return (m_groupinfo_[i * m_groupsize_] << GROUP_SHIFT_)
| result;
}
}
return -1;
} | java | private synchronized int getGroupChar(String name, int choice)
{
for (int i = 0; i < m_groupcount_; i ++) {
// populating the data set of grouptable
int startgpstrindex = getGroupLengths(i, m_groupoffsets_,
m_grouplengths_);
// shift out to function
int result = getGroupChar(startgpstrindex, m_grouplengths_, name,
choice);
if (result != -1) {
return (m_groupinfo_[i * m_groupsize_] << GROUP_SHIFT_)
| result;
}
}
return -1;
} | [
"private",
"synchronized",
"int",
"getGroupChar",
"(",
"String",
"name",
",",
"int",
"choice",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"m_groupcount_",
";",
"i",
"++",
")",
"{",
"// populating the data set of grouptable",
"int",
"startgpst... | Getting the character with the tokenized argument name
@param name of the character
@return character with the tokenized argument name or -1 if character
is not found | [
"Getting",
"the",
"character",
"with",
"the",
"tokenized",
"argument",
"name"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L1213-L1230 |
35,067 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.getGroupChar | private int getGroupChar(int index, char length[], String name,
int choice)
{
byte b = 0;
char token;
int len;
int namelen = name.length();
int nindex;
int count;
for (int result = 0; result <= LINES_PER_GROUP_; result ++) {
nindex = 0;
len = length[result];
if (choice != UCharacterNameChoice.UNICODE_CHAR_NAME &&
choice != UCharacterNameChoice.EXTENDED_CHAR_NAME
) {
/*
* skip the modern name if it is not requested _and_
* if the semicolon byte value is a character, not a token number
*/
int fieldIndex= choice==UCharacterNameChoice.ISO_COMMENT_ ? 2 : choice;
do {
int oldindex = index;
index += UCharacterUtility.skipByteSubString(m_groupstring_,
index, len, (byte)';');
len -= (index - oldindex);
} while(--fieldIndex>0);
}
// number of tokens is > the length of the name
// write each letter directly, and write a token word per token
for (count = 0; count < len && nindex != -1 && nindex < namelen;
) {
b = m_groupstring_[index + count];
count ++;
if (b >= m_tokentable_.length) {
if (name.charAt(nindex ++) != (b & 0xFF)) {
nindex = -1;
}
}
else {
token = m_tokentable_[b & 0xFF];
if (token == 0xFFFE) {
// this is a lead byte for a double-byte token
token = m_tokentable_[b << 8 |
(m_groupstring_[index + count] & 0x00ff)];
count ++;
}
if (token == 0xFFFF) {
if (name.charAt(nindex ++) != (b & 0xFF)) {
nindex = -1;
}
}
else {
// compare token with name
nindex = UCharacterUtility.compareNullTermByteSubString(
name, m_tokenstring_, nindex, token);
}
}
}
if (namelen == nindex &&
(count == len || m_groupstring_[index + count] == ';')) {
return result;
}
index += len;
}
return -1;
} | java | private int getGroupChar(int index, char length[], String name,
int choice)
{
byte b = 0;
char token;
int len;
int namelen = name.length();
int nindex;
int count;
for (int result = 0; result <= LINES_PER_GROUP_; result ++) {
nindex = 0;
len = length[result];
if (choice != UCharacterNameChoice.UNICODE_CHAR_NAME &&
choice != UCharacterNameChoice.EXTENDED_CHAR_NAME
) {
/*
* skip the modern name if it is not requested _and_
* if the semicolon byte value is a character, not a token number
*/
int fieldIndex= choice==UCharacterNameChoice.ISO_COMMENT_ ? 2 : choice;
do {
int oldindex = index;
index += UCharacterUtility.skipByteSubString(m_groupstring_,
index, len, (byte)';');
len -= (index - oldindex);
} while(--fieldIndex>0);
}
// number of tokens is > the length of the name
// write each letter directly, and write a token word per token
for (count = 0; count < len && nindex != -1 && nindex < namelen;
) {
b = m_groupstring_[index + count];
count ++;
if (b >= m_tokentable_.length) {
if (name.charAt(nindex ++) != (b & 0xFF)) {
nindex = -1;
}
}
else {
token = m_tokentable_[b & 0xFF];
if (token == 0xFFFE) {
// this is a lead byte for a double-byte token
token = m_tokentable_[b << 8 |
(m_groupstring_[index + count] & 0x00ff)];
count ++;
}
if (token == 0xFFFF) {
if (name.charAt(nindex ++) != (b & 0xFF)) {
nindex = -1;
}
}
else {
// compare token with name
nindex = UCharacterUtility.compareNullTermByteSubString(
name, m_tokenstring_, nindex, token);
}
}
}
if (namelen == nindex &&
(count == len || m_groupstring_[index + count] == ';')) {
return result;
}
index += len;
}
return -1;
} | [
"private",
"int",
"getGroupChar",
"(",
"int",
"index",
",",
"char",
"length",
"[",
"]",
",",
"String",
"name",
",",
"int",
"choice",
")",
"{",
"byte",
"b",
"=",
"0",
";",
"char",
"token",
";",
"int",
"len",
";",
"int",
"namelen",
"=",
"name",
".",
... | Compares and retrieve character if name is found within the argument
group
@param index index where the set of names reside in the group block
@param length list of lengths of the strings
@param name character name to search for
@param choice of either 1.0 or the most current unicode name
@return relative character in the group which matches name, otherwise if
not found, -1 will be returned | [
"Compares",
"and",
"retrieve",
"character",
"if",
"name",
"is",
"found",
"within",
"the",
"argument",
"group"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L1242-L1313 |
35,068 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.getType | private static int getType(int ch)
{
if (UCharacterUtility.isNonCharacter(ch)) {
// not a character we return a invalid category count
return NON_CHARACTER_;
}
int result = UCharacter.getType(ch);
if (result == UCharacterCategory.SURROGATE) {
if (ch <= UTF16.LEAD_SURROGATE_MAX_VALUE) {
result = LEAD_SURROGATE_;
}
else {
result = TRAIL_SURROGATE_;
}
}
return result;
} | java | private static int getType(int ch)
{
if (UCharacterUtility.isNonCharacter(ch)) {
// not a character we return a invalid category count
return NON_CHARACTER_;
}
int result = UCharacter.getType(ch);
if (result == UCharacterCategory.SURROGATE) {
if (ch <= UTF16.LEAD_SURROGATE_MAX_VALUE) {
result = LEAD_SURROGATE_;
}
else {
result = TRAIL_SURROGATE_;
}
}
return result;
} | [
"private",
"static",
"int",
"getType",
"(",
"int",
"ch",
")",
"{",
"if",
"(",
"UCharacterUtility",
".",
"isNonCharacter",
"(",
"ch",
")",
")",
"{",
"// not a character we return a invalid category count",
"return",
"NON_CHARACTER_",
";",
"}",
"int",
"result",
"=",... | Gets the character extended type
@param ch character to be tested
@return extended type it is associated with | [
"Gets",
"the",
"character",
"extended",
"type"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L1320-L1336 |
35,069 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.addAlgorithmName | private int addAlgorithmName(int maxlength)
{
int result = 0;
for (int i = m_algorithm_.length - 1; i >= 0; i --) {
result = m_algorithm_[i].add(m_nameSet_, maxlength);
if (result > maxlength) {
maxlength = result;
}
}
return maxlength;
} | java | private int addAlgorithmName(int maxlength)
{
int result = 0;
for (int i = m_algorithm_.length - 1; i >= 0; i --) {
result = m_algorithm_[i].add(m_nameSet_, maxlength);
if (result > maxlength) {
maxlength = result;
}
}
return maxlength;
} | [
"private",
"int",
"addAlgorithmName",
"(",
"int",
"maxlength",
")",
"{",
"int",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"m_algorithm_",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"result",
"=",
"m_algorith... | Adds all algorithmic names into the name set.
Equivalent to part of calcAlgNameSetsLengths.
@param maxlength length to compare to
@return the maximum length of any possible algorithmic name if it is >
maxlength, otherwise maxlength is returned. | [
"Adds",
"all",
"algorithmic",
"names",
"into",
"the",
"name",
"set",
".",
"Equivalent",
"to",
"part",
"of",
"calcAlgNameSetsLengths",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L1447-L1457 |
35,070 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.addExtendedName | private int addExtendedName(int maxlength)
{
for (int i = TYPE_NAMES_.length - 1; i >= 0; i --) {
// for each category, count the length of the category name
// plus 9 =
// 2 for <>
// 1 for -
// 6 for most hex digits per code point
int length = 9 + add(m_nameSet_, TYPE_NAMES_[i]);
if (length > maxlength) {
maxlength = length;
}
}
return maxlength;
} | java | private int addExtendedName(int maxlength)
{
for (int i = TYPE_NAMES_.length - 1; i >= 0; i --) {
// for each category, count the length of the category name
// plus 9 =
// 2 for <>
// 1 for -
// 6 for most hex digits per code point
int length = 9 + add(m_nameSet_, TYPE_NAMES_[i]);
if (length > maxlength) {
maxlength = length;
}
}
return maxlength;
} | [
"private",
"int",
"addExtendedName",
"(",
"int",
"maxlength",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"TYPE_NAMES_",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"// for each category, count the length of the category name",
"// plus ... | Adds all extended names into the name set.
Equivalent to part of calcExtNameSetsLengths.
@param maxlength length to compare to
@return the maxlength of any possible extended name. | [
"Adds",
"all",
"extended",
"names",
"into",
"the",
"name",
"set",
".",
"Equivalent",
"to",
"part",
"of",
"calcExtNameSetsLengths",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L1465-L1479 |
35,071 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.addGroupName | private int[] addGroupName(int offset, int length, byte tokenlength[],
int set[])
{
int resultnlength = 0;
int resultplength = 0;
while (resultplength < length) {
char b = (char)(m_groupstring_[offset + resultplength] & 0xff);
resultplength ++;
if (b == ';') {
break;
}
if (b >= m_tokentable_.length) {
add(set, b); // implicit letter
resultnlength ++;
}
else {
char token = m_tokentable_[b & 0x00ff];
if (token == 0xFFFE) {
// this is a lead byte for a double-byte token
b = (char)(b << 8 | (m_groupstring_[offset + resultplength]
& 0x00ff));
token = m_tokentable_[b];
resultplength ++;
}
if (token == 0xFFFF) {
add(set, b);
resultnlength ++;
}
else {
// count token word
// use cached token length
byte tlength = tokenlength[b];
if (tlength == 0) {
synchronized (m_utilStringBuffer_) {
m_utilStringBuffer_.setLength(0);
UCharacterUtility.getNullTermByteSubString(
m_utilStringBuffer_, m_tokenstring_,
token);
tlength = (byte)add(set, m_utilStringBuffer_);
}
tokenlength[b] = tlength;
}
resultnlength += tlength;
}
}
}
m_utilIntBuffer_[0] = resultnlength;
m_utilIntBuffer_[1] = resultplength;
return m_utilIntBuffer_;
} | java | private int[] addGroupName(int offset, int length, byte tokenlength[],
int set[])
{
int resultnlength = 0;
int resultplength = 0;
while (resultplength < length) {
char b = (char)(m_groupstring_[offset + resultplength] & 0xff);
resultplength ++;
if (b == ';') {
break;
}
if (b >= m_tokentable_.length) {
add(set, b); // implicit letter
resultnlength ++;
}
else {
char token = m_tokentable_[b & 0x00ff];
if (token == 0xFFFE) {
// this is a lead byte for a double-byte token
b = (char)(b << 8 | (m_groupstring_[offset + resultplength]
& 0x00ff));
token = m_tokentable_[b];
resultplength ++;
}
if (token == 0xFFFF) {
add(set, b);
resultnlength ++;
}
else {
// count token word
// use cached token length
byte tlength = tokenlength[b];
if (tlength == 0) {
synchronized (m_utilStringBuffer_) {
m_utilStringBuffer_.setLength(0);
UCharacterUtility.getNullTermByteSubString(
m_utilStringBuffer_, m_tokenstring_,
token);
tlength = (byte)add(set, m_utilStringBuffer_);
}
tokenlength[b] = tlength;
}
resultnlength += tlength;
}
}
}
m_utilIntBuffer_[0] = resultnlength;
m_utilIntBuffer_[1] = resultplength;
return m_utilIntBuffer_;
} | [
"private",
"int",
"[",
"]",
"addGroupName",
"(",
"int",
"offset",
",",
"int",
"length",
",",
"byte",
"tokenlength",
"[",
"]",
",",
"int",
"set",
"[",
"]",
")",
"{",
"int",
"resultnlength",
"=",
"0",
";",
"int",
"resultplength",
"=",
"0",
";",
"while"... | Adds names of a group to the argument set.
Equivalent to calcNameSetLength.
@param offset of the group name string in byte count
@param length of the group name string
@param tokenlength array to store the length of each token
@param set to add to
@return the length of the name string and the length of the group
string parsed | [
"Adds",
"names",
"of",
"a",
"group",
"to",
"the",
"argument",
"set",
".",
"Equivalent",
"to",
"calcNameSetLength",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L1491-L1541 |
35,072 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.initNameSetsLengths | private boolean initNameSetsLengths()
{
if (m_maxNameLength_ > 0) {
return true;
}
String extra = "0123456789ABCDEF<>-";
// set hex digits, used in various names, and <>-, used in extended
// names
for (int i = extra.length() - 1; i >= 0; i --) {
add(m_nameSet_, extra.charAt(i));
}
// set sets and lengths from algorithmic names
m_maxNameLength_ = addAlgorithmName(0);
// set sets and lengths from extended names
m_maxNameLength_ = addExtendedName(m_maxNameLength_);
// set sets and lengths from group names, set global maximum values
addGroupName(m_maxNameLength_);
return true;
} | java | private boolean initNameSetsLengths()
{
if (m_maxNameLength_ > 0) {
return true;
}
String extra = "0123456789ABCDEF<>-";
// set hex digits, used in various names, and <>-, used in extended
// names
for (int i = extra.length() - 1; i >= 0; i --) {
add(m_nameSet_, extra.charAt(i));
}
// set sets and lengths from algorithmic names
m_maxNameLength_ = addAlgorithmName(0);
// set sets and lengths from extended names
m_maxNameLength_ = addExtendedName(m_maxNameLength_);
// set sets and lengths from group names, set global maximum values
addGroupName(m_maxNameLength_);
return true;
} | [
"private",
"boolean",
"initNameSetsLengths",
"(",
")",
"{",
"if",
"(",
"m_maxNameLength_",
">",
"0",
")",
"{",
"return",
"true",
";",
"}",
"String",
"extra",
"=",
"\"0123456789ABCDEF<>-\"",
";",
"// set hex digits, used in various names, and <>-, used in extended",
"// ... | Sets up the name sets and the calculation of the maximum lengths.
Equivalent to calcNameSetsLengths. | [
"Sets",
"up",
"the",
"name",
"sets",
"and",
"the",
"calculation",
"of",
"the",
"maximum",
"lengths",
".",
"Equivalent",
"to",
"calcNameSetsLengths",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L1616-L1636 |
35,073 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.convert | private void convert(int set[], UnicodeSet uset)
{
uset.clear();
if (!initNameSetsLengths()) {
return;
}
// build a char string with all chars that are used in character names
for (char c = 255; c > 0; c --) {
if (contains(set, c)) {
uset.add(c);
}
}
} | java | private void convert(int set[], UnicodeSet uset)
{
uset.clear();
if (!initNameSetsLengths()) {
return;
}
// build a char string with all chars that are used in character names
for (char c = 255; c > 0; c --) {
if (contains(set, c)) {
uset.add(c);
}
}
} | [
"private",
"void",
"convert",
"(",
"int",
"set",
"[",
"]",
",",
"UnicodeSet",
"uset",
")",
"{",
"uset",
".",
"clear",
"(",
")",
";",
"if",
"(",
"!",
"initNameSetsLengths",
"(",
")",
")",
"{",
"return",
";",
"}",
"// build a char string with all chars that ... | Converts the char set cset into a Unicode set uset.
Equivalent to charSetToUSet.
@param set Set of 256 bit flags corresponding to a set of chars.
@param uset USet to receive characters. Existing contents are deleted. | [
"Converts",
"the",
"char",
"set",
"cset",
"into",
"a",
"Unicode",
"set",
"uset",
".",
"Equivalent",
"to",
"charSetToUSet",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L1644-L1657 |
35,074 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicMarkableReference.java | AtomicMarkableReference.set | public void set(V newReference, boolean newMark) {
Pair<V> current = pair;
if (newReference != current.reference || newMark != current.mark)
this.pair = Pair.of(newReference, newMark);
} | java | public void set(V newReference, boolean newMark) {
Pair<V> current = pair;
if (newReference != current.reference || newMark != current.mark)
this.pair = Pair.of(newReference, newMark);
} | [
"public",
"void",
"set",
"(",
"V",
"newReference",
",",
"boolean",
"newMark",
")",
"{",
"Pair",
"<",
"V",
">",
"current",
"=",
"pair",
";",
"if",
"(",
"newReference",
"!=",
"current",
".",
"reference",
"||",
"newMark",
"!=",
"current",
".",
"mark",
")"... | Unconditionally sets the value of both the reference and mark.
@param newReference the new value for the reference
@param newMark the new value for the mark | [
"Unconditionally",
"sets",
"the",
"value",
"of",
"both",
"the",
"reference",
"and",
"mark",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicMarkableReference.java#L164-L168 |
35,075 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Trie2_16.java | Trie2_16.serialize | public int serialize(OutputStream os) throws IOException {
DataOutputStream dos = new DataOutputStream(os);
int bytesWritten = 0;
bytesWritten += serializeHeader(dos);
for (int i=0; i<dataLength; i++) {
dos.writeChar(index[data16+i]);
}
bytesWritten += dataLength*2;
return bytesWritten;
} | java | public int serialize(OutputStream os) throws IOException {
DataOutputStream dos = new DataOutputStream(os);
int bytesWritten = 0;
bytesWritten += serializeHeader(dos);
for (int i=0; i<dataLength; i++) {
dos.writeChar(index[data16+i]);
}
bytesWritten += dataLength*2;
return bytesWritten;
} | [
"public",
"int",
"serialize",
"(",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"DataOutputStream",
"dos",
"=",
"new",
"DataOutputStream",
"(",
"os",
")",
";",
"int",
"bytesWritten",
"=",
"0",
";",
"bytesWritten",
"+=",
"serializeHeader",
"(",
"dos... | Serialize a Trie2_16 onto an OutputStream.
A Trie2 can be serialized multiple times.
The serialized data is compatible with ICU4C UTrie2 serialization.
Trie2 serialization is unrelated to Java object serialization.
@param os the stream to which the serialized Trie2 data will be written.
@return the number of bytes written.
@throw IOException on an error writing to the OutputStream. | [
"Serialize",
"a",
"Trie2_16",
"onto",
"an",
"OutputStream",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Trie2_16.java#L155-L165 |
35,076 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/Inet6AddressImpl.java | Inet6AddressImpl.lookupHostByName | private static InetAddress[] lookupHostByName(String host, int netId)
throws UnknownHostException {
BlockGuard.getThreadPolicy().onNetwork();
// Do we have a result cached?
Object cachedResult = addressCache.get(host, netId);
if (cachedResult != null) {
if (cachedResult instanceof InetAddress[]) {
// A cached positive result.
return (InetAddress[]) cachedResult;
} else {
// A cached negative result.
throw new UnknownHostException((String) cachedResult);
}
}
try {
StructAddrinfo hints = new StructAddrinfo();
hints.ai_flags = AI_ADDRCONFIG;
hints.ai_family = AF_UNSPEC;
// If we don't specify a socket type, every address will appear twice, once
// for SOCK_STREAM and one for SOCK_DGRAM. Since we do not return the family
// anyway, just pick one.
hints.ai_socktype = SOCK_STREAM;
InetAddress[] addresses = NetworkOs.getaddrinfo(host, hints);
// TODO: should getaddrinfo set the hostname of the InetAddresses it returns?
for (InetAddress address : addresses) {
address.holder().hostName = host;
}
addressCache.put(host, netId, addresses);
return addresses;
} catch (GaiException gaiException) {
// If the failure appears to have been a lack of INTERNET permission, throw a clear
// SecurityException to aid in debugging this common mistake.
// http://code.google.com/p/android/issues/detail?id=15722
if (gaiException.getCause() instanceof ErrnoException) {
if (((ErrnoException) gaiException.getCause()).errno == EACCES) {
throw new SecurityException("Permission denied (missing INTERNET permission?)", gaiException);
}
}
// Otherwise, throw an UnknownHostException.
String detailMessage = "Unable to resolve host \"" + host + "\": " + NetworkOs.gai_strerror(gaiException.error);
addressCache.putUnknownHost(host, netId, detailMessage);
throw gaiException.rethrowAsUnknownHostException(detailMessage);
}
} | java | private static InetAddress[] lookupHostByName(String host, int netId)
throws UnknownHostException {
BlockGuard.getThreadPolicy().onNetwork();
// Do we have a result cached?
Object cachedResult = addressCache.get(host, netId);
if (cachedResult != null) {
if (cachedResult instanceof InetAddress[]) {
// A cached positive result.
return (InetAddress[]) cachedResult;
} else {
// A cached negative result.
throw new UnknownHostException((String) cachedResult);
}
}
try {
StructAddrinfo hints = new StructAddrinfo();
hints.ai_flags = AI_ADDRCONFIG;
hints.ai_family = AF_UNSPEC;
// If we don't specify a socket type, every address will appear twice, once
// for SOCK_STREAM and one for SOCK_DGRAM. Since we do not return the family
// anyway, just pick one.
hints.ai_socktype = SOCK_STREAM;
InetAddress[] addresses = NetworkOs.getaddrinfo(host, hints);
// TODO: should getaddrinfo set the hostname of the InetAddresses it returns?
for (InetAddress address : addresses) {
address.holder().hostName = host;
}
addressCache.put(host, netId, addresses);
return addresses;
} catch (GaiException gaiException) {
// If the failure appears to have been a lack of INTERNET permission, throw a clear
// SecurityException to aid in debugging this common mistake.
// http://code.google.com/p/android/issues/detail?id=15722
if (gaiException.getCause() instanceof ErrnoException) {
if (((ErrnoException) gaiException.getCause()).errno == EACCES) {
throw new SecurityException("Permission denied (missing INTERNET permission?)", gaiException);
}
}
// Otherwise, throw an UnknownHostException.
String detailMessage = "Unable to resolve host \"" + host + "\": " + NetworkOs.gai_strerror(gaiException.error);
addressCache.putUnknownHost(host, netId, detailMessage);
throw gaiException.rethrowAsUnknownHostException(detailMessage);
}
} | [
"private",
"static",
"InetAddress",
"[",
"]",
"lookupHostByName",
"(",
"String",
"host",
",",
"int",
"netId",
")",
"throws",
"UnknownHostException",
"{",
"BlockGuard",
".",
"getThreadPolicy",
"(",
")",
".",
"onNetwork",
"(",
")",
";",
"// Do we have a result cache... | Resolves a hostname to its IP addresses using a cache.
@param host the hostname to resolve.
@param netId the network to perform resolution upon.
@return the IP addresses of the host. | [
"Resolves",
"a",
"hostname",
"to",
"its",
"IP",
"addresses",
"using",
"a",
"cache",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/Inet6AddressImpl.java#L84-L127 |
35,077 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CollationKey.java | CollationKey.toByteArray | public byte[] toByteArray()
{
int length = getLength() + 1;
byte result[] = new byte[length];
System.arraycopy(m_key_, 0, result, 0, length);
return result;
} | java | public byte[] toByteArray()
{
int length = getLength() + 1;
byte result[] = new byte[length];
System.arraycopy(m_key_, 0, result, 0, length);
return result;
} | [
"public",
"byte",
"[",
"]",
"toByteArray",
"(",
")",
"{",
"int",
"length",
"=",
"getLength",
"(",
")",
"+",
"1",
";",
"byte",
"result",
"[",
"]",
"=",
"new",
"byte",
"[",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
"m_key_",
",",
"0",
",... | Duplicates and returns the value of this CollationKey as a sequence
of big-endian bytes terminated by a null.
<p>If two CollationKeys can be legitimately compared, then one can
compare the byte arrays of each to obtain the same result, e.g.
<pre>
byte key1[] = collationkey1.toByteArray();
byte key2[] = collationkey2.toByteArray();
int key, targetkey;
int i = 0;
do {
key = key1[i] & 0xFF;
targetkey = key2[i] & 0xFF;
if (key < targetkey) {
System.out.println("String 1 is less than string 2");
return;
}
if (targetkey < key) {
System.out.println("String 1 is more than string 2");
}
i ++;
} while (key != 0 && targetKey != 0);
System.out.println("Strings are equal.");
</pre>
@return CollationKey value in a sequence of big-endian byte bytes
terminated by a null. | [
"Duplicates",
"and",
"returns",
"the",
"value",
"of",
"this",
"CollationKey",
"as",
"a",
"sequence",
"of",
"big",
"-",
"endian",
"bytes",
"terminated",
"by",
"a",
"null",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CollationKey.java#L224-L230 |
35,078 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CollationKey.java | CollationKey.compareTo | @Override
public int compareTo(CollationKey target)
{
for (int i = 0;; ++i) {
int l = m_key_[i]&0xff;
int r = target.m_key_[i]&0xff;
if (l < r) {
return -1;
} else if (l > r) {
return 1;
} else if (l == 0) {
return 0;
}
}
} | java | @Override
public int compareTo(CollationKey target)
{
for (int i = 0;; ++i) {
int l = m_key_[i]&0xff;
int r = target.m_key_[i]&0xff;
if (l < r) {
return -1;
} else if (l > r) {
return 1;
} else if (l == 0) {
return 0;
}
}
} | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"CollationKey",
"target",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
";",
"++",
"i",
")",
"{",
"int",
"l",
"=",
"m_key_",
"[",
"i",
"]",
"&",
"0xff",
";",
"int",
"r",
"=",
"target",
".",... | Compare this CollationKey to another CollationKey. The
collation rules of the Collator that created this key are
applied.
<p><strong>Note:</strong> Comparison between CollationKeys
created by different Collators might return incorrect
results. See class documentation.
@param target target CollationKey
@return an integer value. If the value is less than zero this CollationKey
is less than than target, if the value is zero they are equal, and
if the value is greater than zero this CollationKey is greater
than target.
@exception NullPointerException is thrown if argument is null.
@see Collator#compare(String, String) | [
"Compare",
"this",
"CollationKey",
"to",
"another",
"CollationKey",
".",
"The",
"collation",
"rules",
"of",
"the",
"Collator",
"that",
"created",
"this",
"key",
"are",
"applied",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CollationKey.java#L251-L265 |
35,079 | google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CollationKey.java | CollationKey.getLength | private int getLength()
{
if (m_length_ >= 0) {
return m_length_;
}
int length = m_key_.length;
for (int index = 0; index < length; index ++) {
if (m_key_[index] == 0) {
length = index;
break;
}
}
m_length_ = length;
return m_length_;
} | java | private int getLength()
{
if (m_length_ >= 0) {
return m_length_;
}
int length = m_key_.length;
for (int index = 0; index < length; index ++) {
if (m_key_[index] == 0) {
length = index;
break;
}
}
m_length_ = length;
return m_length_;
} | [
"private",
"int",
"getLength",
"(",
")",
"{",
"if",
"(",
"m_length_",
">=",
"0",
")",
"{",
"return",
"m_length_",
";",
"}",
"int",
"length",
"=",
"m_key_",
".",
"length",
";",
"for",
"(",
"int",
"index",
"=",
"0",
";",
"index",
"<",
"length",
";",
... | Gets the length of the CollationKey
@return length of the CollationKey | [
"Gets",
"the",
"length",
"of",
"the",
"CollationKey"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CollationKey.java#L601-L615 |
35,080 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java | DOM2DTM.getNode | public Node getNode(int nodeHandle)
{
int identity = makeNodeIdentity(nodeHandle);
return (Node) m_nodes.elementAt(identity);
} | java | public Node getNode(int nodeHandle)
{
int identity = makeNodeIdentity(nodeHandle);
return (Node) m_nodes.elementAt(identity);
} | [
"public",
"Node",
"getNode",
"(",
"int",
"nodeHandle",
")",
"{",
"int",
"identity",
"=",
"makeNodeIdentity",
"(",
"nodeHandle",
")",
";",
"return",
"(",
"Node",
")",
"m_nodes",
".",
"elementAt",
"(",
"identity",
")",
";",
"}"
] | Return an DOM node for the given node.
@param nodeHandle The node ID.
@return A node representation of the DTM node. | [
"Return",
"an",
"DOM",
"node",
"for",
"the",
"given",
"node",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java#L604-L610 |
35,081 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java | DOM2DTM.getNextNodeIdentity | protected int getNextNodeIdentity(int identity)
{
identity += 1;
if (identity >= m_nodes.size())
{
if (!nextNode())
identity = DTM.NULL;
}
return identity;
} | java | protected int getNextNodeIdentity(int identity)
{
identity += 1;
if (identity >= m_nodes.size())
{
if (!nextNode())
identity = DTM.NULL;
}
return identity;
} | [
"protected",
"int",
"getNextNodeIdentity",
"(",
"int",
"identity",
")",
"{",
"identity",
"+=",
"1",
";",
"if",
"(",
"identity",
">=",
"m_nodes",
".",
"size",
"(",
")",
")",
"{",
"if",
"(",
"!",
"nextNode",
"(",
")",
")",
"identity",
"=",
"DTM",
".",
... | Get the next node identity value in the list, and call the iterator
if it hasn't been added yet.
@param identity The node identity (index).
@return identity+1, or DTM.NULL. | [
"Get",
"the",
"next",
"node",
"identity",
"value",
"in",
"the",
"list",
"and",
"call",
"the",
"iterator",
"if",
"it",
"hasn",
"t",
"been",
"added",
"yet",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java#L631-L643 |
35,082 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java | DOM2DTM.getHandleOfNode | public int getHandleOfNode(Node node)
{
if (null != node)
{
// Is Node actually within the same document? If not, don't search!
// This would be easier if m_root was always the Document node, but
// we decided to allow wrapping a DTM around a subtree.
if((m_root==node) ||
(m_root.getNodeType()==DOCUMENT_NODE &&
m_root==node.getOwnerDocument()) ||
(m_root.getNodeType()!=DOCUMENT_NODE &&
m_root.getOwnerDocument()==node.getOwnerDocument())
)
{
// If node _is_ in m_root's tree, find its handle
//
// %OPT% This check may be improved significantly when DOM
// Level 3 nodeKey and relative-order tests become
// available!
for(Node cursor=node;
cursor!=null;
cursor=
(cursor.getNodeType()!=ATTRIBUTE_NODE)
? cursor.getParentNode()
: ((org.w3c.dom.Attr)cursor).getOwnerElement())
{
if(cursor==m_root)
// We know this node; find its handle.
return getHandleFromNode(node);
} // for ancestors of node
} // if node and m_root in same Document
} // if node!=null
return DTM.NULL;
} | java | public int getHandleOfNode(Node node)
{
if (null != node)
{
// Is Node actually within the same document? If not, don't search!
// This would be easier if m_root was always the Document node, but
// we decided to allow wrapping a DTM around a subtree.
if((m_root==node) ||
(m_root.getNodeType()==DOCUMENT_NODE &&
m_root==node.getOwnerDocument()) ||
(m_root.getNodeType()!=DOCUMENT_NODE &&
m_root.getOwnerDocument()==node.getOwnerDocument())
)
{
// If node _is_ in m_root's tree, find its handle
//
// %OPT% This check may be improved significantly when DOM
// Level 3 nodeKey and relative-order tests become
// available!
for(Node cursor=node;
cursor!=null;
cursor=
(cursor.getNodeType()!=ATTRIBUTE_NODE)
? cursor.getParentNode()
: ((org.w3c.dom.Attr)cursor).getOwnerElement())
{
if(cursor==m_root)
// We know this node; find its handle.
return getHandleFromNode(node);
} // for ancestors of node
} // if node and m_root in same Document
} // if node!=null
return DTM.NULL;
} | [
"public",
"int",
"getHandleOfNode",
"(",
"Node",
"node",
")",
"{",
"if",
"(",
"null",
"!=",
"node",
")",
"{",
"// Is Node actually within the same document? If not, don't search!",
"// This would be easier if m_root was always the Document node, but",
"// we decided to allow wrappi... | Get the handle from a Node. This is a more robust version of
getHandleFromNode, intended to be usable by the public.
<p>%OPT% This will be pretty slow.</p>
%REVIEW% This relies on being able to test node-identity via
object-identity. DTM2DOM proxying is a great example of a case where
that doesn't work. DOM Level 3 will provide the isSameNode() method
to fix that, but until then this is going to be flaky.
@param node A node, which may be null.
@return The node handle or <code>DTM.NULL</code>. | [
"Get",
"the",
"handle",
"from",
"a",
"Node",
".",
"This",
"is",
"a",
"more",
"robust",
"version",
"of",
"getHandleFromNode",
"intended",
"to",
"be",
"usable",
"by",
"the",
"public",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java#L703-L737 |
35,083 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java | DOM2DTM.isWhitespace | public boolean isWhitespace(int nodeHandle)
{
int type = getNodeType(nodeHandle);
Node node = getNode(nodeHandle);
if(TEXT_NODE == type || CDATA_SECTION_NODE == type)
{
// If this is a DTM text node, it may be made of multiple DOM text
// nodes -- including navigating into Entity References. DOM2DTM
// records the first node in the sequence and requires that we
// pick up the others when we retrieve the DTM node's value.
//
// %REVIEW% DOM Level 3 is expected to add a "whole text"
// retrieval method which performs this function for us.
FastStringBuffer buf = StringBufferPool.get();
while(node!=null)
{
buf.append(node.getNodeValue());
node=logicalNextDOMTextNode(node);
}
boolean b = buf.isWhitespace(0, buf.length());
StringBufferPool.free(buf);
return b;
}
return false;
} | java | public boolean isWhitespace(int nodeHandle)
{
int type = getNodeType(nodeHandle);
Node node = getNode(nodeHandle);
if(TEXT_NODE == type || CDATA_SECTION_NODE == type)
{
// If this is a DTM text node, it may be made of multiple DOM text
// nodes -- including navigating into Entity References. DOM2DTM
// records the first node in the sequence and requires that we
// pick up the others when we retrieve the DTM node's value.
//
// %REVIEW% DOM Level 3 is expected to add a "whole text"
// retrieval method which performs this function for us.
FastStringBuffer buf = StringBufferPool.get();
while(node!=null)
{
buf.append(node.getNodeValue());
node=logicalNextDOMTextNode(node);
}
boolean b = buf.isWhitespace(0, buf.length());
StringBufferPool.free(buf);
return b;
}
return false;
} | [
"public",
"boolean",
"isWhitespace",
"(",
"int",
"nodeHandle",
")",
"{",
"int",
"type",
"=",
"getNodeType",
"(",
"nodeHandle",
")",
";",
"Node",
"node",
"=",
"getNode",
"(",
"nodeHandle",
")",
";",
"if",
"(",
"TEXT_NODE",
"==",
"type",
"||",
"CDATA_SECTION... | Determine if the string-value of a node is whitespace
@param nodeHandle The node Handle.
@return Return true if the given node is whitespace. | [
"Determine",
"if",
"the",
"string",
"-",
"value",
"of",
"a",
"node",
"is",
"whitespace"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java#L868-L892 |
35,084 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java | DOM2DTM.dispatchToEvents | public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch)
throws org.xml.sax.SAXException
{
TreeWalker treeWalker = m_walker;
ContentHandler prevCH = treeWalker.getContentHandler();
if(null != prevCH)
{
treeWalker = new TreeWalker(null);
}
treeWalker.setContentHandler(ch);
try
{
Node node = getNode(nodeHandle);
treeWalker.traverseFragment(node);
}
finally
{
treeWalker.setContentHandler(null);
}
} | java | public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch)
throws org.xml.sax.SAXException
{
TreeWalker treeWalker = m_walker;
ContentHandler prevCH = treeWalker.getContentHandler();
if(null != prevCH)
{
treeWalker = new TreeWalker(null);
}
treeWalker.setContentHandler(ch);
try
{
Node node = getNode(nodeHandle);
treeWalker.traverseFragment(node);
}
finally
{
treeWalker.setContentHandler(null);
}
} | [
"public",
"void",
"dispatchToEvents",
"(",
"int",
"nodeHandle",
",",
"org",
".",
"xml",
".",
"sax",
".",
"ContentHandler",
"ch",
")",
"throws",
"org",
".",
"xml",
".",
"sax",
".",
"SAXException",
"{",
"TreeWalker",
"treeWalker",
"=",
"m_walker",
";",
"Cont... | Directly create SAX parser events from a subtree.
@param nodeHandle The node ID.
@param ch A non-null reference to a ContentHandler.
@throws org.xml.sax.SAXException | [
"Directly",
"create",
"SAX",
"parser",
"events",
"from",
"a",
"subtree",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java#L1712-L1733 |
35,085 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java | ScheduledThreadPoolExecutor.reExecutePeriodic | void reExecutePeriodic(RunnableScheduledFuture<?> task) {
if (canRunInCurrentRunState(true)) {
super.getQueue().add(task);
if (!canRunInCurrentRunState(true) && remove(task))
task.cancel(false);
else
ensurePrestart();
}
} | java | void reExecutePeriodic(RunnableScheduledFuture<?> task) {
if (canRunInCurrentRunState(true)) {
super.getQueue().add(task);
if (!canRunInCurrentRunState(true) && remove(task))
task.cancel(false);
else
ensurePrestart();
}
} | [
"void",
"reExecutePeriodic",
"(",
"RunnableScheduledFuture",
"<",
"?",
">",
"task",
")",
"{",
"if",
"(",
"canRunInCurrentRunState",
"(",
"true",
")",
")",
"{",
"super",
".",
"getQueue",
"(",
")",
".",
"add",
"(",
"task",
")",
";",
"if",
"(",
"!",
"canR... | Requeues a periodic task unless current run state precludes it.
Same idea as delayedExecute except drops task rather than rejecting.
@param task the task | [
"Requeues",
"a",
"periodic",
"task",
"unless",
"current",
"run",
"state",
"precludes",
"it",
".",
"Same",
"idea",
"as",
"delayedExecute",
"except",
"drops",
"task",
"rather",
"than",
"rejecting",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java#L353-L361 |
35,086 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java | ScheduledThreadPoolExecutor.decorateTask | protected <V> RunnableScheduledFuture<V> decorateTask(
Runnable runnable, RunnableScheduledFuture<V> task) {
return task;
} | java | protected <V> RunnableScheduledFuture<V> decorateTask(
Runnable runnable, RunnableScheduledFuture<V> task) {
return task;
} | [
"protected",
"<",
"V",
">",
"RunnableScheduledFuture",
"<",
"V",
">",
"decorateTask",
"(",
"Runnable",
"runnable",
",",
"RunnableScheduledFuture",
"<",
"V",
">",
"task",
")",
"{",
"return",
"task",
";",
"}"
] | Modifies or replaces the task used to execute a runnable.
This method can be used to override the concrete
class used for managing internal tasks.
The default implementation simply returns the given task.
@param runnable the submitted Runnable
@param task the task created to execute the runnable
@param <V> the type of the task's result
@return a task that can execute the runnable
@since 1.6 | [
"Modifies",
"or",
"replaces",
"the",
"task",
"used",
"to",
"execute",
"a",
"runnable",
".",
"This",
"method",
"can",
"be",
"used",
"to",
"override",
"the",
"concrete",
"class",
"used",
"for",
"managing",
"internal",
"tasks",
".",
"The",
"default",
"implement... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java#L408-L411 |
35,087 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java | ScheduledThreadPoolExecutor.decorateTask | protected <V> RunnableScheduledFuture<V> decorateTask(
Callable<V> callable, RunnableScheduledFuture<V> task) {
return task;
} | java | protected <V> RunnableScheduledFuture<V> decorateTask(
Callable<V> callable, RunnableScheduledFuture<V> task) {
return task;
} | [
"protected",
"<",
"V",
">",
"RunnableScheduledFuture",
"<",
"V",
">",
"decorateTask",
"(",
"Callable",
"<",
"V",
">",
"callable",
",",
"RunnableScheduledFuture",
"<",
"V",
">",
"task",
")",
"{",
"return",
"task",
";",
"}"
] | Modifies or replaces the task used to execute a callable.
This method can be used to override the concrete
class used for managing internal tasks.
The default implementation simply returns the given task.
@param callable the submitted Callable
@param task the task created to execute the callable
@param <V> the type of the task's result
@return a task that can execute the callable
@since 1.6 | [
"Modifies",
"or",
"replaces",
"the",
"task",
"used",
"to",
"execute",
"a",
"callable",
".",
"This",
"method",
"can",
"be",
"used",
"to",
"override",
"the",
"concrete",
"class",
"used",
"for",
"managing",
"internal",
"tasks",
".",
"The",
"default",
"implement... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java#L425-L428 |
35,088 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java | ScheduledThreadPoolExecutor.triggerTime | long triggerTime(long delay) {
return System.nanoTime() +
((delay < (Long.MAX_VALUE >> 1)) ? delay : overflowFree(delay));
} | java | long triggerTime(long delay) {
return System.nanoTime() +
((delay < (Long.MAX_VALUE >> 1)) ? delay : overflowFree(delay));
} | [
"long",
"triggerTime",
"(",
"long",
"delay",
")",
"{",
"return",
"System",
".",
"nanoTime",
"(",
")",
"+",
"(",
"(",
"delay",
"<",
"(",
"Long",
".",
"MAX_VALUE",
">>",
"1",
")",
")",
"?",
"delay",
":",
"overflowFree",
"(",
"delay",
")",
")",
";",
... | Returns the nanoTime-based trigger time of a delayed action. | [
"Returns",
"the",
"nanoTime",
"-",
"based",
"trigger",
"time",
"of",
"a",
"delayed",
"action",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java#L528-L531 |
35,089 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java | ScheduledThreadPoolExecutor.overflowFree | private long overflowFree(long delay) {
Delayed head = (Delayed) super.getQueue().peek();
if (head != null) {
long headDelay = head.getDelay(NANOSECONDS);
if (headDelay < 0 && (delay - headDelay < 0))
delay = Long.MAX_VALUE + headDelay;
}
return delay;
} | java | private long overflowFree(long delay) {
Delayed head = (Delayed) super.getQueue().peek();
if (head != null) {
long headDelay = head.getDelay(NANOSECONDS);
if (headDelay < 0 && (delay - headDelay < 0))
delay = Long.MAX_VALUE + headDelay;
}
return delay;
} | [
"private",
"long",
"overflowFree",
"(",
"long",
"delay",
")",
"{",
"Delayed",
"head",
"=",
"(",
"Delayed",
")",
"super",
".",
"getQueue",
"(",
")",
".",
"peek",
"(",
")",
";",
"if",
"(",
"head",
"!=",
"null",
")",
"{",
"long",
"headDelay",
"=",
"he... | Constrains the values of all delays in the queue to be within
Long.MAX_VALUE of each other, to avoid overflow in compareTo.
This may occur if a task is eligible to be dequeued, but has
not yet been, while some other task is added with a delay of
Long.MAX_VALUE. | [
"Constrains",
"the",
"values",
"of",
"all",
"delays",
"in",
"the",
"queue",
"to",
"be",
"within",
"Long",
".",
"MAX_VALUE",
"of",
"each",
"other",
"to",
"avoid",
"overflow",
"in",
"compareTo",
".",
"This",
"may",
"occur",
"if",
"a",
"task",
"is",
"eligib... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java#L540-L548 |
35,090 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Float.java | Float.floatToIntBits | public static int floatToIntBits(float value) {
int result = floatToRawIntBits(value);
// Check for NaN based on values of bit fields, maximum
// exponent and nonzero significand.
if ( ((result & FloatConsts.EXP_BIT_MASK) ==
FloatConsts.EXP_BIT_MASK) &&
(result & FloatConsts.SIGNIF_BIT_MASK) != 0)
result = 0x7fc00000;
return result;
} | java | public static int floatToIntBits(float value) {
int result = floatToRawIntBits(value);
// Check for NaN based on values of bit fields, maximum
// exponent and nonzero significand.
if ( ((result & FloatConsts.EXP_BIT_MASK) ==
FloatConsts.EXP_BIT_MASK) &&
(result & FloatConsts.SIGNIF_BIT_MASK) != 0)
result = 0x7fc00000;
return result;
} | [
"public",
"static",
"int",
"floatToIntBits",
"(",
"float",
"value",
")",
"{",
"int",
"result",
"=",
"floatToRawIntBits",
"(",
"value",
")",
";",
"// Check for NaN based on values of bit fields, maximum",
"// exponent and nonzero significand.",
"if",
"(",
"(",
"(",
"resu... | Returns a representation of the specified floating-point value
according to the IEEE 754 floating-point "single format" bit
layout.
<p>Bit 31 (the bit that is selected by the mask
{@code 0x80000000}) represents the sign of the floating-point
number.
Bits 30-23 (the bits that are selected by the mask
{@code 0x7f800000}) represent the exponent.
Bits 22-0 (the bits that are selected by the mask
{@code 0x007fffff}) represent the significand (sometimes called
the mantissa) of the floating-point number.
<p>If the argument is positive infinity, the result is
{@code 0x7f800000}.
<p>If the argument is negative infinity, the result is
{@code 0xff800000}.
<p>If the argument is NaN, the result is {@code 0x7fc00000}.
<p>In all cases, the result is an integer that, when given to the
{@link #intBitsToFloat(int)} method, will produce a floating-point
value the same as the argument to {@code floatToIntBits}
(except all NaN values are collapsed to a single
"canonical" NaN value).
@param value a floating-point number.
@return the bits that represent the floating-point number. | [
"Returns",
"a",
"representation",
"of",
"the",
"specified",
"floating",
"-",
"point",
"value",
"according",
"to",
"the",
"IEEE",
"754",
"floating",
"-",
"point",
"single",
"format",
"bit",
"layout",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Float.java#L744-L753 |
35,091 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/ForwardBuilder.java | ForwardBuilder.getMatchingCACerts | private void getMatchingCACerts(ForwardState currentState,
List<CertStore> certStores,
Collection<X509Certificate> caCerts)
throws IOException
{
if (debug != null) {
debug.println("ForwardBuilder.getMatchingCACerts()...");
}
int initialSize = caCerts.size();
/*
* Compose a CertSelector to filter out
* certs which do not satisfy requirements.
*/
X509CertSelector sel = null;
if (currentState.isInitial()) {
if (targetCertConstraints.getBasicConstraints() == -2) {
// no need to continue: this means we never can match a CA cert
return;
}
/* This means a CA is the target, so match on same stuff as
* getMatchingEECerts
*/
if (debug != null) {
debug.println("ForwardBuilder.getMatchingCACerts(): ca is target");
}
if (caTargetSelector == null) {
caTargetSelector =
(X509CertSelector) targetCertConstraints.clone();
/*
* Since we don't check the validity period of trusted
* certificates, please don't set the certificate valid
* criterion unless the trusted certificate matching is
* completed.
*/
/*
* Policy processing optimizations
*/
if (buildParams.explicitPolicyRequired())
caTargetSelector.setPolicy(getMatchingPolicies());
}
sel = caTargetSelector;
} else {
if (caSelector == null) {
caSelector = new AdaptableX509CertSelector();
/*
* Since we don't check the validity period of trusted
* certificates, please don't set the certificate valid
* criterion unless the trusted certificate matching is
* completed.
*/
/*
* Policy processing optimizations
*/
if (buildParams.explicitPolicyRequired())
caSelector.setPolicy(getMatchingPolicies());
}
/*
* Match on subject (issuer of previous cert)
*/
caSelector.setSubject(currentState.issuerDN);
/*
* Match on subjectNamesTraversed (both DNs and AltNames)
* (checks that current cert's name constraints permit it
* to certify all the DNs and AltNames that have been traversed)
*/
CertPathHelper.setPathToNames
(caSelector, currentState.subjectNamesTraversed);
/*
* Facilitate certification path construction with authority
* key identifier and subject key identifier.
*/
AuthorityKeyIdentifierExtension akidext =
currentState.cert.getAuthorityKeyIdentifierExtension();
caSelector.parseAuthorityKeyIdentifierExtension(akidext);
/*
* check the validity period
*/
caSelector.setValidityPeriod(currentState.cert.getNotBefore(),
currentState.cert.getNotAfter());
sel = caSelector;
}
/*
* For compatibility, conservatively, we don't check the path
* length constraint of trusted anchors. Please don't set the
* basic constraints criterion unless the trusted certificate
* matching is completed.
*/
sel.setBasicConstraints(-1);
for (X509Certificate trustedCert : trustedCerts) {
if (sel.match(trustedCert)) {
if (debug != null) {
debug.println("ForwardBuilder.getMatchingCACerts: "
+ "found matching trust anchor");
}
if (caCerts.add(trustedCert) && !searchAllCertStores) {
return;
}
}
}
/*
* The trusted certificate matching is completed. We need to match
* on certificate validity date.
*/
sel.setCertificateValid(buildParams.date());
/*
* Require CA certs with a pathLenConstraint that allows
* at least as many CA certs that have already been traversed
*/
sel.setBasicConstraints(currentState.traversedCACerts);
/*
* If we have already traversed as many CA certs as the maxPathLength
* will allow us to, then we don't bother looking through these
* certificate pairs. If maxPathLength has a value of -1, this
* means it is unconstrained, so we always look through the
* certificate pairs.
*/
if (currentState.isInitial() ||
(buildParams.maxPathLength() == -1) ||
(buildParams.maxPathLength() > currentState.traversedCACerts))
{
if (addMatchingCerts(sel, certStores,
caCerts, searchAllCertStores)
&& !searchAllCertStores) {
return;
}
}
if (!currentState.isInitial() && Builder.USE_AIA) {
// check for AuthorityInformationAccess extension
AuthorityInfoAccessExtension aiaExt =
currentState.cert.getAuthorityInfoAccessExtension();
if (aiaExt != null) {
getCerts(aiaExt, caCerts);
}
}
if (debug != null) {
int numCerts = caCerts.size() - initialSize;
debug.println("ForwardBuilder.getMatchingCACerts: found " +
numCerts + " CA certs");
}
} | java | private void getMatchingCACerts(ForwardState currentState,
List<CertStore> certStores,
Collection<X509Certificate> caCerts)
throws IOException
{
if (debug != null) {
debug.println("ForwardBuilder.getMatchingCACerts()...");
}
int initialSize = caCerts.size();
/*
* Compose a CertSelector to filter out
* certs which do not satisfy requirements.
*/
X509CertSelector sel = null;
if (currentState.isInitial()) {
if (targetCertConstraints.getBasicConstraints() == -2) {
// no need to continue: this means we never can match a CA cert
return;
}
/* This means a CA is the target, so match on same stuff as
* getMatchingEECerts
*/
if (debug != null) {
debug.println("ForwardBuilder.getMatchingCACerts(): ca is target");
}
if (caTargetSelector == null) {
caTargetSelector =
(X509CertSelector) targetCertConstraints.clone();
/*
* Since we don't check the validity period of trusted
* certificates, please don't set the certificate valid
* criterion unless the trusted certificate matching is
* completed.
*/
/*
* Policy processing optimizations
*/
if (buildParams.explicitPolicyRequired())
caTargetSelector.setPolicy(getMatchingPolicies());
}
sel = caTargetSelector;
} else {
if (caSelector == null) {
caSelector = new AdaptableX509CertSelector();
/*
* Since we don't check the validity period of trusted
* certificates, please don't set the certificate valid
* criterion unless the trusted certificate matching is
* completed.
*/
/*
* Policy processing optimizations
*/
if (buildParams.explicitPolicyRequired())
caSelector.setPolicy(getMatchingPolicies());
}
/*
* Match on subject (issuer of previous cert)
*/
caSelector.setSubject(currentState.issuerDN);
/*
* Match on subjectNamesTraversed (both DNs and AltNames)
* (checks that current cert's name constraints permit it
* to certify all the DNs and AltNames that have been traversed)
*/
CertPathHelper.setPathToNames
(caSelector, currentState.subjectNamesTraversed);
/*
* Facilitate certification path construction with authority
* key identifier and subject key identifier.
*/
AuthorityKeyIdentifierExtension akidext =
currentState.cert.getAuthorityKeyIdentifierExtension();
caSelector.parseAuthorityKeyIdentifierExtension(akidext);
/*
* check the validity period
*/
caSelector.setValidityPeriod(currentState.cert.getNotBefore(),
currentState.cert.getNotAfter());
sel = caSelector;
}
/*
* For compatibility, conservatively, we don't check the path
* length constraint of trusted anchors. Please don't set the
* basic constraints criterion unless the trusted certificate
* matching is completed.
*/
sel.setBasicConstraints(-1);
for (X509Certificate trustedCert : trustedCerts) {
if (sel.match(trustedCert)) {
if (debug != null) {
debug.println("ForwardBuilder.getMatchingCACerts: "
+ "found matching trust anchor");
}
if (caCerts.add(trustedCert) && !searchAllCertStores) {
return;
}
}
}
/*
* The trusted certificate matching is completed. We need to match
* on certificate validity date.
*/
sel.setCertificateValid(buildParams.date());
/*
* Require CA certs with a pathLenConstraint that allows
* at least as many CA certs that have already been traversed
*/
sel.setBasicConstraints(currentState.traversedCACerts);
/*
* If we have already traversed as many CA certs as the maxPathLength
* will allow us to, then we don't bother looking through these
* certificate pairs. If maxPathLength has a value of -1, this
* means it is unconstrained, so we always look through the
* certificate pairs.
*/
if (currentState.isInitial() ||
(buildParams.maxPathLength() == -1) ||
(buildParams.maxPathLength() > currentState.traversedCACerts))
{
if (addMatchingCerts(sel, certStores,
caCerts, searchAllCertStores)
&& !searchAllCertStores) {
return;
}
}
if (!currentState.isInitial() && Builder.USE_AIA) {
// check for AuthorityInformationAccess extension
AuthorityInfoAccessExtension aiaExt =
currentState.cert.getAuthorityInfoAccessExtension();
if (aiaExt != null) {
getCerts(aiaExt, caCerts);
}
}
if (debug != null) {
int numCerts = caCerts.size() - initialSize;
debug.println("ForwardBuilder.getMatchingCACerts: found " +
numCerts + " CA certs");
}
} | [
"private",
"void",
"getMatchingCACerts",
"(",
"ForwardState",
"currentState",
",",
"List",
"<",
"CertStore",
">",
"certStores",
",",
"Collection",
"<",
"X509Certificate",
">",
"caCerts",
")",
"throws",
"IOException",
"{",
"if",
"(",
"debug",
"!=",
"null",
")",
... | Retrieves all CA certificates which satisfy constraints
and requirements specified in the parameters and PKIX state. | [
"Retrieves",
"all",
"CA",
"certificates",
"which",
"satisfy",
"constraints",
"and",
"requirements",
"specified",
"in",
"the",
"parameters",
"and",
"PKIX",
"state",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/ForwardBuilder.java#L186-L347 |
35,092 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/ForwardBuilder.java | ForwardBuilder.getCerts | @SuppressWarnings("unchecked")
private boolean getCerts(AuthorityInfoAccessExtension aiaExt,
Collection<X509Certificate> certs)
{
if (Builder.USE_AIA == false) {
return false;
}
List<AccessDescription> adList = aiaExt.getAccessDescriptions();
if (adList == null || adList.isEmpty()) {
return false;
}
boolean add = false;
for (AccessDescription ad : adList) {
CertStore cs = URICertStore.getInstance(ad);
if (cs != null) {
try {
if (certs.addAll((Collection<X509Certificate>)
cs.getCertificates(caSelector))) {
add = true;
if (!searchAllCertStores) {
return true;
}
}
} catch (CertStoreException cse) {
if (debug != null) {
debug.println("exception getting certs from CertStore:");
cse.printStackTrace();
}
}
}
}
return add;
} | java | @SuppressWarnings("unchecked")
private boolean getCerts(AuthorityInfoAccessExtension aiaExt,
Collection<X509Certificate> certs)
{
if (Builder.USE_AIA == false) {
return false;
}
List<AccessDescription> adList = aiaExt.getAccessDescriptions();
if (adList == null || adList.isEmpty()) {
return false;
}
boolean add = false;
for (AccessDescription ad : adList) {
CertStore cs = URICertStore.getInstance(ad);
if (cs != null) {
try {
if (certs.addAll((Collection<X509Certificate>)
cs.getCertificates(caSelector))) {
add = true;
if (!searchAllCertStores) {
return true;
}
}
} catch (CertStoreException cse) {
if (debug != null) {
debug.println("exception getting certs from CertStore:");
cse.printStackTrace();
}
}
}
}
return add;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"boolean",
"getCerts",
"(",
"AuthorityInfoAccessExtension",
"aiaExt",
",",
"Collection",
"<",
"X509Certificate",
">",
"certs",
")",
"{",
"if",
"(",
"Builder",
".",
"USE_AIA",
"==",
"false",
")",
"{",... | because of the selector, so the cast is safe | [
"because",
"of",
"the",
"selector",
"so",
"the",
"cast",
"is",
"safe"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/ForwardBuilder.java#L355-L388 |
35,093 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/DelayQueue.java | DelayQueue.offer | public boolean offer(E e) {
final ReentrantLock lock = this.lock;
lock.lock();
try {
q.offer(e);
if (q.peek() == e) {
leader = null;
available.signal();
}
return true;
} finally {
lock.unlock();
}
} | java | public boolean offer(E e) {
final ReentrantLock lock = this.lock;
lock.lock();
try {
q.offer(e);
if (q.peek() == e) {
leader = null;
available.signal();
}
return true;
} finally {
lock.unlock();
}
} | [
"public",
"boolean",
"offer",
"(",
"E",
"e",
")",
"{",
"final",
"ReentrantLock",
"lock",
"=",
"this",
".",
"lock",
";",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"q",
".",
"offer",
"(",
"e",
")",
";",
"if",
"(",
"q",
".",
"peek",
"(",
"... | Inserts the specified element into this delay queue.
@param e the element to add
@return {@code true}
@throws NullPointerException if the specified element is null | [
"Inserts",
"the",
"specified",
"element",
"into",
"this",
"delay",
"queue",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/DelayQueue.java#L142-L155 |
35,094 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/DelayQueue.java | DelayQueue.take | public E take() throws InterruptedException {
final ReentrantLock lock = this.lock;
lock.lockInterruptibly();
try {
for (;;) {
E first = q.peek();
if (first == null)
available.await();
else {
long delay = first.getDelay(NANOSECONDS);
if (delay <= 0L)
return q.poll();
first = null; // don't retain ref while waiting
if (leader != null)
available.await();
else {
Thread thisThread = Thread.currentThread();
leader = thisThread;
try {
available.awaitNanos(delay);
} finally {
if (leader == thisThread)
leader = null;
}
}
}
}
} finally {
if (leader == null && q.peek() != null)
available.signal();
lock.unlock();
}
} | java | public E take() throws InterruptedException {
final ReentrantLock lock = this.lock;
lock.lockInterruptibly();
try {
for (;;) {
E first = q.peek();
if (first == null)
available.await();
else {
long delay = first.getDelay(NANOSECONDS);
if (delay <= 0L)
return q.poll();
first = null; // don't retain ref while waiting
if (leader != null)
available.await();
else {
Thread thisThread = Thread.currentThread();
leader = thisThread;
try {
available.awaitNanos(delay);
} finally {
if (leader == thisThread)
leader = null;
}
}
}
}
} finally {
if (leader == null && q.peek() != null)
available.signal();
lock.unlock();
}
} | [
"public",
"E",
"take",
"(",
")",
"throws",
"InterruptedException",
"{",
"final",
"ReentrantLock",
"lock",
"=",
"this",
".",
"lock",
";",
"lock",
".",
"lockInterruptibly",
"(",
")",
";",
"try",
"{",
"for",
"(",
";",
";",
")",
"{",
"E",
"first",
"=",
"... | Retrieves and removes the head of this queue, waiting if necessary
until an element with an expired delay is available on this queue.
@return the head of this queue
@throws InterruptedException {@inheritDoc} | [
"Retrieves",
"and",
"removes",
"the",
"head",
"of",
"this",
"queue",
"waiting",
"if",
"necessary",
"until",
"an",
"element",
"with",
"an",
"expired",
"delay",
"is",
"available",
"on",
"this",
"queue",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/DelayQueue.java#L209-L241 |
35,095 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/DelayQueue.java | DelayQueue.poll | public E poll(long timeout, TimeUnit unit) throws InterruptedException {
long nanos = unit.toNanos(timeout);
final ReentrantLock lock = this.lock;
lock.lockInterruptibly();
try {
for (;;) {
E first = q.peek();
if (first == null) {
if (nanos <= 0L)
return null;
else
nanos = available.awaitNanos(nanos);
} else {
long delay = first.getDelay(NANOSECONDS);
if (delay <= 0L)
return q.poll();
if (nanos <= 0L)
return null;
first = null; // don't retain ref while waiting
if (nanos < delay || leader != null)
nanos = available.awaitNanos(nanos);
else {
Thread thisThread = Thread.currentThread();
leader = thisThread;
try {
long timeLeft = available.awaitNanos(delay);
nanos -= delay - timeLeft;
} finally {
if (leader == thisThread)
leader = null;
}
}
}
}
} finally {
if (leader == null && q.peek() != null)
available.signal();
lock.unlock();
}
} | java | public E poll(long timeout, TimeUnit unit) throws InterruptedException {
long nanos = unit.toNanos(timeout);
final ReentrantLock lock = this.lock;
lock.lockInterruptibly();
try {
for (;;) {
E first = q.peek();
if (first == null) {
if (nanos <= 0L)
return null;
else
nanos = available.awaitNanos(nanos);
} else {
long delay = first.getDelay(NANOSECONDS);
if (delay <= 0L)
return q.poll();
if (nanos <= 0L)
return null;
first = null; // don't retain ref while waiting
if (nanos < delay || leader != null)
nanos = available.awaitNanos(nanos);
else {
Thread thisThread = Thread.currentThread();
leader = thisThread;
try {
long timeLeft = available.awaitNanos(delay);
nanos -= delay - timeLeft;
} finally {
if (leader == thisThread)
leader = null;
}
}
}
}
} finally {
if (leader == null && q.peek() != null)
available.signal();
lock.unlock();
}
} | [
"public",
"E",
"poll",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"long",
"nanos",
"=",
"unit",
".",
"toNanos",
"(",
"timeout",
")",
";",
"final",
"ReentrantLock",
"lock",
"=",
"this",
".",
"lock",
";",
"... | Retrieves and removes the head of this queue, waiting if necessary
until an element with an expired delay is available on this queue,
or the specified wait time expires.
@return the head of this queue, or {@code null} if the
specified waiting time elapses before an element with
an expired delay becomes available
@throws InterruptedException {@inheritDoc} | [
"Retrieves",
"and",
"removes",
"the",
"head",
"of",
"this",
"queue",
"waiting",
"if",
"necessary",
"until",
"an",
"element",
"with",
"an",
"expired",
"delay",
"is",
"available",
"on",
"this",
"queue",
"or",
"the",
"specified",
"wait",
"time",
"expires",
"."
... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/DelayQueue.java#L253-L292 |
35,096 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/DelayQueue.java | DelayQueue.peekExpired | private E peekExpired() {
// assert lock.isHeldByCurrentThread();
E first = q.peek();
return (first == null || first.getDelay(NANOSECONDS) > 0) ?
null : first;
} | java | private E peekExpired() {
// assert lock.isHeldByCurrentThread();
E first = q.peek();
return (first == null || first.getDelay(NANOSECONDS) > 0) ?
null : first;
} | [
"private",
"E",
"peekExpired",
"(",
")",
"{",
"// assert lock.isHeldByCurrentThread();",
"E",
"first",
"=",
"q",
".",
"peek",
"(",
")",
";",
"return",
"(",
"first",
"==",
"null",
"||",
"first",
".",
"getDelay",
"(",
"NANOSECONDS",
")",
">",
"0",
")",
"?"... | Returns first element only if it is expired.
Used only by drainTo. Call only when holding lock. | [
"Returns",
"first",
"element",
"only",
"if",
"it",
"is",
"expired",
".",
"Used",
"only",
"by",
"drainTo",
".",
"Call",
"only",
"when",
"holding",
"lock",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/DelayQueue.java#L328-L333 |
35,097 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/DelayQueue.java | DelayQueue.clear | public void clear() {
final ReentrantLock lock = this.lock;
lock.lock();
try {
q.clear();
} finally {
lock.unlock();
}
} | java | public void clear() {
final ReentrantLock lock = this.lock;
lock.lock();
try {
q.clear();
} finally {
lock.unlock();
}
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"final",
"ReentrantLock",
"lock",
"=",
"this",
".",
"lock",
";",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"q",
".",
"clear",
"(",
")",
";",
"}",
"finally",
"{",
"lock",
".",
"unlock",
"(",
")",
"... | Atomically removes all of the elements from this delay queue.
The queue will be empty after this call returns.
Elements with an unexpired delay are not waited for; they are
simply discarded from the queue. | [
"Atomically",
"removes",
"all",
"of",
"the",
"elements",
"from",
"this",
"delay",
"queue",
".",
"The",
"queue",
"will",
"be",
"empty",
"after",
"this",
"call",
"returns",
".",
"Elements",
"with",
"an",
"unexpired",
"delay",
"are",
"not",
"waited",
"for",
"... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/DelayQueue.java#L395-L403 |
35,098 | google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/DelayQueue.java | DelayQueue.remove | public boolean remove(Object o) {
final ReentrantLock lock = this.lock;
lock.lock();
try {
return q.remove(o);
} finally {
lock.unlock();
}
} | java | public boolean remove(Object o) {
final ReentrantLock lock = this.lock;
lock.lock();
try {
return q.remove(o);
} finally {
lock.unlock();
}
} | [
"public",
"boolean",
"remove",
"(",
"Object",
"o",
")",
"{",
"final",
"ReentrantLock",
"lock",
"=",
"this",
".",
"lock",
";",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"q",
".",
"remove",
"(",
"o",
")",
";",
"}",
"finally",
"{",
"... | Removes a single instance of the specified element from this
queue, if it is present, whether or not it has expired. | [
"Removes",
"a",
"single",
"instance",
"of",
"the",
"specified",
"element",
"from",
"this",
"queue",
"if",
"it",
"is",
"present",
"whether",
"or",
"not",
"it",
"has",
"expired",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/DelayQueue.java#L487-L495 |
35,099 | google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/CountersTable.java | CountersTable.getCounters | Vector getCounters(ElemNumber numberElem)
{
Vector counters = (Vector) this.get(numberElem);
return (null == counters) ? putElemNumber(numberElem) : counters;
} | java | Vector getCounters(ElemNumber numberElem)
{
Vector counters = (Vector) this.get(numberElem);
return (null == counters) ? putElemNumber(numberElem) : counters;
} | [
"Vector",
"getCounters",
"(",
"ElemNumber",
"numberElem",
")",
"{",
"Vector",
"counters",
"=",
"(",
"Vector",
")",
"this",
".",
"get",
"(",
"numberElem",
")",
";",
"return",
"(",
"null",
"==",
"counters",
")",
"?",
"putElemNumber",
"(",
"numberElem",
")",
... | Get the list of counters that corresponds to
the given ElemNumber object.
@param numberElem the given xsl:number element.
@return the list of counters that corresponds to
the given ElemNumber object. | [
"Get",
"the",
"list",
"of",
"counters",
"that",
"corresponds",
"to",
"the",
"given",
"ElemNumber",
"object",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/CountersTable.java#L58-L64 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.