rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
}
void doParse(Node node, boolean root) throws TransformerConfigurationException { try { String namespaceUri = node.getNamespaceURI(); if (XSL_NS.equals(namespaceUri) && node.getNodeType() == Node.ELEMENT_NODE) { String name = node.getLocalName(); Name...
preserveSpace.add(parseNameTest(st.nextToken()));
NameTest element = parseNameTest(st.nextToken()); preserveSpace.add(new StrippingInstruction(element, precedence));
void doParse(Node node, boolean root) throws TransformerConfigurationException { try { String namespaceUri = node.getNamespaceURI(); if (XSL_NS.equals(namespaceUri) && node.getNodeType() == Node.ELEMENT_NODE) { String name = node.getLocalName(); Name...
stripSpace.add(parseNameTest(st.nextToken()));
NameTest element = parseNameTest(st.nextToken()); stripSpace.add(new StrippingInstruction(element, precedence));
void doParse(Node node, boolean root) throws TransformerConfigurationException { try { String namespaceUri = node.getNamespaceURI(); if (XSL_NS.equals(namespaceUri) && node.getNodeType() == Node.ELEMENT_NODE) { String name = node.getLocalName(); Name...
{
static final String getAttribute(NamedNodeMap attrs, String name) { Node attr = attrs.getNamedItem(name); if (attr == null) { return null; } String ret = attr.getNodeValue(); if (ret.length() == 0) { return null; } return ret; }
}
static final String getAttribute(NamedNodeMap attrs, String name) { Node attr = attrs.getNamedItem(name); if (attr == null) { return null; } String ret = attr.getNodeValue(); if (ret.length() == 0) { return null; } return ret; }
{
Stylesheet getRootStylesheet() { Stylesheet stylesheet = this; while (stylesheet.parent != null) { stylesheet = stylesheet.parent; } return stylesheet; }
}
Stylesheet getRootStylesheet() { Stylesheet stylesheet = this; while (stylesheet.parent != null) { stylesheet = stylesheet.parent; } return stylesheet; }
{
TemplateNode getTemplate(QName mode, Node context, boolean applyImports) throws TransformerException { if (debug) { System.err.println("getTemplate: mode="+mode+" context="+context); } Set candidates = new TreeSet(); for (Iterator j = templates.iterator(); j.hasNext(); ) { Te...
} Set candidates = new TreeSet();
Template selected = null;
TemplateNode getTemplate(QName mode, Node context, boolean applyImports) throws TransformerException { if (debug) { System.err.println("getTemplate: mode="+mode+" context="+context); } Set candidates = new TreeSet(); for (Iterator j = templates.iterator(); j.hasNext(); ) { Te...
}
TemplateNode getTemplate(QName mode, Node context, boolean applyImports) throws TransformerException { if (debug) { System.err.println("getTemplate: mode="+mode+" context="+context); } Set candidates = new TreeSet(); for (Iterator j = templates.iterator(); j.hasNext(); ) { Te...
candidates.add(t);
if (selected == null) selected = t; else { if (t.precedence < selected.precedence || t.priority < selected.priority) continue; selected = t; }
TemplateNode getTemplate(QName mode, Node context, boolean applyImports) throws TransformerException { if (debug) { System.err.println("getTemplate: mode="+mode+" context="+context); } Set candidates = new TreeSet(); for (Iterator j = templates.iterator(); j.hasNext(); ) { Te...
if (candidates.isEmpty())
if (selected == null)
TemplateNode getTemplate(QName mode, Node context, boolean applyImports) throws TransformerException { if (debug) { System.err.println("getTemplate: mode="+mode+" context="+context); } Set candidates = new TreeSet(); for (Iterator j = templates.iterator(); j.hasNext(); ) { Te...
else { Template t = (Template) candidates.iterator().next();
TemplateNode getTemplate(QName mode, Node context, boolean applyImports) throws TransformerException { if (debug) { System.err.println("getTemplate: mode="+mode+" context="+context); } Set candidates = new TreeSet(); for (Iterator j = templates.iterator(); j.hasNext(); ) { Te...
currentTemplate = t;
currentTemplate = selected;
TemplateNode getTemplate(QName mode, Node context, boolean applyImports) throws TransformerException { if (debug) { System.err.println("getTemplate: mode="+mode+" context="+context); } Set candidates = new TreeSet(); for (Iterator j = templates.iterator(); j.hasNext(); ) { Te...
{ System.err.println("\ttemplate="+t+" context="+context); } return t.node; }
System.err.println("\ttemplate="+currentTemplate+" context="+context); return currentTemplate.node;
TemplateNode getTemplate(QName mode, Node context, boolean applyImports) throws TransformerException { if (debug) { System.err.println("getTemplate: mode="+mode+" context="+context); } Set candidates = new TreeSet(); for (Iterator j = templates.iterator(); j.hasNext(); ) { Te...
boolean isPreserved(Text text)
boolean isPreserved(Text text, boolean source)
boolean isPreserved(Text text) throws TransformerConfigurationException { // Check characters in text String value = text.getData(); if (value != null) { int len = value.length(); for (int i = 0; i < len; i++) { char c = value.charAt(i); if (c != 0x20 && ...
{
boolean isPreserved(Text text) throws TransformerConfigurationException { // Check characters in text String value = text.getData(); if (value != null) { int len = value.length(); for (int i = 0; i < len; i++) { char c = value.charAt(i); if (c != 0x20 && ...
}
boolean isPreserved(Text text) throws TransformerConfigurationException { // Check characters in text String value = text.getData(); if (value != null) { int len = value.length(); for (int i = 0; i < len; i++) { char c = value.charAt(i); if (c != 0x20 && ...
if (!preserveSpace.isEmpty())
if (source)
boolean isPreserved(Text text) throws TransformerConfigurationException { // Check characters in text String value = text.getData(); if (value != null) { int len = value.length(); for (int i = 0; i < len; i++) { char c = value.charAt(i); if (c != 0x20 && ...
for (Iterator i = preserveSpace.iterator(); i.hasNext(); )
boolean preserve = true; float psPriority = 0.0f, ssPriority = 0.0f; if (!stripSpace.isEmpty())
boolean isPreserved(Text text) throws TransformerConfigurationException { // Check characters in text String value = text.getData(); if (value != null) { int len = value.length(); for (int i = 0; i < len; i++) { char c = value.charAt(i); if (c != 0x20 && ...
NameTest preserveTest = (NameTest) i.next(); if (preserveTest.matches(ctx, 1, 1))
StrippingInstruction ssi = null, psi = null; for (Iterator i = stripSpace.iterator(); i.hasNext(); )
boolean isPreserved(Text text) throws TransformerConfigurationException { // Check characters in text String value = text.getData(); if (value != null) { int len = value.length(); for (int i = 0; i < len; i++) { char c = value.charAt(i); if (c != 0x20 && ...
boolean override = false; if (!stripSpace.isEmpty())
StrippingInstruction si = (StrippingInstruction) i.next(); if (si.element.matches(ctx, 1, 1))
boolean isPreserved(Text text) throws TransformerConfigurationException { // Check characters in text String value = text.getData(); if (value != null) { int len = value.length(); for (int i = 0; i < len; i++) { char c = value.charAt(i); if (c != 0x20 && ...
for (Iterator j = stripSpace.iterator(); j.hasNext(); )
if (ssi != null)
boolean isPreserved(Text text) throws TransformerConfigurationException { // Check characters in text String value = text.getData(); if (value != null) { int len = value.length(); for (int i = 0; i < len; i++) { char c = value.charAt(i); if (c != 0x20 && ...
NameTest stripTest = (NameTest) j.next(); if (stripTest.matches(ctx, 1, 1))
if (si.precedence < ssi.precedence) continue; float p = si.getPriority(); if (p < ssPriority) continue; } ssi = si; } } for (Iterator i = preserveSpace.iterator(); i.hasNext(); )
boolean isPreserved(Text text) throws TransformerConfigurationException { // Check characters in text String value = text.getData(); if (value != null) { int len = value.length(); for (int i = 0; i < len; i++) { char c = value.charAt(i); if (c != 0x20 && ...
override = true; break;
StrippingInstruction si = (StrippingInstruction) i.next(); if (si.element.matches(ctx, 1, 1)) { if (psi != null) { if (si.precedence < psi.precedence) continue; float p = si.getPriority(); if (p < psPriority) continue;
boolean isPreserved(Text text) throws TransformerConfigurationException { // Check characters in text String value = text.getData(); if (value != null) { int len = value.length(); for (int i = 0; i < len; i++) { char c = value.charAt(i); if (c != 0x20 && ...
if (!override)
if (ssi != null)
boolean isPreserved(Text text) throws TransformerConfigurationException { // Check characters in text String value = text.getData(); if (value != null) { int len = value.length(); for (int i = 0; i < len; i++) { char c = value.charAt(i); if (c != 0x20 && ...
return true;
if (psi != null) { if (psi.precedence < ssi.precedence) preserve = false; else if (psPriority < ssPriority) preserve = false;
boolean isPreserved(Text text) throws TransformerConfigurationException { // Check characters in text String value = text.getData(); if (value != null) { int len = value.length(); for (int i = 0; i < len; i++) { char c = value.charAt(i); if (c != 0x20 && ...
} else if ("text".equals(ctx.getLocalName()) && XSL_NS.equals(ctx.getNamespaceURI())) { return true;
boolean isPreserved(Text text) throws TransformerConfigurationException { // Check characters in text String value = text.getData(); if (value != null) { int len = value.length(); for (int i = 0; i < len; i++) { char c = value.charAt(i); if (c != 0x20 && ...
{
final TemplateNode parseApplyTemplates(Node node) throws TransformerConfigurationException, XPathExpressionException { NamedNodeMap attrs = node.getAttributes(); String m = getAttribute(attrs, "mode"); QName mode = (m == null) ? null : getQName(m); String s = getAttribute(attrs, "select"); if (s ==...
}
final TemplateNode parseApplyTemplates(Node node) throws TransformerConfigurationException, XPathExpressionException { NamedNodeMap attrs = node.getAttributes(); String m = getAttribute(attrs, "mode"); QName mode = (m == null) ? null : getQName(m); String s = getAttribute(attrs, "select"); if (s ==...
{
final NameTest parseNameTest(String token) { if ("*".equals(token)) { return new NameTest(null, true, true); } else if (token.endsWith(":*")) { QName qName = getQName(token.substring(0, token.length() - 2)); return new NameTest(qName, true, false); } else { ...
}
final NameTest parseNameTest(String token) { if ("*".equals(token)) { return new NameTest(null, true, true); } else if (token.endsWith(":*")) { QName qName = getQName(token.substring(0, token.length() - 2)); return new NameTest(qName, true, false); } else { ...
QName qName = getQName(token.substring(0, token.length() - 2));
QName qName = getQName(token);
final NameTest parseNameTest(String token) { if ("*".equals(token)) { return new NameTest(null, true, true); } else if (token.endsWith(":*")) { QName qName = getQName(token.substring(0, token.length() - 2)); return new NameTest(qName, true, false); } else { ...
{
final void parseOutput(Node node, NamedNodeMap attrs) throws TransformerConfigurationException { output = node; String method = getAttribute(attrs, "method"); if ("xml".equals(method) || method == null) { outputMethod = OUTPUT_XML; } else if ("html".equals(method)) { outpu...
}
final void parseOutput(Node node, NamedNodeMap attrs) throws TransformerConfigurationException { output = node; String method = getAttribute(attrs, "method"); if ("xml".equals(method) || method == null) { outputMethod = OUTPUT_XML; } else if ("html".equals(method)) { outpu...
outputPublicId = getAttribute(attrs, "public-id"); outputSystemId = getAttribute(attrs, "system-id");
outputPublicId = getAttribute(attrs, "doctype-public"); outputSystemId = getAttribute(attrs, "doctype-system");
final void parseOutput(Node node, NamedNodeMap attrs) throws TransformerConfigurationException { output = node; String method = getAttribute(attrs, "method"); if ("xml".equals(method) || method == null) { outputMethod = OUTPUT_XML; } else if ("html".equals(method)) { outpu...
{
final List parseSortKeys(Node node) throws TransformerConfigurationException, XPathExpressionException { List ret = new LinkedList(); while (node != null) { String namespaceUri = node.getNamespaceURI(); if (Stylesheet.XSL_NS.equals(namespaceUri) && Node.ELEMENT_NODE == node.get...
}
final List parseSortKeys(Node node) throws TransformerConfigurationException, XPathExpressionException { List ret = new LinkedList(); while (node != null) { String namespaceUri = node.getNamespaceURI(); if (Stylesheet.XSL_NS.equals(namespaceUri) && Node.ELEMENT_NODE == node.get...
{
final List parseWithParams(Node node) throws TransformerConfigurationException, XPathExpressionException { List ret = new LinkedList(); while (node != null) { String namespaceUri = node.getNamespaceURI(); if (Stylesheet.XSL_NS.equals(namespaceUri) && Node.ELEMENT_NODE == node.g...
}
final List parseWithParams(Node node) throws TransformerConfigurationException, XPathExpressionException { List ret = new LinkedList(); while (node != null) { String namespaceUri = node.getNamespaceURI(); if (Stylesheet.XSL_NS.equals(namespaceUri) && Node.ELEMENT_NODE == node.g...
{
public XPathFunction resolveFunction(QName name, int arity) { String uri = name.getNamespaceURI(); if (XSL_NS.equals(uri) || uri == null || uri.length() == 0) { String localName = name.getLocalPart(); if ("document".equals(localName) && (arity == 1 || arity == 2)) { if (c...
}
public XPathFunction resolveFunction(QName name, int arity) { String uri = name.getNamespaceURI(); if (XSL_NS.equals(uri) || uri == null || uri.length() == 0) { String localName = name.getLocalPart(); if ("document".equals(localName) && (arity == 1 || arity == 2)) { if (c...
{ return new ElementAvailableFunction(this); }
return new ElementAvailableFunction(new NamespaceProxy(current));
public XPathFunction resolveFunction(QName name, int arity) { String uri = name.getNamespaceURI(); if (XSL_NS.equals(uri) || uri == null || uri.length() == 0) { String localName = name.getLocalPart(); if ("document".equals(localName) && (arity == 1 || arity == 2)) { if (c...
{ return new FunctionAvailableFunction(this); }
return new FunctionAvailableFunction(new NamespaceProxy(current));
public XPathFunction resolveFunction(QName name, int arity) { String uri = name.getNamespaceURI(); if (XSL_NS.equals(uri) || uri == null || uri.length() == 0) { String localName = name.getLocalPart(); if ("document".equals(localName) && (arity == 1 || arity == 2)) { if (c...
return BigInteger.make((long) x + (long) y);
return valueOf((long) x + (long) y);
private static final BigInteger add(int x, int y) { return BigInteger.make((long) x + (long) y); }
if (nwords <= 1) return new BigInteger();
private static BigInteger alloc(int nwords) { if (nwords <= 1) return new BigInteger(); BigInteger result = new BigInteger(); result.words = new int[nwords]; return result; }
if (nwords > 1)
private static BigInteger alloc(int nwords) { if (nwords <= 1) return new BigInteger(); BigInteger result = new BigInteger(); result.words = new int[nwords]; return result; }
return BigInteger.make(x.ival & y);
return valueOf(x.ival & y);
private static BigInteger and(BigInteger x, int y) { if (x.words == null) return BigInteger.make(x.ival & y); if (y >= 0) return BigInteger.make(x.words[0] & y); int len = x.ival; int[] words = new int[len]; words[0] = x.words[0] & y; while (--len > 0) words[len] = x.words[len]; r...
return BigInteger.make(x.words[0] & y);
return valueOf(x.words[0] & y);
private static BigInteger and(BigInteger x, int y) { if (x.words == null) return BigInteger.make(x.ival & y); if (y >= 0) return BigInteger.make(x.words[0] & y); int len = x.ival; int[] words = new int[len]; words[0] = x.words[0] & y; while (--len > 0) words[len] = x.words[len]; r...
return BigInteger.make(words, x.ival);
return make(words, x.ival);
private static BigInteger and(BigInteger x, int y) { if (x.words == null) return BigInteger.make(x.ival & y); if (y >= 0) return BigInteger.make(x.words[0] & y); int len = x.ival; int[] words = new int[len]; words[0] = x.words[0] & y; while (--len > 0) words[len] = x.words[len]; r...
else
public int bitLength() { if (words == null) return MPN.intLength(ival); else return MPN.intLength(words, ival); }
case 15: return make(-1);
case 15: return valueOf(-1);
private static BigInteger bitOp(int op, BigInteger x, BigInteger y) { switch (op) { case 0: return ZERO; case 1: return x.and(y); case 3: return x; case 5: return y; case 15: return make(-1); } BigInteger result = new BigInteger(); setBitOp(result, op, x, y);...
word = (word << 8) | (((int) bytes[bptr]) & 0xff);
word = (word << 8) | (bytes[bptr] & 0xff);
private static int[] byteArrayToIntArray(byte[] bytes, int sign) { // Determine number of words needed. int[] words = new int[bytes.length/4 + 1]; int nwords = words.length; // Create a int out of modulo 4 high order bytes. int bptr = 0; int word = sign; for (int i = bytes.length % 4; i > 0; --i...
(((int) bytes[bptr++]) & 0xff) << 16 | (((int) bytes[bptr++]) & 0xff) << 8 | (((int) bytes[bptr++]) & 0xff);
(bytes[bptr++] & 0xff) << 16 | (bytes[bptr++] & 0xff) << 8 | (bytes[bptr++] & 0xff);
private static int[] byteArrayToIntArray(byte[] bytes, int sign) { // Determine number of words needed. int[] words = new int[bytes.length/4 + 1]; int nwords = words.length; // Create a int out of modulo 4 high order bytes. int bptr = 0; int word = sign; for (int i = bytes.length % 4; i > 0; --i...
return smallFixNums[(int) ival - minFixNum];
return smallFixNums[ival - minFixNum];
private BigInteger canonicalize() { if (words != null && (ival = BigInteger.wordsNeeded(words, ival)) <= 1) { if (ival == 1) ival = words[0]; words = null; } if (words == null && ival >= minFixNum && ival <= maxFixNum) return smallFixNums[(int) ival - minFixNum]; return this; }
divide(BigInteger.make(x), BigInteger.make(y),
divide(valueOf(x), valueOf(y),
private static void divide(long x, long y, BigInteger quotient, BigInteger remainder, int rounding_mode) { boolean xNegative, yNegative; if (x < 0) { xNegative = true; if (x == Long.MIN_VALUE) { divide(BigInteger.make(x), BigInteger.make(y), quotient, remainder, rounding_mode); ...
return BigInteger.neg(this).roundToDouble(0, true, false); else
return neg(this).roundToDouble(0, true, false);
public double doubleValue() { if (words == null) return (double) ival; if (ival <= 2) return (double) longValue(); if (isNegative()) return BigInteger.neg(this).roundToDouble(0, true, false); else return roundToDouble(0, false, false); }
int[] xy;
private static final int[] euclidInv(int a, int b, int prevDiv) { // Storage for return values, plus one slot for a temp int (see below). int[] xy; if (b == 0) throw new ArithmeticException("not invertible"); else if (b == 1) { // Success: values are indeed invertible! // Bottom of the recursi...
else if (b == 1) {
if (b == 1)
private static final int[] euclidInv(int a, int b, int prevDiv) { // Storage for return values, plus one slot for a temp int (see below). int[] xy; if (b == 0) throw new ArithmeticException("not invertible"); else if (b == 1) { // Success: values are indeed invertible! // Bottom of the recursi...
xy = new int[3]; xy[0] = -prevDiv; xy[1] = 1; return xy; }
return new int[] { -prevDiv, 1 };
private static final int[] euclidInv(int a, int b, int prevDiv) { // Storage for return values, plus one slot for a temp int (see below). int[] xy; if (b == 0) throw new ArithmeticException("not invertible"); else if (b == 1) { // Success: values are indeed invertible! // Bottom of the recursi...
xy = euclidInv(b, a % b, a / b); xy[2] = xy[0]; xy[0] = xy[2] * -prevDiv + xy[1]; xy[1] = xy[2];
int[] xy = euclidInv(b, a % b, a / b); a = xy[0]; xy[0] = a * -prevDiv + xy[1]; xy[1] = a;
private static final int[] euclidInv(int a, int b, int prevDiv) { // Storage for return values, plus one slot for a temp int (see below). int[] xy; if (b == 0) throw new ArithmeticException("not invertible"); else if (b == 1) { // Success: values are indeed invertible! // Bottom of the recursi...
int buf_size = len * (MPN.chars_per_word(radix) + 1);
private void format(int radix, StringBuffer buffer) { if (words == null) buffer.append(Integer.toString(ival, radix)); else if (ival <= 2) buffer.append(Long.toString(longValue(), radix)); else { boolean neg = isNegative(); int[] work; if (neg || radix != 16) { work = new int[ival]; ...
int tmp = a; a = b; b = tmp;
tmp = a; a = b; b = tmp;
private static final int gcd(int a, int b) { // Euclid's algorithm, copied from libg++. if (b > a) { int tmp = a; a = b; b = tmp; } for(;;) { if (b == 0) return a; else if (b == 1) return b; else { int tmp = b; b = a % b; a = tmp; } } }
else if (b == 1)
if (b == 1)
private static final int gcd(int a, int b) { // Euclid's algorithm, copied from libg++. if (b > a) { int tmp = a; a = b; b = tmp; } for(;;) { if (b == 0) return a; else if (b == 1) return b; else { int tmp = b; b = a % b; a = tmp; } } }
else { int tmp = b;
tmp = b;
private static final int gcd(int a, int b) { // Euclid's algorithm, copied from libg++. if (b > a) { int tmp = a; a = b; b = tmp; } for(;;) { if (b == 0) return a; else if (b == 1) return b; else { int tmp = b; b = a % b; a = tmp; } } }
}
private static final int gcd(int a, int b) { // Euclid's algorithm, copied from libg++. if (b > a) { int tmp = a; a = b; b = tmp; } for(;;) { if (b == 0) return a; else if (b == 1) return b; else { int tmp = b; b = a % b; a = tmp; } } }
for (int i = 0; i < primes.length; i++)
BigInteger rem = new BigInteger(); int i; for (i = 0; i < primes.length; i++)
public boolean isProbablePrime(int certainty) { /** We'll use the Rabin-Miller algorithm for doing a probabilistic * primality test. It is fast, easy and has faster decreasing odds of a * composite passing than with other tests. This means that this * method will actually have a probability much gre...
if (remainder(make(primes[i])).isZero())
divide(this, smallFixNums[primes[i] - minFixNum], null, rem, TRUNCATE); if (rem.canonicalize().isZero())
public boolean isProbablePrime(int certainty) { /** We'll use the Rabin-Miller algorithm for doing a probabilistic * primality test. It is fast, easy and has faster decreasing odds of a * composite passing than with other tests. This means that this * method will actually have a probability much gre...
BigInteger m = pMinus1.divide(make(2L << b - 1));
BigInteger m = pMinus1.divide(valueOf(2L << b - 1));
public boolean isProbablePrime(int certainty) { /** We'll use the Rabin-Miller algorithm for doing a probabilistic * primality test. It is fast, easy and has faster decreasing odds of a * composite passing than with other tests. This means that this * method will actually have a probability much gre...
Random rand = new Random(); while (certainty-- > 0)
int bits = this.bitLength(); for (i = 0; i < k.length; i++) if (bits <= k[i]) break; int trials = t[i]; if (certainty > 80) trials *= 2; BigInteger z; for (int t = 0; t < trials; t++)
public boolean isProbablePrime(int certainty) { /** We'll use the Rabin-Miller algorithm for doing a probabilistic * primality test. It is fast, easy and has faster decreasing odds of a * composite passing than with other tests. This means that this * method will actually have a probability much gre...
int a = rand.nextInt(); a = (a < 0 ? -a : a) % 1023 + 2; BigInteger z = make(a).modPow(m, this);
z = smallFixNums[primes[t] - minFixNum].modPow(m, this);
public boolean isProbablePrime(int certainty) { /** We'll use the Rabin-Miller algorithm for doing a probabilistic * primality test. It is fast, easy and has faster decreasing odds of a * composite passing than with other tests. This means that this * method will actually have a probability much gre...
int i;
public boolean isProbablePrime(int certainty) { /** We'll use the Rabin-Miller algorithm for doing a probabilistic * primality test. It is fast, easy and has faster decreasing odds of a * composite passing than with other tests. This means that this * method will actually have a probability much gre...
z = z.modPow(make(2), this);
z = z.modPow(valueOf(2), this);
public boolean isProbablePrime(int certainty) { /** We'll use the Rabin-Miller algorithm for doing a probabilistic * primality test. It is fast, easy and has faster decreasing odds of a * composite passing than with other tests. This means that this * method will actually have a probability much gre...
private static BigInteger make(long value)
private static BigInteger make(int[] words, int len)
private static BigInteger make(long value) { if (value >= minFixNum && value <= maxFixNum) return smallFixNums[(int)value - minFixNum]; int i = (int) value; if ((long)i == value) return new BigInteger(i); BigInteger result = alloc(2); result.ival = 2; result.words[0] = i; result.words[...
if (value >= minFixNum && value <= maxFixNum) return smallFixNums[(int)value - minFixNum]; int i = (int) value; if ((long)i == value) return new BigInteger(i); BigInteger result = alloc(2); result.ival = 2; result.words[0] = i; result.words[1] = (int) (value >> 32); return result;
if (words == null) return valueOf(len); len = BigInteger.wordsNeeded(words, len); if (len <= 1) return len == 0 ? ZERO : valueOf(words[0]); BigInteger num = new BigInteger(); num.words = words; num.ival = len; return num;
private static BigInteger make(long value) { if (value >= minFixNum && value <= maxFixNum) return smallFixNums[(int)value - minFixNum]; int i = (int) value; if ((long)i == value) return new BigInteger(i); BigInteger result = alloc(2); result.ival = 2; result.words[0] = i; result.words[...
else if (isOne())
if (isOne())
public BigInteger modInverse(BigInteger y) { if (y.isNegative() || y.isZero()) throw new ArithmeticException("non-positive modulo"); // Degenerate cases. if (y.isOne()) return ZERO; else if (isOne()) return ONE; // Use Euclid's algorithm as in gcd() but do this recursively // rather ...
int xval = ival; int yval = y.ival;
public BigInteger modInverse(BigInteger y) { if (y.isNegative() || y.isZero()) throw new ArithmeticException("non-positive modulo"); // Degenerate cases. if (y.isOne()) return ZERO; else if (isOne()) return ONE; // Use Euclid's algorithm as in gcd() but do this recursively // rather ...
if (words != null || isNegative()) xval = mod(y).ival;
int xval = (words != null || isNegative()) ? mod(y).ival : ival; int yval = y.ival;
public BigInteger modInverse(BigInteger y) { if (y.isNegative() || y.isZero()) throw new ArithmeticException("non-positive modulo"); // Degenerate cases. if (y.isOne()) return ZERO; else if (isOne()) return ONE; // Use Euclid's algorithm as in gcd() but do this recursively // rather ...
BigInteger x = this;
public BigInteger modInverse(BigInteger y) { if (y.isNegative() || y.isZero()) throw new ArithmeticException("non-positive modulo"); // Degenerate cases. if (y.isOne()) return ZERO; else if (isOne()) return ONE; // Use Euclid's algorithm as in gcd() but do this recursively // rather ...
if (isNegative()) x = mod(y);
BigInteger x = isNegative() ? this.mod(y) : this;
public BigInteger modInverse(BigInteger y) { if (y.isNegative() || y.isZero()) throw new ArithmeticException("non-positive modulo"); // Degenerate cases. if (y.isOne()) return ZERO; else if (isOne()) return ONE; // Use Euclid's algorithm as in gcd() but do this recursively // rather ...
BigInteger tmp = x; x = y; y = tmp;
result = x; x = y; y = result;
public BigInteger modInverse(BigInteger y) { if (y.isNegative() || y.isZero()) throw new ArithmeticException("non-positive modulo"); // Degenerate cases. if (y.isOne()) return ZERO; else if (isOne()) return ONE; // Use Euclid's algorithm as in gcd() but do this recursively // rather ...
result = euclidInv(y, rem, quot)[swapped ? 0 : 1];
BigInteger[] xy = new BigInteger[2]; euclidInv(y, rem, quot, xy); result = swapped ? xy[0] : xy[1];
public BigInteger modInverse(BigInteger y) { if (y.isNegative() || y.isZero()) throw new ArithmeticException("non-positive modulo"); // Degenerate cases. if (y.isOne()) return ZERO; else if (isOne()) return ONE; // Use Euclid's algorithm as in gcd() but do this recursively // rather ...
BigInteger s, t, u; int i; s = ONE; t = this; u = exponent;
BigInteger s = ONE; BigInteger t = this; BigInteger u = exponent;
public BigInteger modPow(BigInteger exponent, BigInteger m) { if (m.isNegative() || m.isZero()) throw new ArithmeticException("non-positive modulo"); if (exponent.isNegative()) return modInverse(m); if (exponent.isOne()) return mod(m); // To do this naively by first raising this to the pow...
return make(- x.ival);
return valueOf(- x.ival);
private static BigInteger neg(BigInteger x) { if (x.words == null && x.ival != Integer.MIN_VALUE) return make(- x.ival); BigInteger result = new BigInteger(0); result.setNegative(x); return result.canonicalize(); }
else
public BigInteger pow(int exponent) { if (exponent <= 0) { if (exponent == 0) return ONE; else throw new ArithmeticException("negative exponent"); } if (isZero()) return this; int plen = words == null ? 1 : ival; // Length of pow2. int blen = ((bitLength() * exponent) >> 5) + 2 * plen...
if (BigInteger.negate(words, x.words, len))
if (negate(words, x.words, len))
private void setNegative(BigInteger x) { int len = x.ival; if (x.words == null) { if (len == Integer.MIN_VALUE) set(- (long) len); else set(-len); return; } realloc(len + 1); if (BigInteger.negate(words, x.words, len)) words[len++] = 0; ival = len; }
return make(count > -32 ? x.ival >> (-count) : x.ival < 0 ? -1 : 0);
return valueOf(count > -32 ? x.ival >> (-count) : x.ival < 0 ? -1 : 0);
private static BigInteger shift(BigInteger x, int count) { if (x.words == null) { if (count <= 0) return make(count > -32 ? x.ival >> (-count) : x.ival < 0 ? -1 : 0); if (count < 32) return make((long) x.ival << count); } if (count == 0) return x; BigInteger result = new BigInteger(0); ...
return make((long) x.ival << count);
return valueOf((long) x.ival << count);
private static BigInteger shift(BigInteger x, int count) { if (x.words == null) { if (count <= 0) return make(count > -32 ? x.ival >> (-count) : x.ival < 0 ? -1 : 0); if (count < 32) return make((long) x.ival << count); } if (count == 0) return x; BigInteger result = new BigInteger(0); ...
return BigInteger.make((long) xlen * (long) y);
return valueOf((long) xlen * (long) y);
private static final BigInteger times(BigInteger x, int y) { if (y == 0) return ZERO; if (y == 1) return x; int[] xwords = x.words; int xlen = x.ival; if (xwords == null) return BigInteger.make((long) xlen * (long) y); boolean negative; BigInteger result = BigInteger.alloc(xlen + ...
return make(val);
if (val >= minFixNum && val <= maxFixNum) return smallFixNums[(int) val - minFixNum]; int i = (int) val; if ((long) i == val) return new BigInteger(i); BigInteger result = alloc(2); result.ival = 2; result.words[0] = i; result.words[1] = (int)(val >> 32); return result;
public static BigInteger valueOf(long val) { return make(val); }
font = new Font("-FontForge-Bitstream Vera Sans Mono-Book-R-Normal-SansMono--12-120-75-75-P-69-FontSpecific", Font.PLAIN, 12);
font = new Font("-FontForge-Bitstream Vera Sans Mono-Book-R-Normal-SansMono--12-120-75-75-P-69-ISO10646", Font.PLAIN, 12);
public FBScreen(Surface g) { this.g = g; w = 6; h = 18; sh = h * FBPcTextScreen.SCREEN_HEIGHT + 2 * margin; sw = w * FBPcTextScreen.SCREEN_WIDTH + 2 * margin; bi = new JNodeBufferedImage(sw, sh, BufferedImage.TYPE_INT_ARGB); ...
new Thread(new Runnable() { public void run() { while(true){ try{ paintComponent(); synchronized(FBScreen.this){ if(!update) { update = false; FBScreen.this.wait(); } } }catch(InterruptedException x ){ break; } } } }, "FBScreenUpdater").start();
public FBScreen(Surface g) { this.g = g; w = 6; h = 18; sh = h * FBPcTextScreen.SCREEN_HEIGHT + 2 * margin; sw = w * FBPcTextScreen.SCREEN_WIDTH + 2 * margin; bi = new JNodeBufferedImage(sw, sh, BufferedImage.TYPE_INT_ARGB); ...
public void repaint() { paintComponent();
public synchronized void repaint() { if(!update){ update = true; notifyAll(); }
public void repaint() { paintComponent(); }
final DeviceManager dm = (DeviceManager) InitialNaming.lookup(DeviceManager.NAME);
final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME);
public static void main(String[] args) throws Exception { final String devId = (args.length > 0) ? args[0] : "" /*"fb0"*/; Surface g = null; try { Device dev = null; if("".equals(devId)){ final Collection<Device> devs = DeviceUtils.getDevicesByAPI(FrameBuffe...
final FrameBufferAPI api = (FrameBufferAPI) dev.getAPI(FrameBufferAPI.class);
final FrameBufferAPI api = dev.getAPI(FrameBufferAPI.class);
public static void main(String[] args) throws Exception { final String devId = (args.length > 0) ? args[0] : "" /*"fb0"*/; Surface g = null; try { Device dev = null; if("".equals(devId)){ final Collection<Device> devs = DeviceUtils.getDevicesByAPI(FrameBuffe...
if (b.isContentAreaFilled() && (UIManager.get(getPropertyPrefix() + "gradient") != null) && b.isEnabled() && (b.getBackground() instanceof UIResource)) updateWidthGradient(g, b, b.getParent()); else super.update(g, c); }
if ((b.getBackground() instanceof UIResource) && b.isContentAreaFilled() && b.isEnabled()) { ButtonModel m = b.getModel(); String uiKey = "Button.gradient"; if (! isToolbarButton(b)) { if (! m.isArmed() && ! m.isPressed() && isDrawingGradient(uiKey)) { MetalUtils.paintGradient(g, 0, 0, b.getWidth(), b.getHeight(), Swin...
public void update(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; if (b.isContentAreaFilled() && (UIManager.get(getPropertyPrefix() + "gradient") != null) && b.isEnabled() && (b.getBackground() instanceof UIResource)) updateWidthGradient(g, b, b.getParent()); el...
return (entry >= eofMarker);
switch (bitSize) { case 12 : return (entry >=0xFF8); case 16 : return ((entry >= 0xFFF8)); case 32 : return (entry >= 0xFFFFFFF8); default : throw new IllegalArgumentException("Invalid bitSize " + bitSize); }
protected boolean isEofCluster(long entry) { return (entry >= eofMarker); }
servant = null;
public OutputStream _invoke(String method, InputStream input, ResponseHandler r_handler ) throws SystemException { boolean intercept = false; ServerRequestInterceptorOperations interceptor = null; gnuServerRequestInfo info = null; ResponseHandlerImpl i_handler = null; try...
if (noRetain) servant = null;
public OutputStream _invoke(String method, InputStream input, ResponseHandler r_handler ) throws SystemException { boolean intercept = false; ServerRequestInterceptorOperations interceptor = null; gnuServerRequestInfo info = null; ResponseHandlerImpl i_handler = null; try...
if (GraphicsEnvironment.isHeadless())
if (peer != null) return peer.createVolatileImage(width, height);
public VolatileImage createVolatileImage(int width, int height) { if (GraphicsEnvironment.isHeadless()) return null; GraphicsConfiguration config = getGraphicsConfiguration(); return config == null ? null : config.createCompatibleVolatileImage(width, height); }