|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--danger.util.VectorUtils
Vector utilities.
| Method Summary | |
static void |
addAll(java.util.Vector v1,
java.util.Vector v2)
Append all the elements of the second vector to the end of the first, in order. |
static int |
eqIndexOf(java.util.Vector vec,
java.lang.Object elem)
Search for the exact element given, compared with ==
(as opposed to Vector.indexOf() which uses
Object.equals() for most comparisons). |
static int |
eqRemoveElement(java.util.Vector vec,
java.lang.Object elem)
Search for and remove the exact element given, compared with == (as opposed to Vector.removeElement()
which uses Object.equals() for most comparisons). |
static java.util.Vector |
fromArray(java.lang.Object[] arr)
Construct and return a Vector containing all the
elements of the given array, in the same order. |
static int |
insertSorted(java.util.Vector vec,
java.lang.Object elem)
Insert the given element into the given vector in sorted order, using Comparable.compareTo() for comparisons. |
static int |
insertSorted(java.util.Vector vec,
java.lang.Object elem,
java.util.Comparator comp)
Insert the given element into the given vector in sorted order, using the given Compator for comparisons. |
static int |
insertUniqueSorted(java.util.Vector vec,
java.lang.Object elem)
Insert the given element into the given vector in sorted order, using Comparable.compareTo() for comparisons, checking
for duplicates and not inserting if an equal element is already
in the vector. |
static int |
insertUniqueSorted(java.util.Vector vec,
java.lang.Object elem,
java.util.Comparator comp)
Insert the given element into the given vector in sorted order, using the given Comparator for comparisons, checking
for duplicates and not inserting if an equal element is already
in the vector. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static java.util.Vector fromArray(java.lang.Object[] arr)
Vector containing all the
elements of the given array, in the same order.arr - non-null; the array of elementsVector
public static int eqIndexOf(java.util.Vector vec,
java.lang.Object elem)
==
(as opposed to Vector.indexOf() which uses
Object.equals() for most comparisons).vec - non-null; the Vector to search inelem - null-ok; the element to look for-1
if it was not found
public static int eqRemoveElement(java.util.Vector vec,
java.lang.Object elem)
== (as opposed to Vector.removeElement()
which uses Object.equals() for most comparisons).vec - non-null; the Vector to search inelem - null-ok; the element to look for-1 if it was not found
public static int insertSorted(java.util.Vector vec,
java.lang.Object elem)
Comparable.compareTo() for comparisons. This
method does not check for duplicates.vec - non-null; the vector to insert intoelem - null-ok; the element to insert
public static int insertSorted(java.util.Vector vec,
java.lang.Object elem,
java.util.Comparator comp)
Compator for comparisons. This
method does not check for duplicates.vec - non-null; the vector to insert intoelem - null-ok; the element to insertcomp - null-ok; the comparator to use, or null to
use Comparable.compareTo() instead of an explicit
comparator
public static int insertUniqueSorted(java.util.Vector vec,
java.lang.Object elem)
Comparable.compareTo() for comparisons, checking
for duplicates and not inserting if an equal element is already
in the vector.vec - non-null; the vector to insert intoelem - null-ok; the element to insert~index if the element was found and not reinserted
public static int insertUniqueSorted(java.util.Vector vec,
java.lang.Object elem,
java.util.Comparator comp)
Comparator for comparisons, checking
for duplicates and not inserting if an equal element is already
in the vector.vec - non-null; the vector to insert intoelem - null-ok; the element to insertcomp - null-ok; the comparator to use, or null to
use Comparable.compareTo() instead of an explicit
comparator~index if the element was found and not reinserted
public static void addAll(java.util.Vector v1,
java.util.Vector v2)
v1 - non-null; the vector to append tov2 - non-null; the vector whose contents should be appended
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||