rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
if (children.size() == 0)
|
for (int index = 0; index < children.length; ++index) { Element elem = children[index]; if ((elem.getStartOffset() <= offset) && (offset < elem.getEndOffset())) return index; }
|
public int getElementIndex(int offset) { if (children.size() == 0) return 0; Element element = positionToElement(offset); if (element == null) return 0; return children.indexOf(element); }
|
Element element = positionToElement(offset); if (element == null) return 0; return children.indexOf(element);
|
public int getElementIndex(int offset) { if (children.size() == 0) return 0; Element element = positionToElement(offset); if (element == null) return 0; return children.indexOf(element); }
|
|
return ((Element) children.lastElement()).getEndOffset();
|
return children[children.length - 1].getEndOffset();
|
public int getEndOffset() { return ((Element) children.lastElement()).getEndOffset(); }
|
return "AbstractDocument.BranchElement";
|
return ParagraphElementName;
|
public String getName() { return "AbstractDocument.BranchElement"; }
|
return ((Element) children.firstElement()).getStartOffset();
|
return children[0].getStartOffset();
|
public int getStartOffset() { return ((Element) children.firstElement()).getStartOffset(); }
|
for (int index = 0; index < children.size(); ++index)
|
for (int index = 0; index < children.length; ++index)
|
public Element positionToElement(int position) { // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.size(); ++index) { Element elem = (Element) children.get(index); if ((elem.getStartOffset() <= position) && (position < elem.getEndOffset())) return elem; } return null; }
|
Element elem = (Element) children.get(index);
|
Element elem = children[index];
|
public Element positionToElement(int position) { // XXX: There is surely a better algorithm // as beginning from first element each time. for (int index = 0; index < children.size(); ++index) { Element elem = (Element) children.get(index); if ((elem.getStartOffset() <= position) && (position < elem.getEndOffset())) return elem; } return null; }
|
public void replace(int offset, int length, Element[] elems)
|
public void replace(int offset, int length, Element[] elements)
|
public void replace(int offset, int length, Element[] elems) { for (int index = 0; index < length; ++index) children.removeElementAt(offset); for (int index = 0; index < elems.length; ++index) children.add(offset + index, elems[index]); }
|
for (int index = 0; index < length; ++index) children.removeElementAt(offset); for (int index = 0; index < elems.length; ++index) children.add(offset + index, elems[index]);
|
Element[] target = new Element[children.length - length + elements.length]; System.arraycopy(children, 0, target, 0, offset); System.arraycopy(elements, 0, target, offset, elements.length); System.arraycopy(children, offset + length, target, offset + elements.length, children.length - offset - length); children = target;
|
public void replace(int offset, int length, Element[] elems) { for (int index = 0; index < length; ++index) children.removeElementAt(offset); for (int index = 0; index < elems.length; ++index) children.add(offset + index, elems[index]); }
|
return getName() + ": " + "content";
|
return ("BranchElement(" + getName() + ") " + getStartOffset() + "," + getEndOffset() + "\n");
|
public String toString() { return getName() + ": " + "content"; }
|
public Element getElement()
|
public Element getElement(int index)
|
public Element getElement() { return null; }
|
return "AbstractDocument.LeafElement";
|
return ContentElementName;
|
public String getName() { return "AbstractDocument.LeafElement"; }
|
return getName() + ": " + "content";
|
return ("LeafElement(" + getName() + ") " + getStartOffset() + "," + getEndOffset() + "\n");
|
public String toString() { return getName() + ": " + "content"; }
|
return content.length();
|
return content.length() - 1;
|
public int getLength() { return content.length(); }
|
String f = canonicalize ((String) elts.get (i));
|
String f = canonicalize ((String) elts.get (delta + i));
|
public boolean endsWith (Name n) { if (! (n instanceof CompoundName)) return false; CompoundName cn = (CompoundName) n; if (cn.elts.size () > elts.size ()) return false; int delta = elts.size () - cn.elts.size (); for (int i = 0; i < cn.elts.size (); ++i) { String f = canonicalize ((String) elts.get (i)); if (! f.equals (canonicalize ((String) cn.elts.get (i)))) return false; } return true; }
|
ParsedArguments cmdLine = HELP_INFO.parse(args);
|
final ParsedArguments cmdLine = HELP_INFO.parse(args);
|
public static void main(String[] args) throws Exception { ParsedArguments cmdLine = HELP_INFO.parse(args); final File entry = ARG_DIR.getFile(cmdLine); if (entry.exists()) { entry.delete(); } else { System.err.println(entry + " does not exist"); } }
|
if (entry.exists()) { entry.delete(); } else {
|
boolean deleteOk=false; if (!entry.exists()) {
|
public static void main(String[] args) throws Exception { ParsedArguments cmdLine = HELP_INFO.parse(args); final File entry = ARG_DIR.getFile(cmdLine); if (entry.exists()) { entry.delete(); } else { System.err.println(entry + " does not exist"); } }
|
if(entry.isDirectory()){ final File[] subFile=entry.listFiles(); for(int i=0;i<subFile.length;i++){ final String name=subFile[i].getName(); if(!name.equals(".") && !name.equals("..")){ System.err.println("Directory is not empty"); return; } } } deleteOk=entry.delete(); if(!deleteOk){ System.err.println(entry + " does not deleted"); }
|
public static void main(String[] args) throws Exception { ParsedArguments cmdLine = HELP_INFO.parse(args); final File entry = ARG_DIR.getFile(cmdLine); if (entry.exists()) { entry.delete(); } else { System.err.println(entry + " does not exist"); } }
|
|
public WritableRaster createCompatibleWritableRaster(int w, int h)
|
public WritableRaster createCompatibleWritableRaster()
|
public WritableRaster createCompatibleWritableRaster(int w, int h) { return createCompatibleWritableRaster(minX, minY, w, h); }
|
return createCompatibleWritableRaster(minX, minY, w, h);
|
return new WritableRaster(getSampleModel(), new Point(minX, minY));
|
public WritableRaster createCompatibleWritableRaster(int w, int h) { return createCompatibleWritableRaster(minX, minY, w, h); }
|
r.translate((int) r.getWidth(), 0);
|
r.translate((int) r.getWidth() - 1, 0);
|
public int getFirstVisibleIndex() { ComponentOrientation or = getComponentOrientation(); Rectangle r = getVisibleRect(); if (or == ComponentOrientation.RIGHT_TO_LEFT) r.translate((int) r.getWidth(), 0); return getUI().locationToIndex(this, r.getLocation()); }
|
public void setPopupSize(int x, int y) {
|
public void setPopupSize(Dimension size) {
|
public void setPopupSize(int x, int y) { // TODO } // setPopupSize()
|
{
|
public Object get(int index) { if (elements == null) { throw new IndexOutOfBoundsException("list is empty"); } if (index < 0 || index >= elements.length) { throw new IndexOutOfBoundsException("index=" + index + ", size=" + size()); } return elements[index]; }
|
|
}
|
public Object get(int index) { if (elements == null) { throw new IndexOutOfBoundsException("list is empty"); } if (index < 0 || index >= elements.length) { throw new IndexOutOfBoundsException("index=" + index + ", size=" + size()); } return elements[index]; }
|
|
{ throw new IndexOutOfBoundsException("index=" + index + ", size=" + size()); }
|
throw new IndexOutOfBoundsException("index=" + index + ", size=" + size());
|
public Object get(int index) { if (elements == null) { throw new IndexOutOfBoundsException("list is empty"); } if (index < 0 || index >= elements.length) { throw new IndexOutOfBoundsException("index=" + index + ", size=" + size()); } return elements[index]; }
|
public String[] _ids()
|
public final String[] _ids()
|
public String[] _ids() { return ids; }
|
public OutputStream _invoke(String method, InputStream input,
|
public final OutputStream _invoke(String method, InputStream input,
|
public OutputStream _invoke(String method, InputStream input, ResponseHandler rh ) { OutputStream output = null; if (method.equals("destroy")) { // The "destroy" has been invoked. destroy(); output = rh.createReply(); } else if (method.equals("copy")) { // The "copy" has been invoked. org.omg.CORBA.Object returns = copy(); output = rh.createReply(); output.write_Object(returns); } else if (method.equals("policy_type")) { // The "policy_type" has been invoked. int returns = policy_type(); output = rh.createReply(); output.write_long(returns); } else throw new BAD_OPERATION(method, 0, CompletionStatus.COMPLETED_MAYBE); return output; }
|
output.write_Object(returns);
|
output.write_Object(this);
|
public OutputStream _invoke(String method, InputStream input, ResponseHandler rh ) { OutputStream output = null; if (method.equals("destroy")) { // The "destroy" has been invoked. destroy(); output = rh.createReply(); } else if (method.equals("copy")) { // The "copy" has been invoked. org.omg.CORBA.Object returns = copy(); output = rh.createReply(); output.write_Object(returns); } else if (method.equals("policy_type")) { // The "policy_type" has been invoked. int returns = policy_type(); output = rh.createReply(); output.write_long(returns); } else throw new BAD_OPERATION(method, 0, CompletionStatus.COMPLETED_MAYBE); return output; }
|
else if (method.equals("value")) { output = rh.createReply(); output.write_long(policyCode); }
|
public OutputStream _invoke(String method, InputStream input, ResponseHandler rh ) { OutputStream output = null; if (method.equals("destroy")) { // The "destroy" has been invoked. destroy(); output = rh.createReply(); } else if (method.equals("copy")) { // The "copy" has been invoked. org.omg.CORBA.Object returns = copy(); output = rh.createReply(); output.write_Object(returns); } else if (method.equals("policy_type")) { // The "policy_type" has been invoked. int returns = policy_type(); output = rh.createReply(); output.write_long(returns); } else throw new BAD_OPERATION(method, 0, CompletionStatus.COMPLETED_MAYBE); return output; }
|
|
public abstract short getShort (int index);
|
public abstract short getShort ();
|
public abstract short getShort (int index);
|
public final ByteBuffer order (ByteOrder endian)
|
public final ByteOrder order ()
|
public final ByteBuffer order (ByteOrder endian) { this.endian = endian; return this; }
|
this.endian = endian; return this;
|
return endian;
|
public final ByteBuffer order (ByteOrder endian) { this.endian = endian; return this; }
|
public Manifest(InputStream in) throws IOException
|
public Manifest()
|
public Manifest(InputStream in) throws IOException { this(); read(in); }
|
this(); read(in);
|
mainAttr = new Attributes(); entries = new Hashtable();
|
public Manifest(InputStream in) throws IOException { this(); read(in); }
|
public ObjectNotActive(String why)
|
public ObjectNotActive()
|
public ObjectNotActive(String why) { super(why); }
|
super(why);
|
public ObjectNotActive(String why) { super(why); }
|
|
if (event.getType() == TableModelEvent.INSERT || event.getType() == TableModelEvent.DELETE) revalidate();
|
public void tableChanged (TableModelEvent event) { // update the column model from the table model if the structure has // changed and the flag autoCreateColumnsFromModel is set if ((event.getFirstRow() ==TableModelEvent.HEADER_ROW) && autoCreateColumnsFromModel) createDefaultColumnsFromModel(); repaint(); }
|
|
public Component getTableCellEditorComponent(JTable table,
|
Component getTableCellEditorComponent(JTable table,
|
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column);
|
public abstract double get ();
|
public DoubleBuffer get (double[] dst, int offset, int length) { checkArraySize(dst.length, offset, length); checkForUnderflow(length); for (int i = offset; i < offset + length; i++) { dst [i] = get (); } return this; }
|
public abstract double get ();
|
public abstract DoubleBuffer put (double b);
|
public DoubleBuffer put (DoubleBuffer src) { if (src == this) throw new IllegalArgumentException (); checkForOverflow(src.remaining ()); if (src.remaining () > 0) { double[] toPut = new double [src.remaining ()]; src.get (toPut); put (toPut); } return this; }
|
public abstract DoubleBuffer put (double b);
|
public int checkImage(Image image, int width, int height, ImageObserver observer)
|
public int checkImage(Image image, ImageObserver observer)
|
public int checkImage(Image image, int width, int height, ImageObserver observer) { if (peer != null) return peer.checkImage(image, width, height, observer); return getToolkit().checkImage(image, width, height, observer); }
|
if (peer != null) return peer.checkImage(image, width, height, observer); return getToolkit().checkImage(image, width, height, observer);
|
return checkImage(image, -1, -1, observer);
|
public int checkImage(Image image, int width, int height, ImageObserver observer) { if (peer != null) return peer.checkImage(image, width, height, observer); return getToolkit().checkImage(image, width, height, observer); }
|
else if (e instanceof AdjustmentEvent) { AdjustmentEvent ae = (AdjustmentEvent) e; int type = ae.getAdjustmentType(); int oldType; if (type == AdjustmentEvent.BLOCK_DECREMENT) oldType = Event.SCROLL_PAGE_UP; else if (type == AdjustmentEvent.BLOCK_INCREMENT) oldType = Event.SCROLL_PAGE_DOWN; else if (type == AdjustmentEvent.TRACK) oldType = Event.SCROLL_ABSOLUTE; else if (type == AdjustmentEvent.UNIT_DECREMENT) oldType = Event.SCROLL_LINE_UP; else if (type == AdjustmentEvent.UNIT_INCREMENT) oldType = Event.SCROLL_LINE_DOWN; else oldType = type; translated = new Event(target, oldType, new Integer(ae.getValue())); }
|
static Event translateEvent (AWTEvent e) { Object target = e.getSource (); Event translated = null; if (e instanceof InputEvent) { InputEvent ie = (InputEvent) e; long when = ie.getWhen (); int oldID = 0; int id = e.getID (); int oldMods = 0; int mods = ie.getModifiersEx (); if ((mods & InputEvent.BUTTON2_DOWN_MASK) != 0) oldMods |= Event.META_MASK; else if ((mods & InputEvent.BUTTON3_DOWN_MASK) != 0) oldMods |= Event.ALT_MASK; if ((mods & InputEvent.SHIFT_DOWN_MASK) != 0) oldMods |= Event.SHIFT_MASK; if ((mods & InputEvent.CTRL_DOWN_MASK) != 0) oldMods |= Event.CTRL_MASK; if ((mods & InputEvent.META_DOWN_MASK) != 0) oldMods |= Event.META_MASK; if ((mods & InputEvent.ALT_DOWN_MASK) != 0) oldMods |= Event.ALT_MASK; if (e instanceof MouseEvent) { if (id == MouseEvent.MOUSE_PRESSED) oldID = Event.MOUSE_DOWN; else if (id == MouseEvent.MOUSE_RELEASED) oldID = Event.MOUSE_UP; else if (id == MouseEvent.MOUSE_MOVED) oldID = Event.MOUSE_MOVE; else if (id == MouseEvent.MOUSE_DRAGGED) oldID = Event.MOUSE_DRAG; else if (id == MouseEvent.MOUSE_ENTERED) oldID = Event.MOUSE_ENTER; else if (id == MouseEvent.MOUSE_EXITED) oldID = Event.MOUSE_EXIT; else // No analogous AWT 1.0 mouse event. return null; MouseEvent me = (MouseEvent) e; translated = new Event (target, when, oldID, me.getX (), me.getY (), 0, oldMods); } else if (e instanceof KeyEvent) { if (id == KeyEvent.KEY_PRESSED) oldID = Event.KEY_PRESS; else if (e.getID () == KeyEvent.KEY_RELEASED) oldID = Event.KEY_RELEASE; else // No analogous AWT 1.0 key event. return null; int oldKey = 0; int newKey = ((KeyEvent) e).getKeyCode (); switch (newKey) { case KeyEvent.VK_BACK_SPACE: oldKey = Event.BACK_SPACE; break; case KeyEvent.VK_CAPS_LOCK: oldKey = Event.CAPS_LOCK; break; case KeyEvent.VK_DELETE: oldKey = Event.DELETE; break; case KeyEvent.VK_DOWN: case KeyEvent.VK_KP_DOWN: oldKey = Event.DOWN; break; case KeyEvent.VK_END: oldKey = Event.END; break; case KeyEvent.VK_ENTER: oldKey = Event.ENTER; break; case KeyEvent.VK_ESCAPE: oldKey = Event.ESCAPE; break; case KeyEvent.VK_F1: oldKey = Event.F1; break; case KeyEvent.VK_F10: oldKey = Event.F10; break; case KeyEvent.VK_F11: oldKey = Event.F11; break; case KeyEvent.VK_F12: oldKey = Event.F12; break; case KeyEvent.VK_F2: oldKey = Event.F2; break; case KeyEvent.VK_F3: oldKey = Event.F3; break; case KeyEvent.VK_F4: oldKey = Event.F4; break; case KeyEvent.VK_F5: oldKey = Event.F5; break; case KeyEvent.VK_F6: oldKey = Event.F6; break; case KeyEvent.VK_F7: oldKey = Event.F7; break; case KeyEvent.VK_F8: oldKey = Event.F8; break; case KeyEvent.VK_F9: oldKey = Event.F9; break; case KeyEvent.VK_HOME: oldKey = Event.HOME; break; case KeyEvent.VK_INSERT: oldKey = Event.INSERT; break; case KeyEvent.VK_LEFT: case KeyEvent.VK_KP_LEFT: oldKey = Event.LEFT; break; case KeyEvent.VK_NUM_LOCK: oldKey = Event.NUM_LOCK; break; case KeyEvent.VK_PAUSE: oldKey = Event.PAUSE; break; case KeyEvent.VK_PAGE_DOWN: oldKey = Event.PGDN; break; case KeyEvent.VK_PAGE_UP: oldKey = Event.PGUP; break; case KeyEvent.VK_PRINTSCREEN: oldKey = Event.PRINT_SCREEN; break; case KeyEvent.VK_RIGHT: case KeyEvent.VK_KP_RIGHT: oldKey = Event.RIGHT; break; case KeyEvent.VK_SCROLL_LOCK: oldKey = Event.SCROLL_LOCK; break; case KeyEvent.VK_TAB: oldKey = Event.TAB; break; case KeyEvent.VK_UP: case KeyEvent.VK_KP_UP: oldKey = Event.UP; break; default: oldKey = newKey; } translated = new Event (target, when, oldID, 0, 0, oldKey, oldMods); } } else if (e instanceof ActionEvent) translated = new Event (target, Event.ACTION_EVENT, ((ActionEvent) e).getActionCommand ()); return translated; }
|
|
void createBuffers(int x, BufferCapabilities capabilities) throws AWTException;
|
void createBuffers(int numBuffers, BufferCapabilities caps) throws AWTException;
|
void createBuffers(int x, BufferCapabilities capabilities) throws AWTException;
|
public IllegalComponentStateException(String message)
|
public IllegalComponentStateException()
|
public IllegalComponentStateException(String message) { super(message); }
|
super(message);
|
public IllegalComponentStateException(String message) { super(message); }
|
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { System.out.println("HMMMMM, abstract-border.paintBorder"); }
|
public void paintBorder (Component c, Graphics g, int x, int y, int width, int height) { }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { System.out.println("HMMMMM, abstract-border.paintBorder"); }
|
void setContentPane(Container contentPane)
|
public void setContentPane(Container contentPane)
|
void setContentPane(Container contentPane) { getRootPane().setContentPane(contentPane); }
|
static JRootPane getRootPane(Component a) { if (a instanceof JRootPane) return (JRootPane) a; a = a.getParent(); if (a != null) { return getRootPane(a); } return null; }
|
public static JRootPane getRootPane(Component comp) { if (comp instanceof RootPaneContainer) return ((RootPaneContainer)comp).getRootPane(); else return (JRootPane) getAncestorOfClass(JRootPane.class, comp); }
|
static JRootPane getRootPane(Component a) { if (a instanceof JRootPane) return (JRootPane) a; a = a.getParent(); if (a != null) { return getRootPane(a); } return null; }
|
public void addPropertyChangeListener(PropertyChangeListener listener);
|
void addPropertyChangeListener(PropertyChangeListener listener);
|
public void addPropertyChangeListener(PropertyChangeListener listener);
|
Insets insets = parent.getInsets(); Dimension innerSize = new Dimension(size.width - insets.left - insets.right, size.height - insets.bottom - insets.top);
|
public void layoutContainer(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Dimension size = parent.getSize(); Component[] children = parent.getComponents(); if (isHorizontalIn(parent)) { int x = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cy = 0; if (height > size.height) { height = size.height; } else { cy = (int) ((size.height - height) * comp.getAlignmentY()); } comp.setSize(width, height); comp.setLocation(x, cy); x = x + width; } } else { int y = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cx = 0; if (width > size.width) { width = size.width; } else { cx = (int) ((size.width - width) * comp.getAlignmentX()); } comp.setSize(width, height); comp.setLocation(cx, y); y = y + height; } } }
|
|
int x = 0;
|
int x = insets.left;
|
public void layoutContainer(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Dimension size = parent.getSize(); Component[] children = parent.getComponents(); if (isHorizontalIn(parent)) { int x = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cy = 0; if (height > size.height) { height = size.height; } else { cy = (int) ((size.height - height) * comp.getAlignmentY()); } comp.setSize(width, height); comp.setLocation(x, cy); x = x + width; } } else { int y = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cx = 0; if (width > size.width) { width = size.width; } else { cx = (int) ((size.width - width) * comp.getAlignmentX()); } comp.setSize(width, height); comp.setLocation(cx, y); y = y + height; } } }
|
int cy = 0; if (height > size.height)
|
int cy = insets.top; if (height > innerSize.height)
|
public void layoutContainer(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Dimension size = parent.getSize(); Component[] children = parent.getComponents(); if (isHorizontalIn(parent)) { int x = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cy = 0; if (height > size.height) { height = size.height; } else { cy = (int) ((size.height - height) * comp.getAlignmentY()); } comp.setSize(width, height); comp.setLocation(x, cy); x = x + width; } } else { int y = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cx = 0; if (width > size.width) { width = size.width; } else { cx = (int) ((size.width - width) * comp.getAlignmentX()); } comp.setSize(width, height); comp.setLocation(cx, y); y = y + height; } } }
|
height = size.height;
|
height = innerSize.height;
|
public void layoutContainer(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Dimension size = parent.getSize(); Component[] children = parent.getComponents(); if (isHorizontalIn(parent)) { int x = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cy = 0; if (height > size.height) { height = size.height; } else { cy = (int) ((size.height - height) * comp.getAlignmentY()); } comp.setSize(width, height); comp.setLocation(x, cy); x = x + width; } } else { int y = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cx = 0; if (width > size.width) { width = size.width; } else { cx = (int) ((size.width - width) * comp.getAlignmentX()); } comp.setSize(width, height); comp.setLocation(cx, y); y = y + height; } } }
|
cy = (int) ((size.height - height) * comp.getAlignmentY());
|
cy = (int) ((innerSize.height - height) * comp.getAlignmentY());
|
public void layoutContainer(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Dimension size = parent.getSize(); Component[] children = parent.getComponents(); if (isHorizontalIn(parent)) { int x = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cy = 0; if (height > size.height) { height = size.height; } else { cy = (int) ((size.height - height) * comp.getAlignmentY()); } comp.setSize(width, height); comp.setLocation(x, cy); x = x + width; } } else { int y = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cx = 0; if (width > size.width) { width = size.width; } else { cx = (int) ((size.width - width) * comp.getAlignmentX()); } comp.setSize(width, height); comp.setLocation(cx, y); y = y + height; } } }
|
int y = 0;
|
int y = insets.top;
|
public void layoutContainer(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Dimension size = parent.getSize(); Component[] children = parent.getComponents(); if (isHorizontalIn(parent)) { int x = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cy = 0; if (height > size.height) { height = size.height; } else { cy = (int) ((size.height - height) * comp.getAlignmentY()); } comp.setSize(width, height); comp.setLocation(x, cy); x = x + width; } } else { int y = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cx = 0; if (width > size.width) { width = size.width; } else { cx = (int) ((size.width - width) * comp.getAlignmentX()); } comp.setSize(width, height); comp.setLocation(cx, y); y = y + height; } } }
|
int cx = 0; if (width > size.width)
|
int cx = insets.left; if (width > innerSize.width)
|
public void layoutContainer(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Dimension size = parent.getSize(); Component[] children = parent.getComponents(); if (isHorizontalIn(parent)) { int x = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cy = 0; if (height > size.height) { height = size.height; } else { cy = (int) ((size.height - height) * comp.getAlignmentY()); } comp.setSize(width, height); comp.setLocation(x, cy); x = x + width; } } else { int y = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cx = 0; if (width > size.width) { width = size.width; } else { cx = (int) ((size.width - width) * comp.getAlignmentX()); } comp.setSize(width, height); comp.setLocation(cx, y); y = y + height; } } }
|
width = size.width;
|
width = innerSize.width;
|
public void layoutContainer(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Dimension size = parent.getSize(); Component[] children = parent.getComponents(); if (isHorizontalIn(parent)) { int x = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cy = 0; if (height > size.height) { height = size.height; } else { cy = (int) ((size.height - height) * comp.getAlignmentY()); } comp.setSize(width, height); comp.setLocation(x, cy); x = x + width; } } else { int y = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cx = 0; if (width > size.width) { width = size.width; } else { cx = (int) ((size.width - width) * comp.getAlignmentX()); } comp.setSize(width, height); comp.setLocation(cx, y); y = y + height; } } }
|
cx = (int) ((size.width - width) * comp.getAlignmentX());
|
cx = (int) ((innerSize.width - width) * comp.getAlignmentX());
|
public void layoutContainer(Container parent) { if (parent != container) throw new AWTError("invalid parent"); Dimension size = parent.getSize(); Component[] children = parent.getComponents(); if (isHorizontalIn(parent)) { int x = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cy = 0; if (height > size.height) { height = size.height; } else { cy = (int) ((size.height - height) * comp.getAlignmentY()); } comp.setSize(width, height); comp.setLocation(x, cy); x = x + width; } } else { int y = 0; for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); int width = sz.width; int height = sz.height; int cx = 0; if (width > size.width) { width = size.width; } else { cx = (int) ((size.width - width) * comp.getAlignmentX()); } comp.setSize(width, height); comp.setLocation(cx, y); y = y + height; } } }
|
int x = 0; int y = 0;
|
Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.top + insets.bottom;
|
public Dimension maximumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); int x = 0; int y = 0; Component[] children = parent.getComponents(); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); x += sz.width; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMaximumSize(); y += sz.height; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
|
int x = 0; int y = 0;
|
Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.bottom + insets.top;
|
public Dimension minimumLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); int x = 0; int y = 0; Component[] children = parent.getComponents(); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); x += sz.width; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getMinimumSize(); y += sz.height; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
|
int x = 0; int y = 0;
|
Insets insets = parent.getInsets(); int x = insets.left + insets.right; int y = insets.bottom + insets.top;
|
public Dimension preferredLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); int x = 0; int y = 0; Component[] children = parent.getComponents(); if (isHorizontalIn(parent)) { // sum up preferred widths of components, find maximum of preferred // heights for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); x += sz.width; y = Math.max(y, sz.height); } } else { // sum up preferred heights of components, find maximum of // preferred widths for (int index = 0; index < children.length; index++) { Component comp = children[index]; Dimension sz = comp.getPreferredSize(); y += sz.height; x = Math.max(x, sz.width); } } return new Dimension(x, y); }
|
return "JRadioButton";
|
return super.paramString();
|
protected String paramString() { return "JRadioButton"; }
|
public JToggleButton (String text, Icon icon, boolean selected)
|
public JToggleButton()
|
public JToggleButton (String text, Icon icon, boolean selected) { super(text, icon); horizontalAlignment = LEADING; setModel(new ToggleButtonModel()); model.setSelected(selected); }
|
super(text, icon); horizontalAlignment = LEADING; setModel(new ToggleButtonModel()); model.setSelected(selected);
|
this(null, null, false);
|
public JToggleButton (String text, Icon icon, boolean selected) { super(text, icon); horizontalAlignment = LEADING; setModel(new ToggleButtonModel()); model.setSelected(selected); }
|
int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset));
|
void adjustPositionsInRange(int offset, int length, int incr) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset)); if (index1 < 0) index1 = -(index1 + 1); if (index2 < 0) index2 = -(index2 + 1); for (ListIterator i = positions.listIterator(index1); i.hasNext();) { if (i.nextIndex() > index2) break; GapContentPosition p = (GapContentPosition) i.next(); if (p.mark >= offset && p.mark <= endOffset) p.mark += incr; } }
|
|
if (index2 < 0) index2 = -(index2 + 1);
|
void adjustPositionsInRange(int offset, int length, int incr) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset)); if (index1 < 0) index1 = -(index1 + 1); if (index2 < 0) index2 = -(index2 + 1); for (ListIterator i = positions.listIterator(index1); i.hasNext();) { if (i.nextIndex() > index2) break; GapContentPosition p = (GapContentPosition) i.next(); if (p.mark >= offset && p.mark <= endOffset) p.mark += incr; } }
|
|
if (i.nextIndex() > index2)
|
GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset)
|
void adjustPositionsInRange(int offset, int length, int incr) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset)); if (index1 < 0) index1 = -(index1 + 1); if (index2 < 0) index2 = -(index2 + 1); for (ListIterator i = positions.listIterator(index1); i.hasNext();) { if (i.nextIndex() > index2) break; GapContentPosition p = (GapContentPosition) i.next(); if (p.mark >= offset && p.mark <= endOffset) p.mark += incr; } }
|
GapContentPosition p = (GapContentPosition) i.next();
|
void adjustPositionsInRange(int offset, int length, int incr) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset)); if (index1 < 0) index1 = -(index1 + 1); if (index2 < 0) index2 = -(index2 + 1); for (ListIterator i = positions.listIterator(index1); i.hasNext();) { if (i.nextIndex() > index2) break; GapContentPosition p = (GapContentPosition) i.next(); if (p.mark >= offset && p.mark <= endOffset) p.mark += incr; } }
|
|
int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset));
|
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector res = v; if (res == null) res = new Vector(); else res.clear(); int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset)); if (index1 < 0) index1 = -(index1 + 1); if (index2 < 0) index2 = -(index2 + 1); for (ListIterator i = positions.listIterator(index1); i.hasNext();) { if (i.nextIndex() > index2) break; GapContentPosition p = (GapContentPosition) i.next(); if (p.mark >= offset && p.mark <= endOffset) res.add(p); } return res; }
|
|
if (index2 < 0) index2 = -(index2 + 1);
|
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector res = v; if (res == null) res = new Vector(); else res.clear(); int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset)); if (index1 < 0) index1 = -(index1 + 1); if (index2 < 0) index2 = -(index2 + 1); for (ListIterator i = positions.listIterator(index1); i.hasNext();) { if (i.nextIndex() > index2) break; GapContentPosition p = (GapContentPosition) i.next(); if (p.mark >= offset && p.mark <= endOffset) res.add(p); } return res; }
|
|
if (i.nextIndex() > index2)
|
GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset)
|
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector res = v; if (res == null) res = new Vector(); else res.clear(); int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset)); if (index1 < 0) index1 = -(index1 + 1); if (index2 < 0) index2 = -(index2 + 1); for (ListIterator i = positions.listIterator(index1); i.hasNext();) { if (i.nextIndex() > index2) break; GapContentPosition p = (GapContentPosition) i.next(); if (p.mark >= offset && p.mark <= endOffset) res.add(p); } return res; }
|
GapContentPosition p = (GapContentPosition) i.next();
|
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector res = v; if (res == null) res = new Vector(); else res.clear(); int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset)); if (index1 < 0) index1 = -(index1 + 1); if (index2 < 0) index2 = -(index2 + 1); for (ListIterator i = positions.listIterator(index1); i.hasNext();) { if (i.nextIndex() > index2) break; GapContentPosition p = (GapContentPosition) i.next(); if (p.mark >= offset && p.mark <= endOffset) res.add(p); } return res; }
|
|
replace(where, 0, str.toCharArray(), str.length());
|
replace(where, 0, str.toCharArray(), strLen);
|
public UndoableEdit insertString(int where, String str) throws BadLocationException { // check arguments int length = length(); int strLen = str.length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); replace(where, 0, str.toCharArray(), str.length()); return null; }
|
return null;
|
return new UndoInsertString(where, strLen);
|
public UndoableEdit insertString(int where, String str) throws BadLocationException { // check arguments int length = length(); int strLen = str.length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); replace(where, 0, str.toCharArray(), str.length()); return null; }
|
return null;
|
return new UndoRemove(where, removedText);
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { // check arguments int length = length(); if (where >= length) throw new BadLocationException("the where argument cannot be greater" + " than the content length", where); if ((where + nitems) > length) throw new BadLocationException("where + nitems cannot be greater" + " than the content length", where + nitems); replace(where, nitems, null, 0); return null; }
|
int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset));
|
void setPositionsInRange(int offset, int length, int value) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset)); if (index1 < 0) index1 = -(index1 + 1); if (index2 < 0) index2 = -(index2 + 1); for (ListIterator i = positions.listIterator(index1); i.hasNext();) { if (i.nextIndex() > index2) break; GapContentPosition p = (GapContentPosition) i.next(); if (p.mark >= offset && p.mark <= endOffset) p.mark = value;} }
|
|
if (index2 < 0) index2 = -(index2 + 1);
|
void setPositionsInRange(int offset, int length, int value) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset)); if (index1 < 0) index1 = -(index1 + 1); if (index2 < 0) index2 = -(index2 + 1); for (ListIterator i = positions.listIterator(index1); i.hasNext();) { if (i.nextIndex() > index2) break; GapContentPosition p = (GapContentPosition) i.next(); if (p.mark >= offset && p.mark <= endOffset) p.mark = value;} }
|
|
if (i.nextIndex() > index2)
|
GapContentPosition p = (GapContentPosition) i.next(); if (p.mark > endOffset)
|
void setPositionsInRange(int offset, int length, int value) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset)); if (index1 < 0) index1 = -(index1 + 1); if (index2 < 0) index2 = -(index2 + 1); for (ListIterator i = positions.listIterator(index1); i.hasNext();) { if (i.nextIndex() > index2) break; GapContentPosition p = (GapContentPosition) i.next(); if (p.mark >= offset && p.mark <= endOffset) p.mark = value;} }
|
GapContentPosition p = (GapContentPosition) i.next();
|
void setPositionsInRange(int offset, int length, int value) { int endOffset = offset + length; int index1 = Collections.binarySearch(positions, new GapContentPosition(offset)); int index2 = Collections.binarySearch(positions, new GapContentPosition(endOffset)); if (index1 < 0) index1 = -(index1 + 1); if (index2 < 0) index2 = -(index2 + 1); for (ListIterator i = positions.listIterator(index1); i.hasNext();) { if (i.nextIndex() > index2) break; GapContentPosition p = (GapContentPosition) i.next(); if (p.mark >= offset && p.mark <= endOffset) p.mark = value;} }
|
|
public ListIterator<E> listIterator(final int index)
|
public ListIterator<E> listIterator()
|
public ListIterator<E> listIterator(final int index) { if (index < 0 || index > size()) throw new IndexOutOfBoundsException("Index: " + index + ", Size:" + size()); return new ListIterator<E>() { private int knownMod = modCount; private int position = index; private int lastReturned = -1; private int size = size(); // This will get inlined, since it is private. /** * Checks for modifications made to the list from * elsewhere while iteration is in progress. * * @throws ConcurrentModificationException if the * list has been modified elsewhere. */ private void checkMod() { if (knownMod != modCount) throw new ConcurrentModificationException(); } /** * Tests to see if there are any more objects to * return. * * @return True if the end of the list has not yet been * reached. * @throws ConcurrentModificationException if the * list has been modified elsewhere. */ public boolean hasNext() { checkMod(); return position < size; } /** * Tests to see if there are objects prior to the * current position in the list. * * @return True if objects exist prior to the current * position of the iterator. * @throws ConcurrentModificationException if the * list has been modified elsewhere. */ public boolean hasPrevious() { checkMod(); return position > 0; } /** * Retrieves the next object from the list. * * @return The next object. * @throws NoSuchElementException if there are no * more objects to retrieve. * @throws ConcurrentModificationException if the * list has been modified elsewhere. */ public E next() { checkMod(); if (position == size) throw new NoSuchElementException(); lastReturned = position; return get(position++); } /** * Retrieves the previous object from the list. * * @return The next object. * @throws NoSuchElementException if there are no * previous objects to retrieve. * @throws ConcurrentModificationException if the * list has been modified elsewhere. */ public E previous() { checkMod(); if (position == 0) throw new NoSuchElementException(); lastReturned = --position; return get(lastReturned); } /** * Returns the index of the next element in the * list, which will be retrieved by <code>next()</code> * * @return The index of the next element. * @throws ConcurrentModificationException if the list * has been modified elsewhere. */ public int nextIndex() { checkMod(); return position; } /** * Returns the index of the previous element in the * list, which will be retrieved by <code>previous()</code> * * @return The index of the previous element. * @throws ConcurrentModificationException if the list * has been modified elsewhere. */ public int previousIndex() { checkMod(); return position - 1; } /** * Removes the last object retrieved by <code>next()</code> * or <code>previous()</code> from the list, if the list * supports object removal. * * @throws IllegalStateException if the iterator is positioned * before the start of the list or the last object has already * been removed. * @throws UnsupportedOperationException if the list does * not support removing elements. * @throws ConcurrentModificationException if the list * has been modified elsewhere. */ public void remove() { checkMod(); if (lastReturned < 0) throw new IllegalStateException(); AbstractList.this.remove(lastReturned); size--; position = lastReturned; lastReturned = -1; knownMod = modCount; } /** * Replaces the last object retrieved by <code>next()</code> * or <code>previous</code> with o, if the list supports object * replacement and an add or remove operation has not already * been performed. * * @throws IllegalStateException if the iterator is positioned * before the start of the list or the last object has already * been removed. * @throws UnsupportedOperationException if the list doesn't support * the addition or removal of elements. * @throws ClassCastException if the type of o is not a valid type * for this list. * @throws IllegalArgumentException if something else related to o * prevents its addition. * @throws ConcurrentModificationException if the list * has been modified elsewhere. */ public void set(E o) { checkMod(); if (lastReturned < 0) throw new IllegalStateException(); AbstractList.this.set(lastReturned, o); } /** * Adds the supplied object before the element that would be returned * by a call to <code>next()</code>, if the list supports addition. * * @param o The object to add to the list. * @throws UnsupportedOperationException if the list doesn't support * the addition of new elements. * @throws ClassCastException if the type of o is not a valid type * for this list. * @throws IllegalArgumentException if something else related to o * prevents its addition. * @throws ConcurrentModificationException if the list * has been modified elsewhere. */ public void add(E o) { checkMod(); AbstractList.this.add(position++, o); size++; lastReturned = -1; knownMod = modCount; } }; }
|
if (index < 0 || index > size()) throw new IndexOutOfBoundsException("Index: " + index + ", Size:" + size()); return new ListIterator<E>() { private int knownMod = modCount; private int position = index; private int lastReturned = -1; private int size = size(); private void checkMod() { if (knownMod != modCount) throw new ConcurrentModificationException(); } public boolean hasNext() { checkMod(); return position < size; } public boolean hasPrevious() { checkMod(); return position > 0; } public E next() { checkMod(); if (position == size) throw new NoSuchElementException(); lastReturned = position; return get(position++); } public E previous() { checkMod(); if (position == 0) throw new NoSuchElementException(); lastReturned = --position; return get(lastReturned); } public int nextIndex() { checkMod(); return position; } public int previousIndex() { checkMod(); return position - 1; } public void remove() { checkMod(); if (lastReturned < 0) throw new IllegalStateException(); AbstractList.this.remove(lastReturned); size--; position = lastReturned; lastReturned = -1; knownMod = modCount; } public void set(E o) { checkMod(); if (lastReturned < 0) throw new IllegalStateException(); AbstractList.this.set(lastReturned, o); } public void add(E o) { checkMod(); AbstractList.this.add(position++, o); size++; lastReturned = -1; knownMod = modCount; } };
|
return listIterator(0);
|
public ListIterator<E> listIterator(final int index) { if (index < 0 || index > size()) throw new IndexOutOfBoundsException("Index: " + index + ", Size:" + size()); return new ListIterator<E>() { private int knownMod = modCount; private int position = index; private int lastReturned = -1; private int size = size(); // This will get inlined, since it is private. /** * Checks for modifications made to the list from * elsewhere while iteration is in progress. * * @throws ConcurrentModificationException if the * list has been modified elsewhere. */ private void checkMod() { if (knownMod != modCount) throw new ConcurrentModificationException(); } /** * Tests to see if there are any more objects to * return. * * @return True if the end of the list has not yet been * reached. * @throws ConcurrentModificationException if the * list has been modified elsewhere. */ public boolean hasNext() { checkMod(); return position < size; } /** * Tests to see if there are objects prior to the * current position in the list. * * @return True if objects exist prior to the current * position of the iterator. * @throws ConcurrentModificationException if the * list has been modified elsewhere. */ public boolean hasPrevious() { checkMod(); return position > 0; } /** * Retrieves the next object from the list. * * @return The next object. * @throws NoSuchElementException if there are no * more objects to retrieve. * @throws ConcurrentModificationException if the * list has been modified elsewhere. */ public E next() { checkMod(); if (position == size) throw new NoSuchElementException(); lastReturned = position; return get(position++); } /** * Retrieves the previous object from the list. * * @return The next object. * @throws NoSuchElementException if there are no * previous objects to retrieve. * @throws ConcurrentModificationException if the * list has been modified elsewhere. */ public E previous() { checkMod(); if (position == 0) throw new NoSuchElementException(); lastReturned = --position; return get(lastReturned); } /** * Returns the index of the next element in the * list, which will be retrieved by <code>next()</code> * * @return The index of the next element. * @throws ConcurrentModificationException if the list * has been modified elsewhere. */ public int nextIndex() { checkMod(); return position; } /** * Returns the index of the previous element in the * list, which will be retrieved by <code>previous()</code> * * @return The index of the previous element. * @throws ConcurrentModificationException if the list * has been modified elsewhere. */ public int previousIndex() { checkMod(); return position - 1; } /** * Removes the last object retrieved by <code>next()</code> * or <code>previous()</code> from the list, if the list * supports object removal. * * @throws IllegalStateException if the iterator is positioned * before the start of the list or the last object has already * been removed. * @throws UnsupportedOperationException if the list does * not support removing elements. * @throws ConcurrentModificationException if the list * has been modified elsewhere. */ public void remove() { checkMod(); if (lastReturned < 0) throw new IllegalStateException(); AbstractList.this.remove(lastReturned); size--; position = lastReturned; lastReturned = -1; knownMod = modCount; } /** * Replaces the last object retrieved by <code>next()</code> * or <code>previous</code> with o, if the list supports object * replacement and an add or remove operation has not already * been performed. * * @throws IllegalStateException if the iterator is positioned * before the start of the list or the last object has already * been removed. * @throws UnsupportedOperationException if the list doesn't support * the addition or removal of elements. * @throws ClassCastException if the type of o is not a valid type * for this list. * @throws IllegalArgumentException if something else related to o * prevents its addition. * @throws ConcurrentModificationException if the list * has been modified elsewhere. */ public void set(E o) { checkMod(); if (lastReturned < 0) throw new IllegalStateException(); AbstractList.this.set(lastReturned, o); } /** * Adds the supplied object before the element that would be returned * by a call to <code>next()</code>, if the list supports addition. * * @param o The object to add to the list. * @throws UnsupportedOperationException if the list doesn't support * the addition of new elements. * @throws ClassCastException if the type of o is not a valid type * for this list. * @throws IllegalArgumentException if something else related to o * prevents its addition. * @throws ConcurrentModificationException if the list * has been modified elsewhere. */ public void add(E o) { checkMod(); AbstractList.this.add(position++, o); size++; lastReturned = -1; knownMod = modCount; } }; }
|
len = withParams.size();
|
len = withParams != null ? withParams.size() : 0;
|
TemplateNode clone(Stylesheet stylesheet) { int len = sortKeys != null ? sortKeys.size() : 0; List sortKeys2 = new ArrayList(len); for (int i = 0; i < len; i++) sortKeys2.add(((Key) sortKeys.get(i)).clone(stylesheet)); len = withParams.size(); List withParams2 = new ArrayList(len); for (int i = 0; i < len; i++) withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet)); TemplateNode ret = new ApplyTemplatesNode(select.clone(stylesheet), mode, sortKeys2, withParams2, isDefault); if (children != null) ret.children = children.clone(stylesheet); if (next != null) ret.next = next.clone(stylesheet); return ret; }
|
{
|
public boolean references(QName var) { if (children != null && children.references(var)) { return true; } if (next != null && next.references(var)) { return true; } return false; }
|
|
}
|
public boolean references(QName var) { if (children != null && children.references(var)) { return true; } if (next != null && next.references(var)) { return true; } return false; }
|
|
final private void debug(String s)
|
private void debug(String s)
|
final private void debug(String s) { if (Configuration.DEBUG) System.out.println(s); }
|
final private void dumpTable()
|
private void dumpTable()
|
final private void dumpTable() { int start_range = 0; if (!Configuration.DEBUG) return; System.out.println("Dumping internal table:"); for (int i = 0; i < ranges.length; i++) { System.out.print("\t" + start_range + " => " + ranges[i] + ":"); if (attributes[i] == null) System.out.println("null"); else { Set keyset = attributes[i].keySet(); if (keyset != null) { Iterator keys = keyset.iterator(); while (keys.hasNext()) System.out.print(" " + keys.next()); } else System.out.println("keySet null"); System.out.println(); } } System.out.println(); System.out.flush(); }
|
getAttributes();
|
Map getAttributes();
|
getAttributes();
|
public int getRGB(Object inData)
|
public int getRGB(int pixel)
|
public int getRGB(Object inData) { return ((getAlpha(inData) & 0xff) << 24) | (( getRed(inData) & 0xff) << 16) | ((getGreen(inData) & 0xff) << 8) | (( getBlue(inData) & 0xff) << 0); }
|
((getAlpha(inData) & 0xff) << 24) | (( getRed(inData) & 0xff) << 16) | ((getGreen(inData) & 0xff) << 8) | (( getBlue(inData) & 0xff) << 0);
|
((getAlpha(pixel) & 0xff) << 24) | (( getRed(pixel) & 0xff) << 16) | ((getGreen(pixel) & 0xff) << 8) | (( getBlue(pixel) & 0xff) << 0);
|
public int getRGB(Object inData) { return ((getAlpha(inData) & 0xff) << 24) | (( getRed(inData) & 0xff) << 16) | ((getGreen(inData) & 0xff) << 8) | (( getBlue(inData) & 0xff) << 0); }
|
MessageNode(TemplateNode children, TemplateNode next, boolean terminate)
|
MessageNode(boolean terminate)
|
MessageNode(TemplateNode children, TemplateNode next, boolean terminate) { super(children, next); this.terminate = terminate; }
|
super(children, next);
|
MessageNode(TemplateNode children, TemplateNode next, boolean terminate) { super(children, next); this.terminate = terminate; }
|
|
return new MessageNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), terminate);
|
TemplateNode ret = new MessageNode(terminate); if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret;
|
TemplateNode clone(Stylesheet stylesheet) { return new MessageNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), terminate); }
|
this.setSize(this.getPreferredSize());
|
public void remove(int index) { super.remove(index); GridBagConstraints constraints = new GridBagConstraints(); constraints.fill = GridBagConstraints.BOTH; constraints.weightx = 100.0; constraints.weighty = 100.0; Component[] items = getComponents(); for (int i = index; i < items.length; i++) { constraints.gridy = i; super.add(items[i], constraints, i); } }
|
|
return calendar.equals(d.calendar) && numberFormat.equals(d.numberFormat);
|
return numberFormat.equals(d.numberFormat);
|
public boolean equals (Object obj) { if (! (obj instanceof DateFormat)) return false; DateFormat d = (DateFormat) obj; return calendar.equals(d.calendar) && numberFormat.equals(d.numberFormat); }
|
int hash = calendar.hashCode();
|
public int hashCode () { int hash = calendar.hashCode(); if (numberFormat != null) hash ^= numberFormat.hashCode(); return hash; }
|
|
hash ^= numberFormat.hashCode(); return hash;
|
return numberFormat.hashCode(); else return 0;
|
public int hashCode () { int hash = calendar.hashCode(); if (numberFormat != null) hash ^= numberFormat.hashCode(); return hash; }
|
return (o instanceof Calendar) && getTimeInMillis() == ((Calendar) o).getTimeInMillis();
|
if (! (o instanceof Calendar)) return false; Calendar cal = (Calendar) o; if (getTimeInMillis() == ((Calendar) o).getTimeInMillis() && cal.getFirstDayOfWeek() == getFirstDayOfWeek() && cal.isLenient() == isLenient() && cal.getMinimalDaysInFirstWeek() == getMinimalDaysInFirstWeek()) { TimeZone self = getTimeZone(); TimeZone oth = cal.getTimeZone(); return self == null ? oth == null : self.equals(oth); } return false;
|
public boolean equals(Object o) { return (o instanceof Calendar) && getTimeInMillis() == ((Calendar) o).getTimeInMillis(); }
|
return (int) ((time & 0xffffffffL) ^ (time >> 32));
|
int val = (int) ((time & 0xffffffffL) ^ (time >> 32)); val += (getFirstDayOfWeek() + (isLenient() ? 1230 : 1237) + getMinimalDaysInFirstWeek()); TimeZone self = getTimeZone(); if (self != null) val ^= self.hashCode(); return val;
|
public int hashCode() { long time = getTimeInMillis(); return (int) ((time & 0xffffffffL) ^ (time >> 32)); }
|
public void copy(int srcMemPtr, int destMemPtr, int size) { testMemPtr(srcMemPtr, size); testMemPtr(destMemPtr, size);
|
public void copy(int srcMemPtr, int destMemPtr, int length) { testMemPtr(srcMemPtr, length); testMemPtr(destMemPtr, length); final Extent size = Extent.fromIntZeroExtend(length);
|
public void copy(int srcMemPtr, int destMemPtr, int size) { testMemPtr(srcMemPtr, size); testMemPtr(destMemPtr, size); Unsafe.copy(start.add(srcMemPtr), start.add(destMemPtr), size); }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.