|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.dse.applsrv.aa.Array
Generalization of Vector.
Constructor Summary | |
Array()
Return an empty array. |
|
Array(boolean firstElement,
boolean secondElement,
boolean thirdElement,
boolean fourthElement,
boolean fifthElement)
Constructs an array with five elements. |
|
Array(boolean expand,
java.lang.Object[] list)
Constructs an array with a java array being its only element or as its all of its elements. |
|
Array(int initialCapacity)
Constructs an empty array with the specified initial capacity. |
|
Array(int initialCapacity,
int capacityIncrement)
Constructs an empty array with the specified initial capacity and capacity increment. |
|
Array(int firstElement,
int secondElement,
java.lang.Object thirdElement)
Constructs an array with three elements. |
|
Array(int firstElement,
java.lang.Object secondElement)
Constructs an array with two elements. |
|
Array(java.lang.Object firstElement)
Constructs an array with one element. |
|
Array(java.lang.Object firstElement,
java.lang.Object secondElement)
Constructs an array with two elements. |
|
Array(java.lang.Object firstElement,
java.lang.Object secondElement,
java.lang.Object thirdElement)
Constructs an array with three elements. |
Method Summary | |
java.lang.Boolean |
add(boolean b)
Add a new element to this array. |
java.lang.Character |
add(char c)
Add a new element to this array. |
java.lang.Double |
add(double n)
Add a new element to this array. |
java.lang.Float |
add(float n)
Add a new element to this array. |
java.lang.Integer |
add(int n)
Add a new element to this array. |
void |
add(int first,
int second)
Add two interger elements to this array. |
void |
add(int first,
int second,
int third)
Add three interger elements to this array. |
java.lang.Long |
add(long n)
Add a new element to this array. |
void |
add(java.lang.Object x)
Add a new element to this array. |
void |
add(java.lang.Object x,
java.lang.Object y)
Add 2 new elements to this array. |
void |
add(java.lang.Object x,
java.lang.Object y,
java.lang.Object z)
Add 3 new elements to this array. |
java.lang.Short |
add(short n)
Add a new element to this array. |
Array |
addAll(Array v)
Add each element of array v to this array. |
Array |
addAll(boolean[] v)
Add each element of java array v to this array. |
Array |
addAll(int[] v)
Add each element of java array v to this array. |
Array |
addAll(java.lang.Object[] v)
Add each element of java array v to this array. |
Array |
addAll(java.util.Vector v)
Add each element of vector v to this array. |
Array |
addAllKeys(Dictionary d)
Add each key of dictionary d to this array. |
Array |
addAllKeys(java.util.Hashtable d)
Add each key of dictionary d to this array. |
void |
addElement(java.lang.Object anObject)
Adds the specified element to the end of this array, increasing its size by one. |
boolean |
addNew(java.lang.Object anObject)
Add anObject to this array if its not already included. |
java.lang.String[] |
asArray()
Return an array of strings corresponding to this Array of strings. |
java.lang.String |
asList()
Returns a string representation of this array. |
static java.lang.String |
asList(Array v)
Return the string representation of the specified list. |
void |
asList(java.lang.StringBuffer stringBuffer)
Append the string representation of this array to the string buffer. |
java.lang.Object[] |
asObjectArray()
Return an array of objects corresponding to this Array of objects. |
static java.lang.String |
asString(Array v)
Return the string representation of the specified vector. |
static java.lang.String |
asString(java.util.Vector v)
Return the string representation of the specified vector. |
java.util.Vector |
asVector()
Return a Vector corresponding to this Array. |
java.lang.Object |
at(int index)
Return the n'th element of this array or null if out of range. |
java.lang.Object |
basicAt(int index)
Return the n'th element of this array. |
int |
capacity()
Returns the current capacity of this array. |
Array |
cat(Array v)
Return the concatenation of the receiver with the specified array. |
Array |
cat(java.util.Vector v)
Return the concatenation of the receiver with the specified vector. |
void |
clear()
Set the effective size of this array to 0. |
java.lang.Object |
clone()
Returns a clone of this array. |
boolean |
contains(java.lang.Object anObject)
Tests if the specified object is an element of this array. |
Array |
copy()
Return a copy of this array. |
static Array |
copy(Array anArray)
Return a copy of the specified array or null if the argument is null. |
void |
copyInto(java.lang.Object[] anArray)
Copies the elements of this vector into the specified array. |
java.lang.Object |
elementAt(int index)
Returns the element at the specified index. |
java.util.Enumeration |
elements()
Returns an enumeration of the elements of this array. |
boolean |
empty()
Return true if this array is empty else return false. |
void |
ensureCapacity(int minCapacity)
Increases the capacity of this array, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument. |
java.util.Enumeration |
enum()
Return an enumeration constructed from this array. |
boolean |
excludes(java.lang.Object anObject)
Return true if this array does not contain the specified object. |
java.lang.Object |
fifth()
Return the fifth element of this array or null if there is no fifth element. |
java.lang.Object |
first()
Return the first element of this array or null if this array is empty. |
java.lang.Object |
firstElement()
Returns the first element of this array. |
java.lang.Object |
fourth()
Return the fourth element of this array or null if there is no fourth element. |
static Array |
from(boolean[] v)
Return an Array constructed from a java array. |
static Array |
from(int[] v)
Return an Array constructed from a java array. |
static Array |
from(java.lang.Object[] v)
Return an Array constructed from a java array. |
static Array |
from(java.lang.String s)
Return an Array constructed from the words found within the specified string. |
static Array |
from(java.lang.String s,
char c)
Return an Array constructed from the words found within the specified string. |
static Array |
from(java.util.Vector v)
Return an Array constructed from a vector. |
static Array |
fromKeys(Dictionary d)
Return an Array constructed from the keys of a dictionary. |
static Array |
fromKeys(java.util.Hashtable d)
Return an Array constructed from the keys of a dictionary. |
boolean |
includes(java.lang.Object anObject)
Return true if this array contains the specified object. |
int |
includesAll(java.lang.Object[] list)
Return the index of the first element of list not found in this array or -1 if all found. |
int |
includesAny(java.lang.Object[] list)
Return the index of the first element of list found in this array or -1 if none found. |
boolean |
includesIdentical(java.lang.Object anObject)
Return true if this array contains the specified object via identity. |
int |
indexOf(java.lang.Object elem)
Searches for the first occurence of the given argument, testing for equality using the equals method. |
int |
indexOf(java.lang.Object elem,
int index)
Searches for the first occurence of the given argument, beginning the search at index , and testing for equality using the equals method. |
void |
insertElementAt(java.lang.Object obj,
int index)
Inserts the specified object as an element in this array at the specified index . |
boolean |
isEmpty()
Tests if this array has no elements. |
java.lang.Object |
last()
Return the last element of this array or null if this array is empty. |
java.lang.Object |
lastElement()
Returns the last element of the array. |
int |
lastIndexOf(java.lang.Object elem)
Returns the index of the last occurrence of the specified object in this array. |
int |
lastIndexOf(java.lang.Object elem,
int index)
Searches backwards for the specified object, starting from the specified index, and returns an index to it. |
static java.lang.String[] |
parse(char[] s)
Return a string array constructed from the words found within the specified character array. |
Array |
prefix(java.lang.String s)
Return a new Array which contains the elements of the current Array each prefixed by String s. |
boolean |
put(int n,
java.lang.Object x)
Place object x into the n'th position (0-indexed) of this array. |
boolean |
remove(java.lang.Object obj)
Remove an element of this array. |
int |
removeAll(java.lang.Object[] list)
Remove all the elements in list from this array. |
void |
removeAllElements()
Removes all elements from this array and sets its size to zero. |
boolean |
removeElement(java.lang.Object obj)
Removes the first occurrence of the argument from this array. |
void |
removeElementAt(int index)
Deletes the element at the specified index. |
Array |
rpadv(int n,
java.lang.Object x)
Return this array right padded to the specified size with the specified object. |
java.lang.Object |
second()
Return the second element of this array or null if there is no second element. |
void |
set(Array list)
Set the elements of this array to the specified list. |
void |
set(java.lang.Object[] elements)
Set the elements of this array to the specified list. |
void |
set(java.lang.Object element1,
java.lang.Object element2)
Set the elements of this array to the specified values. |
void |
set(java.lang.Object element1,
java.lang.Object element2,
java.lang.Object element3)
Set the elements of this array to the specified values. |
void |
set(java.lang.Object element1,
java.lang.Object element2,
java.lang.Object element3,
java.lang.Object element4)
Set the elements of this array to the specified values. |
void |
set(java.lang.Object element1,
java.lang.Object element2,
java.lang.Object element3,
java.lang.Object element4,
java.lang.Object element5)
Set the elements of this array to the specified values. |
void |
set(java.lang.Object element1,
java.lang.Object element2,
java.lang.Object element3,
java.lang.Object element4,
java.lang.Object element5,
java.lang.Object element6)
Set the elements of this array to the specified values. |
void |
setElementAt(java.lang.Object obj,
int index)
Sets the element at the specified index of this array to be the specified object. |
void |
setSize(int newSize)
Sets the size of this array. |
void |
setTo(java.lang.Object element1)
Set the elements of this array to the specified value. |
int |
size()
Returns the number of elements in this array. |
Array |
sort()
Sort this array of Strings (no other element types must be present). |
static java.lang.String[] |
sort(java.lang.String[] v)
Return the argument as a sorted java string array. |
Array |
suffix(java.lang.String s)
Return a new Array which contains the elements of the current Array each suffixed by String s. |
Array |
surround(java.lang.String s)
Return a new Array which contains the elements of the current Array each prefixed and suffixed by String s. |
Array |
surround(java.lang.String s,
java.lang.String t)
Return a new Array which contains the elements of the current Array each prefixed by String s and suffixed by String t. |
void |
swap(int i,
int j)
Swap the elements at the 2 indexes. |
java.lang.Object |
third()
Return the third element of this array or null if there is no third element. |
java.lang.String |
toString()
Returns a string representation of this array. |
void |
toString(java.lang.StringBuffer stringBuffer)
Append the string representation of this array to the string buffer. |
void |
trimToSize()
Trims the capacity of this array to be the array's current size. |
static Array |
with()
Return an empty array. |
static Array |
with(java.lang.Object x)
Return a 1 element array. |
static Array |
with(java.lang.Object x,
java.lang.Object y)
Return a 2 element array. |
static Array |
with(java.lang.Object x,
java.lang.Object y,
java.lang.Object z)
Return a 3 element array. |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Array()
public Array(int initialCapacity)
initialCapacity
- int - the initial capacity of the array.public Array(int initialCapacity, int capacityIncrement)
initialCapacity
- int - the initial capacity of the array.capacityIncrement
- int - the amount by which the capacity is increased when the array overflows.public Array(int firstElement, int secondElement, java.lang.Object thirdElement)
firstElement
- int - the first element of the array.secondElement
- int - the second element of the array.thirdElement
- Object - the third element of the array.public Array(int firstElement, java.lang.Object secondElement)
firstElement
- int - the first element of the array.secondElement
- Object - the second element of the array.public Array(java.lang.Object firstElement)
firstElement
- Object - the first element of the array.public Array(java.lang.Object firstElement, java.lang.Object secondElement)
firstElement
- Object - the first element of the array.secondElement
- Object - the second element of the array.public Array(java.lang.Object firstElement, java.lang.Object secondElement, java.lang.Object thirdElement)
firstElement
- Object - the first element of the array.secondElement
- Object - the second element of the array.thirdElement
- Object - the third element of the array.public Array(boolean expand, java.lang.Object[] list)
expand
- boolean - if true then each element of 'list' becomes an element of this array else the list itself becomes the sole element of this array.list
- Object[] - the list to include (one way or another).public Array(boolean firstElement, boolean secondElement, boolean thirdElement, boolean fourthElement, boolean fifthElement)
firstElement
- boolean - the first element of the array.secondElement
- boolean - the second element of the array.thirdElement
- boolean - the third element of the array.fourthElement
- boolean - the fourth element of the array.fifthElement
- boolean - the fifth element of the array.Method Detail |
public java.lang.Character add(char c)
c
- char - the element to add.public java.lang.Double add(double n)
n
- double - the element to add.public java.lang.Float add(float n)
n
- float - the element to add.public java.lang.Integer add(int n)
n
- int - the element to add.public void add(int first, int second)
first
- int - the first element to add.second
- int - the second element to add.public void add(int first, int second, int third)
first
- int - the first element to add.second
- int - the second element to add.third
- int - the third element to add.public java.lang.Long add(long n)
n
- long - the element to add.public void add(java.lang.Object x)
x
- Object - the element to add.public void add(java.lang.Object x, java.lang.Object y)
x
- Object - the first element to add.y
- Object - the second element to add.public void add(java.lang.Object x, java.lang.Object y, java.lang.Object z)
x
- Object - the first element to add.y
- Object - the second element to add.z
- Object - the third element to add.public java.lang.Short add(short n)
n
- short - the element to add.public java.lang.Boolean add(boolean b)
b
- boolean - the element to add.public Array addAll(int[] v)
v
- int[] - the objects to be added.public Array addAll(java.lang.Object[] v)
v
- Object[] - the objects to be added.public Array addAll(boolean[] v)
v
- boolean[] - the objects to be added.public Array addAll(Array v)
v
- Array - the objects to be added.public Array addAll(java.util.Vector v)
v
- Vector - the objects to be added.public Array addAllKeys(Dictionary d)
d
- Dictionary - the dictionary who's keys are to be added.public Array addAllKeys(java.util.Hashtable d)
d
- Hashtable - the dictionary who's keys are to be added.public void addElement(java.lang.Object anObject)
anObject
- Object - the element to be added.public boolean addNew(java.lang.Object anObject)
anObject
- Object - the object to be added.public java.lang.String[] asArray()
public java.lang.String asList()
public static java.lang.String asList(Array v)
v
- Array - the array.public void asList(java.lang.StringBuffer stringBuffer)
stringBuffer
- StringBuffer - the string buffer to append to.public java.lang.Object[] asObjectArray()
public static java.lang.String asString(Array v)
v
- Array - the array.public static java.lang.String asString(java.util.Vector v)
v
- Vector - the vector.public java.util.Vector asVector()
public java.lang.Object at(int index)
index
- int - the index of the element.public java.lang.Object basicAt(int index)
index
- int - the index of the element.public int capacity()
public Array cat(Array v)
v
- Array - the array.public Array cat(java.util.Vector v)
v
- Vector - the vector.public void clear()
public java.lang.Object clone()
public boolean contains(java.lang.Object anObject)
anObject
- Object - the object to check for.true
if the specified object is an element of this array, false
otherwise.public Array copy()
public static Array copy(Array anArray)
anArray
- Array - the array to copy (or null).public void copyInto(java.lang.Object[] anArray)
anArray
- Object[] - the array into which the elements get copied.public java.lang.Object elementAt(int index)
index
- int - the index of the element.public java.util.Enumeration elements()
public boolean empty()
public void ensureCapacity(int minCapacity)
minCapacity
- int - the desired minimum capacity.public java.util.Enumeration enum()
public boolean excludes(java.lang.Object anObject)
anObject
- Object - the candidate element.public java.lang.Object fifth()
public java.lang.Object first()
public java.lang.Object firstElement()
public java.lang.Object fourth()
public static Array from(int[] v)
v
- int[] - the java array.public static Array from(java.lang.Object[] v)
v
- Object[] - the java array.public static Array from(boolean[] v)
v
- boolean[] - the java array.public static Array from(java.lang.String s)
s
- String - the string to parse.public static Array from(java.lang.String s, char c)
s
- String - the string to parse.c
- char - the delimiter.public static Array from(java.util.Vector v)
v
- Vector - the vector.public static Array fromKeys(Dictionary d)
d
- Dictionary - the dictionary who's keys are to be added.public static Array fromKeys(java.util.Hashtable d)
d
- Hashtable - the dictionary who's keys are to be added.public boolean includes(java.lang.Object anObject)
anObject
- Object - the candidate element.public int includesAll(java.lang.Object[] list)
list
- Object[] - the list of elements to check.public int includesAny(java.lang.Object[] list)
list
- Object[] - the list of elements to check.public boolean includesIdentical(java.lang.Object anObject)
anObject
- Object - the candidate element.public int indexOf(java.lang.Object elem)
equals
method.elem
- Object - the candidate element.-1
if the object is not found.Object.equals(Object).
public int indexOf(java.lang.Object elem, int index)
index
, and testing for equality using the equals
method.elem
- Object - the candidate element.index
- int - the index to start searching from.index
or later, returns -1
if the object is not found.Object.equals(java.lang.Object).
public void insertElementAt(java.lang.Object obj, int index)
index
.
Each element of this array with an index greater or equal to the specified index
is shifted upward to have an index one greater than the value it had previously.
The index must be a value greater than or equal to 0
and less than or equal to the current size of the array.
obj
- Object - the element to insert.index
- int - where to insert the new element.size().
public boolean isEmpty()
true
if this array has no elements, false
otherwise.public java.lang.Object last()
public java.lang.Object lastElement()
public int lastIndexOf(java.lang.Object elem)
elem
- Object - the candidate element.-1
if the object is not found.public int lastIndexOf(java.lang.Object elem, int index)
elem
- Object - the candidate element.index
- int - the index to start searching from.-1
if the object is not found.public static java.lang.String[] parse(char[] s)
s
- char[] - the 'string' to parse.public Array prefix(java.lang.String s)
s
- String - the prefix.public boolean put(int n, java.lang.Object x)
n
- int - the index of the element.x
- Object - the object to add.public boolean remove(java.lang.Object obj)
obj
- Object - the element to remove.public int removeAll(java.lang.Object[] list)
list
- Object[] - the elements to remove.public void removeAllElements()
public boolean removeElement(java.lang.Object obj)
obj
- Object - the element to remove.true
if an element was deleted else false
.public void removeElementAt(int index)
index
is shifted downward to have an index one smaller than the value it had previously.
The index must be a value greater than or equal to 0
and less than the current size of the array.
index
- int - the index of the object to remove.size().
public Array rpadv(int n, java.lang.Object x)
n
- int - the minimum size of the result vector.x
- Object - the padding object.public java.lang.Object second()
public void set(java.lang.Object[] elements)
elements
- Object[] - the new list of elements.public void set(Array list)
list
- Array - the new list of elements.public void set(java.lang.Object element1, java.lang.Object element2)
element1
- Object - the first element.element2
- Object - the second element.public void set(java.lang.Object element1, java.lang.Object element2, java.lang.Object element3)
element1
- Object - the first element.element2
- Object - the second element.element3
- Object - the third element.public void set(java.lang.Object element1, java.lang.Object element2, java.lang.Object element3, java.lang.Object element4)
element1
- Object - the first element.element2
- Object - the second element.element3
- Object - the third element.element4
- Object - the fourth element.public void set(java.lang.Object element1, java.lang.Object element2, java.lang.Object element3, java.lang.Object element4, java.lang.Object element5)
element1
- Object - the first element.element2
- Object - the second element.element3
- Object - the third element.element4
- Object - the fourth element.element5
- Object - the fifth element.public void set(java.lang.Object element1, java.lang.Object element2, java.lang.Object element3, java.lang.Object element4, java.lang.Object element5, java.lang.Object element6)
element1
- Object - the first element.element2
- Object - the second element.element3
- Object - the third element.element4
- Object - the fourth element.element5
- Object - the fifth element.element6
- Object - the sixth element.public void setElementAt(java.lang.Object obj, int index)
index
of this array to be the specified object. The previous element at that position is discarded.
The index must be a value greater than or equal to 0
and less than the current size of the array.
obj
- Object - the replacement element.index
- int - the specified index.size().
public void setSize(int newSize)
null
items are added to the end of the array.
If the new size is less than the current size, all components at index newSize
and greater are discarded.newSize
- int - the new size of this array.public void setTo(java.lang.Object element1)
element1
- Object - the first element.public int size()
public Array sort()
public static java.lang.String[] sort(java.lang.String[] v)
v
- String[] - the java string array to sort.public Array suffix(java.lang.String s)
s
- String - the suffix.public Array surround(java.lang.String s)
s
- String - the prefix and suffix.public Array surround(java.lang.String s, java.lang.String t)
s
- String - the prefix.t
- String - the suffix.public void swap(int i, int j)
i
- int - the index of the first element.j
- int - the index of the second element.public java.lang.Object third()
public java.lang.String toString()
public void toString(java.lang.StringBuffer stringBuffer)
stringBuffer
- StringBuffer - the string buffer to append to.public void trimToSize()
public static Array with()
public static Array with(java.lang.Object x)
x
- Object - the first element.public static Array with(java.lang.Object x, java.lang.Object y)
x
- Object - the first element.y
- Object - the second element.public static Array with(java.lang.Object x, java.lang.Object y, java.lang.Object z)
x
- Object - the first element.y
- Object - the second element.z
- Object - the third element.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |