Пример #1
0
 /**
  * remove the last element of the _weights vector, and returns it
  *
  * @return the last element of the _weights vector
  */
 public double removeLastWeight() {
   if (getSize() == 0) return -1;
   double res = _weights.lastElement();
   _weights.removeElementAt(_weights.lastIndexOf(res));
   return res;
 }
 /** Look up an attribute's value by XML 1.0 qualified name. */
 public String getValue(String name) {
   if (attr.lastIndexOf(name) == -1) return "";
   else return values.elementAt(attr.lastIndexOf(name)).toString();
 }
 /**
  * Searches backwards for <code>elem</code>, starting from the specified index, and returns an
  * index to it.
  *
  * @param elem the desired component
  * @param index the index to start searching from
  * @return the index of the last occurrence of the <code>elem</code> in this list at position less
  *     than <code>index</code>; returns <code>-1</code> if the object is not found
  * @see Vector#lastIndexOf(Object,int)
  */
 public int lastIndexOf(Object elem, int index) {
   return delegate.lastIndexOf(elem, index);
 }
 /** Look up the index of an attribute by XML 1.0 qualified name. */
 public int getIndex(String name) {
   return attr.lastIndexOf(name);
 }
 /**
  * Returns the index of the last occurrence of <code>elem</code>.
  *
  * @param elem the desired component
  * @return the index of the last occurrence of <code>elem</code> in the list; returns <code>-1
  *     </code> if the object is not found
  * @see Vector#lastIndexOf(Object)
  */
 public int lastIndexOf(Object elem) {
   return delegate.lastIndexOf(elem);
 }