rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
super(entry);
super(name);
public JarEntry(ZipEntry entry) { super(entry); attr = null; certs = null; }
public int read(byte[] b, int off, int len) throws IOException
public int read() throws IOException
public int read(byte[] b, int off, int len) throws IOException { if (len == 0) return 0; if (crc == null) throw new IOException("Stream closed."); if (entry == null) return -1; boolean finished = false; switch (method) { case ZipOutputStream.DEFLATED: len = super.read(b, off, len); if ...
if (len == 0) return 0; if (crc == null) throw new IOException("Stream closed."); if (entry == null)
byte[] b = new byte[1]; if (read(b, 0, 1) <= 0)
public int read(byte[] b, int off, int len) throws IOException { if (len == 0) return 0; if (crc == null) throw new IOException("Stream closed."); if (entry == null) return -1; boolean finished = false; switch (method) { case ZipOutputStream.DEFLATED: len = super.read(b, off, len); if ...
boolean finished = false; switch (method) { case ZipOutputStream.DEFLATED: len = super.read(b, off, len); if (len < 0) { if (!inf.finished()) throw new ZipException("Inflater not finished!?"); avail = inf.getRemaining(); if ((flags & 8) != 0) readDataDescr(); if (inf.getTotalIn() != csize || inf.getTotalOut() != size)...
return b[0] & 0xff;
public int read(byte[] b, int off, int len) throws IOException { if (len == 0) return 0; if (crc == null) throw new IOException("Stream closed."); if (entry == null) return -1; boolean finished = false; switch (method) { case ZipOutputStream.DEFLATED: len = super.read(b, off, len); if ...
for (Iterator<FSEntry> i = entry.getDirectory().iterator(); i.hasNext();) {
for (Iterator<? extends FSEntry> i = entry.getDirectory().iterator(); i.hasNext();) {
public String[] list(String directory) throws IOException { final FSEntry entry = getEntry(directory); if (entry == null) { throw new FileNotFoundException(directory); } if (!entry.isDirectory()) { throw new IOException("Cannot list on non-directories " + directory)...
public static DataBuffer createBuffer(int dataType, int size) { return createBuffer(dataType, size, 1);
public static DataBuffer createBuffer(int dataType, Object data, int size) { if (data == null) return createBuffer(dataType, size, 1); return createBufferFromData(dataType, data, size);
public static DataBuffer createBuffer(int dataType, int size) { return createBuffer(dataType, size, 1); }
<T> T[] toArray(T[] a);
Object[] toArray();
<T> T[] toArray(T[] a);
textComponent.setBackground(background);
protected void installDefaults() { Caret caret = textComponent.getCaret(); if (caret == null) { caret = createCaret(); textComponent.setCaret(caret); } Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null) textComponent.setHighlighter(createHighli...
public View create(Element elem);
View create (Element elem);
public View create(Element elem);
public Object getValue(String key);
Object getValue(String key);
public Object getValue(String key);
return super.get(key);
return this.get (key, getDefaultLocale ());
public Object get(Object key) { // XXX Obey 1.4 specs return super.get(key); }
throw new Error("not implemented");
Object old = super.put (key, value); if (key instanceof String && old != value) firePropertyChange ((String) key, old, value); return old;
public Object put(Object key, Object value) { throw new Error("not implemented"); }
Dimension d = new Dimension(100,100); return d;
return null;
public Dimension getPreferredSize(JComponent c) { // FIXME: integrate with Scrollable Dimension d = new Dimension(100,100); return d; }
c.setOpaque(true);
void installDefaults(JComponent c) { }
c.setLayout(new ViewportLayout());
public void installUI(JComponent c) { super.installUI(c); installListeners(c); }
if (c.getBackground() != null) { java.awt.Color save = g2.getColor(); g2.setColor(c.getBackground()); g2.fillRect (0, 0, backingStoreWidth, backingStoreHeight); g2.setColor(save); save = g.getColor(); g.setColor(c.getBackground()); g.fillRect (0, 0, portBounds.width, portBounds.height); g.setColor(save); } else { ...
public void paint(Graphics g, JComponent c) { JViewport v = (JViewport)c; Component view = v.getView(); if (view == null) return; Point pos = v.getViewPosition(); Rectangle viewBounds = view.getBounds(); if (backingStoreImage == null || backingStoreWidth != viewBounds.width ...
Dimension viewportSize = new Dimension(0,0); Dimension viewSize = new Dimension(0,0);
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Rectangle scrollPaneBounds = sc.getBounds(); Dimension viewportSize = new Dimension(0,0); Dimen...
Dimension viewportSize = viewport.getSize(); Dimension viewSize = viewport.getView().getSize();
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Rectangle scrollPaneBounds = sc.getBounds(); Dimension viewportSize = new Dimension(0,0); Dimen...
public void setSize(int w, int h)
public void setSize(double w, double h)
public void setSize(int w, int h) { width = w; height = h; }
width = w; height = h;
width = (int) w; height = (int) h;
public void setSize(int w, int h) { width = w; height = h; }
else if (parent != null && parent.isLightweight()) new HeavyweightInLightweightListener(parent);
public void addNotify() { if (peer == null) peer = getToolkit().createComponent(this); /* Now that all the children has gotten their peers, we should have the event mask needed for this component and its lightweight subcomponents. */ peer.setEventMask(eventMask); /* We do not invalidate here, but rathe...
return (node.getParent() == getParent() && getParent() != null);
return node.getParent() == getParent() && getParent() != null;
public boolean isNodeSibling(TreeNode node) { if (node == null) return false; if (node == this) return true; return (node.getParent() == getParent() && getParent() != null); }
super("Windows-1251", new String[] {
super("windows-1251", new String[] {
public Windows1251() { super("Windows-1251", new String[] { "Windows1251", "cp1251", "cp-1251", "cp_1251", "windows1251", "windows_1251" }); lookupTable = lookup; }
os.writeLEA(itemReg, itemReg, index.getRegister(), os.getWordSize(), VmArray.DATA_OFFSET * os.getWordSize());
GPR indexReg = index.getRegister(); if (os.isCode64()) { GPR64 indexReg64 = L1AHelper.get64BitReg(ec, indexReg); os.writeMOVSXD(indexReg64, (GPR32)indexReg); indexReg = indexReg64; } os.writeLEA(itemReg, itemReg, indexReg, os.getWordSize(), VmArray.DATA_OFFSET * os.getWordSize());
public void emitMagic(EmitterContext ec, VmMethod method, boolean isstatic, X86BytecodeVisitor bcv, VmMethod caller) { //final int type = getClass(method); final MagicMethod mcode = MagicMethod.get(method); final VirtualStack vstack = ec.getVStack(); final X86Assembler os = ec.getStream(...
public DoubleWordItem createReg(EmitterContext ec, int jvmType, X86Register.GPR lsb, X86Register.GPR msb) { if (!ec.getStream().isCode32()) { throw new IllegalModeException("Only supported in 32-bit mode"); } final DoubleWordItem item = (DoubleWordItem) getOrCreate(jvmType); item.initialize(ec, Item.Kind.GPR, 0, lsb, m...
public WordItem createReg(EmitterContext ec, int jvmType, X86Register reg) { final WordItem item = (WordItem) getOrCreate(jvmType); item.initialize(ec, Item.Kind.GPR, reg, 0);
public DoubleWordItem createReg(EmitterContext ec, int jvmType, X86Register.GPR lsb, X86Register.GPR msb) { if (!ec.getStream().isCode32()) { throw new IllegalModeException("Only supported in 32-bit mode"); } final DoubleWordItem item = (DoubleWordItem) getOrCreate(jvmType); item.initiali...
public boolean isIgnoringElementContentWhitespace() { return whitespace; }
public boolean isIgnoringElementContentWhitespace() { return ignoringElementContentWhitespace; }
public boolean isIgnoringElementContentWhitespace() { return whitespace; } // isIgnoringElementContentWhitespace()
public boolean isIgnoringComments() { return ignoreComments; }
public boolean isIgnoringComments() { return ignoringComments; }
public boolean isIgnoringComments() { return ignoreComments; } // isIgnoringComments()
public boolean isExpandEntityReferences() { return expandEntityRef; }
public boolean isExpandEntityReferences() { return expandEntityReferences; }
public boolean isExpandEntityReferences() { return expandEntityRef; } // isExpandEntityReferences()
public ParserConfigurationException(String message) { super(message); }
public ParserConfigurationException() { super(); }
public ParserConfigurationException(String message) { super(message); } // ParserConfigurationException()
while (ncomponents > 0) remove(0);
for ( int index = 0; index < ncomponents; index++) { Component r = component[index]; ComponentListener[] list = r.getComponentListeners(); for (int j = 0; j < list.length; j++) r.removeComponentListener(list[j]); r.removeNotify(); if (layoutMgr != null) layoutMgr.removeLayoutComponent(r); r.parent = null; if (isSh...
public void removeAll() { synchronized (getTreeLock ()) { while (ncomponents > 0) remove(0); } }
Toolkit.getDefaultToolkit().globalDispatchEvent(e);
void dispatchEventImpl(AWTEvent e) { // This boolean tells us not to process focus events when the focus // opposite component is the same as the focus component. boolean ignoreFocus = (e instanceof FocusEvent && ((FocusEvent)e).getComponent() == ((FocusEvent)e).getOppositeComponent()); if (...
return new Dimension(width, height);
prefSize = minimumSize();
public Dimension preferredSize() { if (prefSize == null) if (peer == null) return new Dimension(width, height); else prefSize = peer.getPreferredSize(); return prefSize; }
}
public Dimension preferredSize() { if (prefSize == null) if (peer == null) return new Dimension(width, height); else prefSize = peer.getPreferredSize(); return prefSize; }
Shape clip = getClip(); if (clip == null) return true;
public boolean hitClip(int x, int y, int width, int height) { return getClip().intersects(x, y, width, height); }
public Graphics create(int x, int y, int width, int height) { Graphics g = create(); g.translate(x, y); g.clipRect(0, 0, width, height); return(g); }
public abstract Graphics create();
public Graphics create(int x, int y, int width, int height) { Graphics g = create(); g.translate(x, y); // FIXME: I'm not sure if this will work. Are the old clip rect bounds // translated above? g.clipRect(0, 0, width, height); return(g); }
if (osc.isEnum()) { realOutput.writeByte(TC_ENUM); writeObject(osc); assignNewHandle(obj); writeObject(((Enum) obj).name()); break; }
public final void writeObject(Object obj) throws IOException { if (useSubclassMethod) { if (dump) dumpElementln ("WRITE OVERRIDE: " + obj); writeObjectOverride(obj); return; } if (dump) dumpElementln ("WRITE: " + obj); depth += 2; boolean was_serializing = isSerializing; bo...
public UIDefaults getDefaults() { if (LAF_defaults == null) LAF_defaults = new BasicDefaults(); return LAF_defaults; }
public UIDefaults getDefaults() { if (LAF_defaults == null) LAF_defaults = super.getDefaults(); return LAF_defaults; }
public UIDefaults getDefaults() { if (LAF_defaults == null) LAF_defaults = new BasicDefaults(); // Returns the default values for this look and feel. return LAF_defaults; }
public JIFSFile(String name) { this.name = name;
public JIFSFile() { refresh();
public JIFSFile(String name) { this.name = name; }
return null;
MARSHAL m = new MARSHAL("Unable to open a socket at " + ior.Internet.host + ":" + ior.Internet.port ); m.initCause(io_ex); throw m;
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); header.setBigEndian(Big_endian); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.ve...
public Unexpected(Exception why)
public Unexpected(String msg, Exception why)
public Unexpected(Exception why) { super(SHARED_MESSAGE); if (why != null) initCause(why); }
super(SHARED_MESSAGE);
super(msg + ". " + SHARED_MESSAGE);
public Unexpected(Exception why) { super(SHARED_MESSAGE); if (why != null) initCause(why); }
public void add(NamedValue value)
public NamedValue add(int a_flags)
public void add(NamedValue value) { list.add(value); }
list.add(value);
return add_value(null, new gnuAny(), a_flags);
public void add(NamedValue value) { list.add(value); }
public static void error(Exception why)
public static void error(String msg, Exception why)
public static void error(Exception why) { throw new Unexpected(why); }
throw new Unexpected(why);
throw new Unexpected(msg, why);
public static void error(Exception why) { throw new Unexpected(why); }
public abstract void exception(Exception except);
public abstract Exception exception();
public abstract void exception(Exception except);
public UnknownUserException(Any an_exception)
public UnknownUserException()
public UnknownUserException(Any an_exception) { except = an_exception; }
except = an_exception;
public UnknownUserException(Any an_exception) { except = an_exception; }
DataInputStream din = new DataInputStream(istream);
public void read(java.io.InputStream istream) throws MARSHAL { try { DataInputStream din = new DataInputStream(istream); byte[] xMagic = new byte[ MAGIC.length ]; din.read(xMagic); if (!Arrays.equals(xMagic, MAGIC)) throw new MARSHAL("Not a GIOP message"); ...
din.read(xMagic);
istream.read(xMagic);
public void read(java.io.InputStream istream) throws MARSHAL { try { DataInputStream din = new DataInputStream(istream); byte[] xMagic = new byte[ MAGIC.length ]; din.read(xMagic); if (!Arrays.equals(xMagic, MAGIC)) throw new MARSHAL("Not a GIOP message"); ...
version = Version.read_version(din);
version = Version.read_version(istream);
public void read(java.io.InputStream istream) throws MARSHAL { try { DataInputStream din = new DataInputStream(istream); byte[] xMagic = new byte[ MAGIC.length ]; din.read(xMagic); if (!Arrays.equals(xMagic, MAGIC)) throw new MARSHAL("Not a GIOP message"); ...
flags = (byte) din.read();
abstractDataInputStream din;
public void read(java.io.InputStream istream) throws MARSHAL { try { DataInputStream din = new DataInputStream(istream); byte[] xMagic = new byte[ MAGIC.length ]; din.read(xMagic); if (!Arrays.equals(xMagic, MAGIC)) throw new MARSHAL("Not a GIOP message"); ...
if (!isBigEndian()) throw new MARSHAL("Little endian unsupported.");
flags = (byte) istream.read(); if (isBigEndian()) din = new BigEndianInputStream(istream); else din = new LittleEndianInputStream(istream);
public void read(java.io.InputStream istream) throws MARSHAL { try { DataInputStream din = new DataInputStream(istream); byte[] xMagic = new byte[ MAGIC.length ]; din.read(xMagic); if (!Arrays.equals(xMagic, MAGIC)) throw new MARSHAL("Not a GIOP message"); ...
throw new MARSHAL(ex.toString());
MARSHAL t = new MARSHAL(); t.initCause(ex); throw t;
public void read(java.io.InputStream istream) throws MARSHAL { try { DataInputStream din = new DataInputStream(istream); byte[] xMagic = new byte[ MAGIC.length ]; din.read(xMagic); if (!Arrays.equals(xMagic, MAGIC)) throw new MARSHAL("Not a GIOP message"); ...
res.put("gnu.java.io.encoding_scheme_alias.UTF-16LE", "UTF16LE"); res.put("gnu.java.io.encoding_scheme_alias.UTF-16BE", "UTF16BE");
public static Properties getInitProperties() { final String arch; final Vm vm = Vm.getVm(); arch = vm.getArch().getName(); final Properties res = new Properties(); // Java properties res.put("java.version", "1.1.0"); res.put("java.vendor", "JNode.org"); res.pu...
helper.copy(objectPtr, ObjectReference.fromObject(newObj).toAddress(), size);
helper.copy(objectPtr, ObjectReference.fromObject(newObj).toAddress(), Extent.fromIntZeroExtend(size));
public final Object clone(Cloneable object) { testInited(); final VmClassType objectClass = VmMagic.getObjectType(object); final Address objectPtr = ObjectReference.fromObject(object).toAddress(); final int size; if (objectClass.isArray()) { final int slotSize = Unsafe.getCurrentProcessor().getArchitecture().ge...
return (VmMethod)Unsafe.getObject(sf, getMethodOffset(sf));
final Object obj = Unsafe.getObject(sf, getMethodOffset(sf)); if (obj instanceof VmMethod) { return (VmMethod)obj; } else if (obj == null) { return null; } else { Unsafe.debug("Method on stacktrace is not instanceof VmMethod but "); Unsafe.debug(obj.getClass().getName()); Unsafe.die("Fatal stack error"); return null; }
final VmMethod getMethod(Address sf) { return (VmMethod)Unsafe.getObject(sf, getMethodOffset(sf)); }
public Exception(String s)
public Exception()
public Exception(String s) { super(s); }
super(s);
public Exception(String s) { super(s); }
entries = Collections.EMPTY_MAP; entryNames = Collections.EMPTY_LIST;
entries = Collections.emptyMap(); entryNames = Collections.emptyList();
private FSEntryTable() { entries = Collections.EMPTY_MAP; entryNames = Collections.EMPTY_LIST; }
throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
public final void setPrefix(String prefix) { if (readonly) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } if (prefix == null) { name = localName; return; } else if (namespace == null) { throw new DomEx(DomEx.NAMESPACE_ERR, ...
throw new DomEx(DomEx.NAMESPACE_ERR,
throw new DomDOMException(DOMException.NAMESPACE_ERR,
public final void setPrefix(String prefix) { if (readonly) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } if (prefix == null) { name = localName; return; } else if (namespace == null) { throw new DomEx(DomEx.NAMESPACE_ERR, ...
throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns attribute prefix is reserved", this, 0);
throw new DomDOMException(DOMException.NAMESPACE_ERR, "xmlns attribute prefix is reserved", this, 0);
public final void setPrefix(String prefix) { if (readonly) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } if (prefix == null) { name = localName; return; } else if (namespace == null) { throw new DomEx(DomEx.NAMESPACE_ERR, ...
throw new DomEx(DomEx.NAMESPACE_ERR, "namespace declarations can't change names", this, 0);
throw new DomDOMException(DOMException.NAMESPACE_ERR, "namespace declarations can't change names", this, 0);
public final void setPrefix(String prefix) { if (readonly) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); } if (prefix == null) { name = localName; return; } else if (namespace == null) { throw new DomEx(DomEx.NAMESPACE_ERR, ...
slider.setOpaque(true);
protected void installDefaults(JSlider slider) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); slider.setForeground(defaults.getColor("Slider.foreground")); slider.setBackground(defaults.getColor("Slider.background")); shadowColor = defaults.getColor("Slider.shadow"); highlightColor = defa...
public void drawPolygon(Polygon polygon) { drawPolygon(polygon.xpoints, polygon.ypoints, polygon.npoints); }
public abstract void drawPolygon(int xPoints[], int yPoints[], int npoints);
public void drawPolygon(Polygon polygon) { drawPolygon(polygon.xpoints, polygon.ypoints, polygon.npoints); }
htmlAttributeSet attributes = gnu.getAttributes();
SimpleAttributeSet attributes = gnu.getAttributes();
protected final void handleStartTag(TagElement tag) { parser.handleStartTag(tag); htmlAttributeSet attributes = gnu.getAttributes(); if (tag.fictional()) attributes.addAttribute(HTMLEditorKit.ParserCallback.IMPLIED, Boolean.TRUE )...
public ClassNotFoundException(String s, Throwable ex)
public ClassNotFoundException()
public ClassNotFoundException(String s, Throwable ex) { super(s, ex); this.ex = ex; }
super(s, ex); this.ex = ex;
this(null, null);
public ClassNotFoundException(String s, Throwable ex) { super(s, ex); this.ex = ex; }
if (comp == rootPane)
if (!initStageDone)
protected void addImpl(Component comp, Object constraints, int index) { // If we're adding the rootPane (initialization stages) use super.add. // Otherwise pass the add onto the content pane. if (comp == rootPane) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEna...
public Container getContentPane();
Container getContentPane();
public Container getContentPane();
public Component getGlassPane();
Component getGlassPane();
public Component getGlassPane();
public JLayeredPane getLayeredPane();
JLayeredPane getLayeredPane();
public JLayeredPane getLayeredPane();
public JRootPane getRootPane();
JRootPane getRootPane();
public JRootPane getRootPane();
public void setContentPane(Container contentPane);
void setContentPane(Container contentPane);
public void setContentPane(Container contentPane);
public void setGlassPane(Component glassPane);
void setGlassPane(Component glassPane);
public void setGlassPane(Component glassPane);
public void setLayeredPane(JLayeredPane layeredPane);
void setLayeredPane(JLayeredPane layeredPane);
public void setLayeredPane(JLayeredPane layeredPane);
public TreeMap(Comparator<? super K> c)
public TreeMap()
public TreeMap(Comparator<? super K> c) { comparator = c; fabricateTree(0); }
comparator = c; fabricateTree(0);
this((Comparator) null);
public TreeMap(Comparator<? super K> c) { comparator = c; fabricateTree(0); }
maximumIntegerDigits = 309;
maximumIntegerDigits = MAXIMUM_INTEGER_DIGITS;
private final void applyPatternWithSymbols(String pattern, DecimalFormatSymbols syms) { // Initialize to the state the parser expects. negativePrefix = ""; negativeSuffix = ""; positivePrefix = ""; positiveSuffix = ""; decimalSeparatorAlwaysShown = false; groupingSize = 0; minExponentDigits = 0; multiplier = ...
StringBuffer buf = new StringBuffer(); String patChars = patternChars(syms);
AttributedFormatBuffer buf = new AttributedFormatBuffer (); String patChars = patternChars (syms);
private final void applyPatternWithSymbols(String pattern, DecimalFormatSymbols syms) { // Initialize to the state the parser expects. negativePrefix = ""; negativeSuffix = ""; positivePrefix = ""; positiveSuffix = ""; decimalSeparatorAlwaysShown = false; groupingSize = 0; minExponentDigits = 0; multiplier = ...
int index = scanFix(pattern, 0, buf, patChars, syms, false); positivePrefix = buf.toString();
int index = scanFix (pattern, 0, buf, patChars, syms, false); buf.sync(); positivePrefix = buf.getBuffer().toString(); positivePrefixRanges = buf.getRanges(); positivePrefixAttrs = buf.getAttributes();
private final void applyPatternWithSymbols(String pattern, DecimalFormatSymbols syms) { // Initialize to the state the parser expects. negativePrefix = ""; negativeSuffix = ""; positivePrefix = ""; positiveSuffix = ""; decimalSeparatorAlwaysShown = false; groupingSize = 0; minExponentDigits = 0; multiplier = ...
index = scanFix(pattern, index, buf, patChars, syms, true); positiveSuffix = buf.toString();
index = scanFix (pattern, index, buf, patChars, syms, true); buf.sync(); positiveSuffix = buf.getBuffer().toString(); positiveSuffixRanges = buf.getRanges(); positiveSuffixAttrs = buf.getAttributes();
private final void applyPatternWithSymbols(String pattern, DecimalFormatSymbols syms) { // Initialize to the state the parser expects. negativePrefix = ""; negativeSuffix = ""; positivePrefix = ""; positiveSuffix = ""; decimalSeparatorAlwaysShown = false; groupingSize = 0; minExponentDigits = 0; multiplier = ...
index = scanFix(pattern, index + 1, buf, patChars, syms, false); negativePrefix = buf.toString();
index = scanFix (pattern, index + 1, buf, patChars, syms, false); buf.sync(); negativePrefix = buf.getBuffer().toString(); negativePrefixRanges = buf.getRanges(); negativePrefixAttrs = buf.getAttributes();
private final void applyPatternWithSymbols(String pattern, DecimalFormatSymbols syms) { // Initialize to the state the parser expects. negativePrefix = ""; negativeSuffix = ""; positivePrefix = ""; positiveSuffix = ""; decimalSeparatorAlwaysShown = false; groupingSize = 0; minExponentDigits = 0; multiplier = ...
index = scanFix(pattern, index, buf, patChars, syms, true); negativeSuffix = buf.toString();
index = scanFix (pattern, index, buf, patChars, syms, true); buf.sync(); negativeSuffix = buf.getBuffer().toString(); negativeSuffixRanges = buf.getRanges(); negativeSuffixAttrs = buf.getAttributes();
private final void applyPatternWithSymbols(String pattern, DecimalFormatSymbols syms) { // Initialize to the state the parser expects. negativePrefix = ""; negativeSuffix = ""; positivePrefix = ""; positiveSuffix = ""; decimalSeparatorAlwaysShown = false; groupingSize = 0; minExponentDigits = 0; multiplier = ...
int total_digits = Math.max(minimumIntegerDigits, groupingUsed ? groupingSize + 1 : 0);
int total_digits = Math.max(minimumIntegerDigits, groupingUsed ? groupingSize + 1: groupingSize);
private final String computePattern(DecimalFormatSymbols syms) { StringBuffer mainPattern = new StringBuffer(); // We have to at least emit a zero for the minimum number of // digits. Past that we need hash marks up to the grouping // separator (and one beyond). int total_digits = Math.max(minimumIntegerDigits, ...
public StringBuffer format(double number, StringBuffer dest, FieldPosition fieldPos) { if (Double.isNaN(number)) { dest.append(symbols.getNaN()); if (fieldPos != null && fieldPos.getField() == INTEGER_FIELD) { int index = dest.length(); fieldPos.setBeginIndex(index - symbols.getNaN().length()); fieldPos.setEndIndex(in...
public StringBuffer format (double number, StringBuffer dest, FieldPosition fieldPos) { formatInternal (number, new StringFormatBuffer(dest), fieldPos);
public StringBuffer format(double number, StringBuffer dest, FieldPosition fieldPos) { // A very special case. if (Double.isNaN(number)) { dest.append(symbols.getNaN()); if (fieldPos != null && fieldPos.getField() == INTEGER_FIELD) { int index = dest.length(); fieldPos.setBeginIndex(index - symbols.getNaN(...
StringBuffer buf = new StringBuffer();
StringBuffer int_buf = new StringBuffer ();
public Number parse(String str, ParsePosition pos) { // Our strategy is simple: copy the text into a buffer, // translating or omitting locale-specific information. Then // let Double or Long convert the number for us. boolean is_neg = false; int index = pos.getIndex(); StringBuffer buf = new StringBuffer(); /...
StringBuffer buf = int_buf; StringBuffer frac_buf = null; StringBuffer exp_buf = null;
public Number parse(String str, ParsePosition pos) { // Our strategy is simple: copy the text into a buffer, // translating or omitting locale-specific information. Then // let Double or Long convert the number for us. boolean is_neg = false; int index = pos.getIndex(); StringBuffer buf = new StringBuffer(); /...
if (groupingUsed && c == symbols.getGroupingSeparator()) { if (last_group != -1 && (index - last_group) % groupingSize != 0) {
if (groupingUsed && c == symbols.getGroupingSeparator()) { if (last_group != -1 && groupingSize != 0 && (index - last_group) % groupingSize != 0) {
public Number parse(String str, ParsePosition pos) { // Our strategy is simple: copy the text into a buffer, // translating or omitting locale-specific information. Then // let Double or Long convert the number for us. boolean is_neg = false; int index = pos.getIndex(); StringBuffer buf = new StringBuffer(); /...
last_group = index; } else if (c >= zero && c <= zero + 9) {
last_group = index+1; } else if (c >= zero && c <= zero + 9) {
public Number parse(String str, ParsePosition pos) { // Our strategy is simple: copy the text into a buffer, // translating or omitting locale-specific information. Then // let Double or Long convert the number for us. boolean is_neg = false; int index = pos.getIndex(); StringBuffer buf = new StringBuffer(); /...
exp_part = false; } else if (parseIntegerOnly)
} else if (parseIntegerOnly)
public Number parse(String str, ParsePosition pos) { // Our strategy is simple: copy the text into a buffer, // translating or omitting locale-specific information. Then // let Double or Long convert the number for us. boolean is_neg = false; int index = pos.getIndex(); StringBuffer buf = new StringBuffer(); /...
else if (c == symbols.getDecimalSeparator()) { if (last_group != -1 && (index - last_group) % groupingSize != 0) {
else if (c == symbols.getDecimalSeparator()) { if (last_group != -1 && groupingSize != 0 && (index - last_group) % groupingSize != 0) {
public Number parse(String str, ParsePosition pos) { // Our strategy is simple: copy the text into a buffer, // translating or omitting locale-specific information. Then // let Double or Long convert the number for us. boolean is_neg = false; int index = pos.getIndex(); StringBuffer buf = new StringBuffer(); /...
buf.append('.');
buf = frac_buf = new StringBuffer(); frac_buf.append('.');
public Number parse(String str, ParsePosition pos) { // Our strategy is simple: copy the text into a buffer, // translating or omitting locale-specific information. Then // let Double or Long convert the number for us. boolean is_neg = false; int index = pos.getIndex(); StringBuffer buf = new StringBuffer(); /...
} else if (c == symbols.getExponential()) { buf.append('E');
} else if (c == symbols.getExponential()) { buf = exp_buf = new StringBuffer();
public Number parse(String str, ParsePosition pos) { // Our strategy is simple: copy the text into a buffer, // translating or omitting locale-specific information. Then // let Double or Long convert the number for us. boolean is_neg = false; int index = pos.getIndex(); StringBuffer buf = new StringBuffer(); /...
} else if (exp_part && (c == '+' || c == '-' || c == symbols.getMinusSign())) {
exp_index = index+1; } else if (exp_part && (c == '+' || c == '-' || c == symbols.getMinusSign())) {
public Number parse(String str, ParsePosition pos) { // Our strategy is simple: copy the text into a buffer, // translating or omitting locale-specific information. Then // let Double or Long convert the number for us. boolean is_neg = false; int index = pos.getIndex(); StringBuffer buf = new StringBuffer(); /...
buf.insert(0, '-'); String t = buf.toString();
int_buf.insert(0, '-'); if (exp_buf != null) { int exponent_value; try { exponent_value = Integer.parseInt(exp_buf.toString()); } catch (NumberFormatException x1) { pos.setErrorIndex(exp_index); return null; } if (frac_buf == null) { for (int i = 0; i < exponent_value; i++) int_buf.append('0'); use_long = true; ...
public Number parse(String str, ParsePosition pos) { // Our strategy is simple: copy the text into a buffer, // translating or omitting locale-specific information. Then // let Double or Long convert the number for us. boolean is_neg = false; int index = pos.getIndex(); StringBuffer buf = new StringBuffer(); /...
try { result = new Long(t); } catch (NumberFormatException x1) { try { result = new Double(t); } catch (NumberFormatException x2) {
if (use_long) { try { result = new Long (t); } catch (NumberFormatException x1) { } } else { try { result = new Double (t);
public Number parse(String str, ParsePosition pos) { // Our strategy is simple: copy the text into a buffer, // translating or omitting locale-specific information. Then // let Double or Long convert the number for us. boolean is_neg = false; int index = pos.getIndex(); StringBuffer buf = new StringBuffer(); /...
} if (result == null) {
catch (NumberFormatException x2) { } } if (result == null) {
public Number parse(String str, ParsePosition pos) { // Our strategy is simple: copy the text into a buffer, // translating or omitting locale-specific information. Then // let Double or Long convert the number for us. boolean is_neg = false; int index = pos.getIndex(); StringBuffer buf = new StringBuffer(); /...
private final int scanFix(String pattern, int index, StringBuffer buf, String patChars, DecimalFormatSymbols syms, boolean is_suffix) {
private final int scanFix (String pattern, int index, FormatBuffer buf, String patChars, DecimalFormatSymbols syms, boolean is_suffix) {
private final int scanFix(String pattern, int index, StringBuffer buf, String patChars, DecimalFormatSymbols syms, boolean is_suffix) { int len = pattern.length(); buf.setLength(0); boolean multiplierSet = false; while (index < len) { char c = pattern.charAt(index); if (c == '\'' && index + 1 < len && pattern....