/** * Adds the specified object into this vector at the specified location. The * object is inserted before any element with the same or a higher index * increasing their index by 1. If the location is equal to the size of this * vector, the object is added at the end. * * @param location * the index at which to insert the element. * @param object * the object to insert in this vector. * @throws ArrayIndexOutOfBoundsException * if {@code location < 0 || location > size()}. * @see #addElement * @see #size */ @Override public void add(int location, E object) { insertElementAt(object, location); }
/** * Set the first attribute of this element */ public void setFirstAttribute(SyntaxTreeNode attribute) { if (_attributeElements == null) { _attributeElements = new Vector(2); } _attributeElements.insertElementAt(attribute,0); }
/** * Adds an argument object to our list of args. * * @param insertAtStart if true, the argument is inserted at the beginning of the list of args, otherwise it is * appended. */ public void addArg( Arg argument, boolean insertAtStart ) { if ( insertAtStart ) { arguments.insertElementAt( argument, 0 ); } else { arguments.addElement( argument ); } }
Stack<String> stack = new Stack<String>(); stack.push("1"); stack.push("2"); stack.push("3"); stack.insertElementAt("squeeze me in!", 1); while (!stack.isEmpty()) { System.out.println(stack.pop()); } // prints "3", "2", "squeeze me in!", "1"
/** * Inserts the first child node of this syntax tree node. The existing * children are shifted back one position. * @param element is the new child node. */ protected final void setFirstElement(SyntaxTreeNode element) { _contents.insertElementAt(element,0); element.setParent(this); }
/** * <p>Creates an argument object and adds it to our list of args.</p> * * <p>Each commandline object has at most one instance of the argument class.</p> * * @param insertAtStart if true, the argument is inserted at the beginning of the list of args, otherwise it is * appended. * @deprecated Use {@link Commandline#createArg(boolean)} instead */ public Argument createArgument( boolean insertAtStart ) { Argument argument = new Argument(); if ( insertAtStart ) { arguments.insertElementAt( argument, 0 ); } else { arguments.addElement( argument ); } return argument; }
/** * <p>Creates an argument object and adds it to our list of args.</p> * * <p>Each commandline object has at most one instance of the argument class.</p> * * @param insertAtStart if true, the argument is inserted at the beginning of the list of args, otherwise it is * appended. */ public Arg createArg( boolean insertAtStart ) { Arg argument = new Argument(); if ( insertAtStart ) { arguments.insertElementAt( argument, 0 ); } else { arguments.addElement( argument ); } return argument; }
if (_separLast) _nSepars--; if (_nSepars == 0) { _separToks.insertElementAt(".", 1); _nSepars++;
patterns.insertElementAt(pattern, i); break;
b.insertElementAt(a.elementAt(i), i); else b.setElementAt(a.elementAt(i), i); b.insertElementAt(a.elementAt(j), r + m + 1 - j); else b.setElementAt(a.elementAt(j), r + m + 1 - j);
rendList.insertElementAt(dar, 0); PlugInManager.setPlugInList(rendList, plType); PlugInManager.commit();
b.insertElementAt(a.elementAt(i), i); else b.setElementAt(a.elementAt(i), i); b.insertElementAt(a.elementAt(j), r + m + 1 - j); else b.setElementAt(a.elementAt(j), r + m + 1 - j);
subNames.insertElementAt(targetName, pos); if (printDependencies) { subDependencies.insertElementAt(currentTarget.getDependencies(), pos); topNames.insertElementAt(targetName, pos); topDescriptions.insertElementAt(targetDescription, pos); if (targetName.length() > maxLength) { maxLength = targetName.length(); topDependencies.insertElementAt(currentTarget.getDependencies(), pos);
if (rendList.elementAt(listSize - 1).equals(dar)) { rendList.removeElementAt(listSize - 1); rendList.insertElementAt(dar, 0); PlugInManager.setPlugInList(rendList, plType); PlugInManager.commit();
rows.insertElementAt(this_row, 0); current_row = 0;
/** * Inserts a {@link DataElement} at the specified index. * After the element has been successfully inserted * all {@link DataListener DataListeners} will be informed. * @param index Index at which <tt>element</tt> will be inserted. * All elements with an index >= <tt>index</tt> will be shifted. * @param element DataElement to be added. * @throws IllegalArgumentException if <tt>element</tt> is not of the correct * type which will be checked by the method {@link #isValid}. */ public void insertElementAt(int index, DataElement element) { if (isValid(element)) { _container.insertElementAt(element, index); element.setContainer(this); notifyListeners(DataEvent.createInsertEvent(this, index)); } else { throwException(INSERT, element); } }
int arglright = ((java_cup.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right; Vector argl = (Vector)((java_cup.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value; argl.insertElementAt(arg, 0); RESULT = argl; CUP$XPathParser$result = new java_cup.runtime.Symbol(36/*NonemptyArgumentList*/, ((java_cup.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT); int ppright = ((java_cup.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right; Vector pp = (Vector)((java_cup.runtime.Symbol) CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).value; pp.insertElementAt(p, 0); RESULT = pp; CUP$XPathParser$result = new java_cup.runtime.Symbol(35/*Predicates*/, ((java_cup.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((java_cup.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
destDir = savedDestDir; if (savedRc != null) { rcs.insertElementAt(savedRc, 0);
private static Vector getVectorPathFromNode(Node node) { Vector path = new Vector(); while (node != null) { path.insertElementAt(node, 0); node = node.getParentNode(); } return path; }
void insertFrame(int index, Gif89Frame gf) throws IOException { accommodateFrame(gf); vFrames.insertElementAt(gf, index); }