public class VArray
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
VArray class implements a variable length
(growable) array of objects and primitive types. Like an array,
it contains components that can be accessed using an integer
index. However, the size of a VArray can grow or
shrink as needed to accommodate adding and removing items after
the VArray has been created.
A VArray is constructed with the specified component
type. For example:
VArray varray1 = new VArray(Object.class); VArray varray2 = new VArray(String.class); VArray varray3 = new VArray(int.class);The
VArray has many useful operations. For example:
VArray varray1 = new VArray(int.class);
varray1.append(1).append(2).append(3);
// { 1, 2, 3 }
VArray varray2 = (VArray)varray1.clone();
varray1.append(varray2);
// { 1, 2, 3, 1, 2, 3 }
varray1.insert(0, varray2);
// { 1, 2, 3, 1, 2, 3, 1, 2, 3 }
varray1.insert(varray1.length(), varray2);
// { 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3 }
varray1.insert(3, varray2);
// { 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3 }
varray1.remove(0, 3);
// { 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3 }
varray1.remove(3, 3);
// { 1, 2, 3, 1, 2, 3, 1, 2, 3 }
varray1.replace(0, 0, varray2);
// { 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3 }
varray1.replace(varray1.length(), varray1.length(), varray2);
// { 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3 }
varray1.replace(3, 12, varray2);
// { 1, 2, 3, 1, 2, 3, 1, 2, 3 }
varray1.sort();
// { 1, 1, 1, 2, 2, 2, 3, 3, 3 }
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected java.lang.Object |
array
The array buffer into which the components of the array are
stored.
|
protected boolean |
componentIsObject
True if the component type is not a primitive type.
|
protected int |
count
The number of valid components in the array.
|
protected static int |
DEFAULT_MAX_CAPACITY_INCREMENT
The default maximum amount by which the capacity of the
array is automatically incremented.
|
protected static int |
DEFAULT_STRING_MAX_CAPACITY_INCREMENT
The default maximum amount by which the capacity of the
array of
charis automatically incremented. |
protected int |
maxCapacityIncrement
The maximum amount by which the capacity of the array is
automatically incremented when its size becomes greater than
its capacity.
|
| コンストラクタと説明 |
|---|
VArray(java.lang.Class componentType)
Constructs an empty array with the specified component type.
|
VArray(java.lang.Class componentType,
int initialCapacity)
Constructs an empty array with the specified component type
and initial capacity.
|
VArray(java.lang.Class componentType,
int initialCapacity,
int maxCapacityIncrement)
Constructs an empty array with the specified component type,
initial capacity, and the maximum capacity increment size.
|
VArray(java.lang.Object array)
Constructs an array with the specified array buffer.
|
VArray(java.lang.Object array,
int maxCapacityIncrement)
Constructs an array with the specified array buffer and
the maximum capacity increment size.
|
VArray(java.lang.String string)
Constructs an array with the contents of the string.
|
VArray(java.lang.String string,
int maxCapacityIncrement)
Constructs an array with the contents of the string
and the maximum capacity increment size.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
VArray |
append(boolean b)
Appends the boolean value to this array.
|
VArray |
append(byte b)
Appends the byte value to this array.
|
VArray |
append(char c)
Appends the char value to this array.
|
VArray |
append(char[] carray)
Appends the characters of the array object to this array.
|
VArray |
append(char[] carray,
int begin,
int end)
Appends the characters of the array object to this array.
|
VArray |
append(double d)
Appends the double value to this array.
|
VArray |
append(float f)
Appends the float value to this array.
|
VArray |
append(int i)
Appends the int value to this array.
|
VArray |
append(long l)
Appends the long value to this array.
|
VArray |
append(java.lang.Object value)
Appends the object to this array.
|
VArray |
append(short s)
Appends the short value to this array.
|
VArray |
append(java.lang.String str)
Appends the characters of the
string to this array. |
VArray |
append(java.lang.String str,
int begin,
int end)
Appends the characters of the
string from the specified
begin index to the specified endIndex-1 index. |
VArray |
append(VArray varray)
Appends the components of the
VArray object to
this array. |
VArray |
append(VArray varray,
int begin,
int end)
Appends the components of the
VArray object to
this array. |
protected int |
capacity()
Returns the capacity of this array.
|
java.lang.Object |
clone()
Returns a clone of this array.
|
java.util.Enumeration |
elements()
Returns an enumeration of the components of this array.
|
protected void |
ensureCapacity(int minimumCapacity)
Increases the capacity of this array, if necessary, to ensure
that it can hold at least the number of components specified by
the minimum capacity argument.
|
boolean |
equals(java.lang.Object anObject)
Compares two Objects for equality.
|
java.lang.Object |
get(int index)
Returns the component at the specified index, as an object.
|
java.lang.Object |
getArray()
Returns the buffer of this array.
|
boolean |
getBoolean(int index)
Returns the component at the specified index, as a boolean.
|
byte |
getByte(int index)
Returns the component at the specified index, as a byte.
|
char |
getChar(int index)
Returns the component at the specified index, as a char.
|
java.lang.Class |
getComponentType()
Returns the component type of this array.
|
double |
getDouble(int index)
Returns the component at the specified index, as a double.
|
float |
getFloat(int index)
Returns the component at the specified index, as a float.
|
int |
getInt(int index)
Returns the component at the specified index, as an int.
|
int |
getLength()
Returns the length of this array, i.e., the number of components
in this array.
|
long |
getLong(int index)
Returns the component at the specified index, as a long.
|
short |
getShort(int index)
Returns the component at the specified index, as a short.
|
int |
getSize()
Returns the size of this array, i.e., the number of components
in this array.
|
java.lang.Object |
getTrimmedArray()
Returns an array object whoes length is trimmed to be this
array's current length.
|
int |
hashCode()
Returns a hashcode for this array.
|
int |
indexOf(boolean b)
Searches for the first occurence of the specified boolean value.
|
int |
indexOf(boolean b,
int fromIndex)
Searches for the first occurence of the specified boolean value,
beginning the search at
fromIndex. |
int |
indexOf(byte b)
Searches for the first occurence of the specified byte value.
|
int |
indexOf(byte b,
int fromIndex)
Searches for the first occurence of the specified byte value,
beginning the search at
fromIndex. |
int |
indexOf(char c)
Searches for the first occurence of the specified char value.
|
int |
indexOf(char c,
int fromIndex)
Searches for the first occurence of the specified char value,
beginning the search at
fromIndex. |
int |
indexOf(double d)
Searches for the first occurence of the specified double value.
|
int |
indexOf(double d,
int fromIndex)
Searches for the first occurence of the specified double value,
beginning the search at
fromIndex. |
int |
indexOf(float f)
Searches for the first occurence of the specified float value.
|
int |
indexOf(float f,
int fromIndex)
Searches for the first occurence of the specified float value,
beginning the search at
fromIndex. |
int |
indexOf(int iv)
Searches for the first occurence of the specified int value.
|
int |
indexOf(int iv,
int fromIndex)
Searches for the first occurence of the specified int value,
beginning the search at
fromIndex. |
int |
indexOf(long l)
Searches for the first occurence of the specified long value.
|
int |
indexOf(long l,
int fromIndex)
Searches for the first occurence of the specified long value,
beginning the search at
fromIndex. |
int |
indexOf(java.lang.Object value)
Searches for the first occurence of the specified object, testing
for equality using the
equals method. |
int |
indexOf(java.lang.Object value,
int fromIndex)
Searches for the first occurence of the specified object, beginning
the search at
fromIndex, and testing for equality
using the equals method. |
int |
indexOf(short s)
Searches for the first occurence of the specified short value.
|
int |
indexOf(short s,
int fromIndex)
Searches for the first occurence of the specified short value,
beginning the search at
fromIndex. |
VArray |
insert(int offset,
VArray varray)
Inserts the components of the
VArray object to
this array from the specified offset. |
VArray |
insert(int offset,
VArray varray,
int begin,
int end)
Inserts the components of the
VArray object to
this array from the specified offset. |
protected VArray |
insertSpace(int offset,
int size)
Inserts spaces to this array from the specified
offset. |
boolean |
isEmpty()
Tests if this array has no components.
|
protected boolean |
isObjectType(java.lang.Class componentType)
Returns true if the specified component type is not a primitive type.
|
int |
lastIndexOf(boolean b)
Searches backwards for the last occurence of the specified boolean
value.
|
int |
lastIndexOf(boolean b,
int fromIndex)
Searches backwards for the last occurence of the specified boolean
value, beginning the search at
fromIndex. |
int |
lastIndexOf(byte b)
Searches backwards for the last occurence of the specified byte
value.
|
int |
lastIndexOf(byte b,
int fromIndex)
Searches backwards for the last occurence of the specified byte
value, beginning the search at
fromIndex. |
int |
lastIndexOf(char c)
Searches backwards for the last occurence of the specified char
value.
|
int |
lastIndexOf(char c,
int fromIndex)
Searches backwards for the last occurence of the specified char
value, beginning the search at
fromIndex. |
int |
lastIndexOf(double d)
Searches backwards for the last occurence of the specified double
value.
|
int |
lastIndexOf(double d,
int fromIndex)
Searches backwards for the last occurence of the specified double
value, beginning the search at
fromIndex. |
int |
lastIndexOf(float f)
Searches backwards for the last occurence of the specified float
value.
|
int |
lastIndexOf(float f,
int fromIndex)
Searches backwards for the last occurence of the specified float
value, beginning the search at
fromIndex. |
int |
lastIndexOf(int iv)
Searches backwards for the last occurence of the specified int
value.
|
int |
lastIndexOf(int iv,
int fromIndex)
Searches backwards for the last occurence of the specified int
value, beginning the search at
fromIndex. |
int |
lastIndexOf(long l)
Searches backwards for the last occurence of the specified long
value.
|
int |
lastIndexOf(long l,
int fromIndex)
Searches backwards for the last occurence of the specified long
value, beginning the search at
fromIndex. |
int |
lastIndexOf(java.lang.Object value)
Searches backwards for the last occurence of the specified object,
testing for equality using the
equals method. |
int |
lastIndexOf(java.lang.Object value,
int fromIndex)
Searches backwards for the last occurence of the specified object,
beginning the search at
fromIndex, and testing for
equality using the equals method. |
int |
lastIndexOf(short s)
Searches backwards for the last occurence of the specified short
value.
|
int |
lastIndexOf(short s,
int fromIndex)
Searches backwards for the last occurence of the specified short
value, beginning the search at
fromIndex. |
int |
length()
Returns the length of this array, i.e., the number of components
in this array.
|
protected java.lang.Object |
newArray(int length)
Returns the new array whose component type equals to the component
type of this array.
|
void |
remove(int offset,
int size)
Removes the components in this array from the specified
offset. |
void |
removeAll()
Removes all components from this array and sets its length to zero.
|
VArray |
replace(int begin,
int end,
VArray varray)
Replaces the components of this array with the components of the
VArray object. |
VArray |
replace(int begin,
int end,
VArray varray,
int rBegin,
int rEnd)
Replaces the components of this array with the components of the
VArray object. |
void |
set(int index,
java.lang.Object value)
Sets the component at the specified index of this array to be
the specified object.
|
void |
setBoolean(int index,
boolean b)
Sets the component at the specified index of this array to be
the specified boolean value.
|
void |
setByte(int index,
byte b)
Sets the component at the specified index of this array to be
the specified byte value.
|
void |
setChar(int index,
char c)
Sets the component at the specified index of this array to be
the specified char value.
|
void |
setDouble(int index,
double d)
Sets the component at the specified index of this array to be
the specified double value.
|
void |
setFloat(int index,
float f)
Sets the component at the specified index of this array to be
the specified float value.
|
void |
setInt(int index,
int i)
Sets the component at the specified index of this array to be
the specified int value.
|
void |
setLength(int newLength)
Sets the length of this array.
|
void |
setLong(int index,
long l)
Sets the component at the specified index of this array to be
the specified long value.
|
void |
setShort(int index,
short s)
Sets the component at the specified index of this array to be
the specified short value.
|
protected void |
shrinkCapacity()
Shrinks the capacity of this array, if necessary.
|
int |
size()
Returns the size of this array, i.e., the number of components
in this array.
|
void |
sort()
Sorts the components of this array.
|
void |
sort(Comparer comparer)
Sorts the components of this array with the specified comparer.
|
void |
sort(int i,
int j,
Comparer comparer)
Sorts the components of this array with the specified comparer.
|
VArray |
subarray(int beginIndex)
Returns a new array that is a subarray of this array.
|
VArray |
subarray(int beginIndex,
int endIndex)
Returns a new array that is a subarray of this array.
|
java.lang.String |
toString()
Returns a string representation of this array.
|
void |
trim()
Trims the capacity of this array to be the array's current length.
|
protected java.lang.Object array
protected int count
protected int maxCapacityIncrement
maxCapacityIncrement is not
a positive value or the capacity is less than
maxCapacityIncrement, the capacity of the array
is doubled each time it needs to grow.protected boolean componentIsObject
protected static final int DEFAULT_MAX_CAPACITY_INCREMENT
protected static final int DEFAULT_STRING_MAX_CAPACITY_INCREMENT
charis automatically incremented.public VArray(java.lang.Class componentType)
componentType - the component type of the array.public VArray(java.lang.Class componentType,
int initialCapacity)
componentType - the component type of the array.initialCapacity - the initial capacity of the array.public VArray(java.lang.Class componentType,
int initialCapacity,
int maxCapacityIncrement)
componentType - the component type of the array.initialCapacity - the initial capacity of the array.maxCapacityIncrement - the maximum amount by which the capacity
is increased when the array overflows.public VArray(java.lang.Object array)
array - the buffer of the array.public VArray(java.lang.Object array,
int maxCapacityIncrement)
array - the buffer of the array.maxCapacityIncrement - the maximum amount by which the capacity
is increased when the array overflows.public VArray(java.lang.String string)
string - a string.public VArray(java.lang.String string,
int maxCapacityIncrement)
string - a string.maxCapacityIncrement - the maximum amount by which the capacity
is increased when the array overflows.public final java.lang.Object getArray()
public final java.lang.Object getTrimmedArray()
public final java.lang.Class getComponentType()
public final int size()
public final int getSize()
public final int length()
public final int getLength()
public final boolean isEmpty()
true if this array has no components;
false otherwise.public int hashCode()
hashCode クラス内 java.lang.Objectpublic boolean equals(java.lang.Object anObject)
equals クラス内 java.lang.ObjectanObject - the reference object with which to compare.true if this array is the same as the anObject
argument; false otherwise.public final java.util.Enumeration elements()
public final java.lang.Object get(int index)
index - an index into this array.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to the return type.Array.get(java.lang.Object, int)public final boolean getBoolean(int index)
index - an index into this array.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to the return type.Array.getBoolean(java.lang.Object, int)public final byte getByte(int index)
index - an index into this array.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to the return type.Array.getByte(java.lang.Object, int)public final char getChar(int index)
index - an index into this array.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to the return type.Array.getChar(java.lang.Object, int)public final short getShort(int index)
index - an index into this array.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to the return type.Array.getShort(java.lang.Object, int)public final int getInt(int index)
index - an index into this array.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to the return type.Array.getInt(java.lang.Object, int)public final long getLong(int index)
index - an index into this array.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to the return type.Array.getLong(java.lang.Object, int)public final float getFloat(int index)
index - an index into this array.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to the return type.Array.getFloat(java.lang.Object, int)public final double getDouble(int index)
index - an index into this array.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to the return type.Array.getDouble(java.lang.Object, int)public final void set(int index,
java.lang.Object value)
index - the specified index.value - what the component is to be set to.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to this array's component type.Array.set(java.lang.Object, int, java.lang.Object)public final void setBoolean(int index,
boolean b)
index - the specified index.b - what the component is to be set to.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to this array's component type.Array.setBoolean(java.lang.Object, int, boolean)public final void setByte(int index,
byte b)
index - the specified index.b - what the component is to be set to.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to this array's component type.Array.setByte(java.lang.Object, int, byte)public final void setChar(int index,
char c)
index - the specified index.c - what the component is to be set to.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to this array's component type.Array.setChar(java.lang.Object, int, char)public final void setShort(int index,
short s)
index - the specified index.s - what the component is to be set to.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to this array's component type.Array.setShort(java.lang.Object, int, short)public final void setInt(int index,
int i)
index - the specified index.i - what the component is to be set to.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to this array's component type.Array.setInt(java.lang.Object, int, int)public final void setLong(int index,
long l)
index - the specified index.l - what the component is to be set to.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to this array's component type.Array.setLong(java.lang.Object, int, long)public final void setFloat(int index,
float f)
index - the specified index.f - what the component is to be set to.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to this array's component type.Array.setFloat(java.lang.Object, int, float)public final void setDouble(int index,
double d)
index - the specified index.d - what the component is to be set to.java.lang.ArrayIndexOutOfBoundsException - if an invalid index was
given.java.lang.IllegalArgumentException - if the indexed element cannot
be converted to this array's component type.Array.setDouble(java.lang.Object, int, double)public final void setLength(int newLength)
newLength - the new length of this array.public final void trim()
public final int indexOf(java.lang.Object value)
equals method.value - the specified object.-1 if the object is
not found.Object.equals(java.lang.Object)public final int indexOf(java.lang.Object value,
int fromIndex)
fromIndex, and testing for equality
using the equals method.value - the specified object.fromIndex - the index to start searching from.-1 if the object is
not found.Object.equals(java.lang.Object)public final int lastIndexOf(java.lang.Object value)
equals method.value - the specified object.-1 if the object is
not found.Object.equals(java.lang.Object)public final int lastIndexOf(java.lang.Object value,
int fromIndex)
fromIndex, and testing for
equality using the equals method.value - the specified object.fromIndex - the index to start searching from.-1 if the object is
not found.Object.equals(java.lang.Object)public final int indexOf(boolean b)
b - the specified boolean value.-1 if the value is
not found.public final int indexOf(boolean b,
int fromIndex)
fromIndex.b - the specified boolean value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int lastIndexOf(boolean b)
b - the specified boolean value.-1 if the value is
not found.public final int lastIndexOf(boolean b,
int fromIndex)
fromIndex.b - the specified boolean value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int indexOf(byte b)
b - the specified byte value.-1 if the value is
not found.public final int indexOf(byte b,
int fromIndex)
fromIndex.b - the specified byte value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int lastIndexOf(byte b)
b - the specified byte value.-1 if the value is
not found.public final int lastIndexOf(byte b,
int fromIndex)
fromIndex.b - the specified byte value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int indexOf(char c)
c - the specified char value.-1 if the value is
not found.public final int indexOf(char c,
int fromIndex)
fromIndex.c - the specified char value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int lastIndexOf(char c)
c - the specified char value.-1 if the value is
not found.public final int lastIndexOf(char c,
int fromIndex)
fromIndex.c - the specified char value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int indexOf(short s)
s - the specified short value.-1 if the value is
not found.public final int indexOf(short s,
int fromIndex)
fromIndex.s - the specified short value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int lastIndexOf(short s)
s - the specified short value.-1 if the value is
not found.public final int lastIndexOf(short s,
int fromIndex)
fromIndex.s - the specified short value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int indexOf(int iv)
iv - the specified int value.-1 if the value is
not found.public final int indexOf(int iv,
int fromIndex)
fromIndex.iv - the specified int value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int lastIndexOf(int iv)
iv - the specified int value.-1 if the value is
not found.public final int lastIndexOf(int iv,
int fromIndex)
fromIndex.iv - the specified int value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int indexOf(long l)
l - the specified long value.-1 if the value is
not found.public final int indexOf(long l,
int fromIndex)
fromIndex.l - the specified long value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int lastIndexOf(long l)
l - the specified long value.-1 if the value is
not found.public final int lastIndexOf(long l,
int fromIndex)
fromIndex.l - the specified long value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int indexOf(float f)
f - the specified float value.-1 if the value is
not found.public final int indexOf(float f,
int fromIndex)
fromIndex.f - the specified float value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int lastIndexOf(float f)
f - the specified float value.-1 if the value is
not found.public final int lastIndexOf(float f,
int fromIndex)
fromIndex.f - the specified float value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int indexOf(double d)
d - the specified double value.-1 if the value is
not found.public final int indexOf(double d,
int fromIndex)
fromIndex.d - the specified double value.fromIndex - the index to start searching from.-1 if the value is
not found.public final int lastIndexOf(double d)
d - the specified double value.-1 if the value is
not found.public final int lastIndexOf(double d,
int fromIndex)
fromIndex.d - the specified double value.fromIndex - the index to start searching from.-1 if the value is
not found.public final void removeAll()
public final void remove(int offset,
int size)
offset. The number of the components to be removed is
specified by the size. Each component in this array
with an index greater or equal to offset+size is
shifted downward.offset - the start index of the components to be removed.size - the number of the components to be removed.java.lang.ArrayIndexOutOfBoundsException - if the offset
or the size were invalid.public final VArray subarray(int beginIndex)
beginIndex - the beginning index, inclusive.java.lang.ArrayIndexOutOfBoundsException - if the
beginIndex is out of range.public final VArray subarray(int beginIndex, int endIndex)
beginIndex and extends to the
component at index endIndex-1.beginIndex - the beginning index, inclusive.endIndex - the ending index, exclusive.java.lang.ArrayIndexOutOfBoundsException - if the beginIndex
or the endIndex is out of range.public final VArray append(java.lang.Object value)
value - an object.java.lang.IllegalArgumentException - if the value cannot
be converted to this array's component type.public final VArray append(boolean b)
b - a boolean value.java.lang.IllegalArgumentException - if the value cannot
be converted to this array's component type.public final VArray append(byte b)
b - a byte value.java.lang.IllegalArgumentException - if the value cannot
be converted to this array's component type.public final VArray append(char c)
c - a char value.java.lang.IllegalArgumentException - if the value cannot
be converted to this array's component type.public final VArray append(short s)
s - a short value.java.lang.IllegalArgumentException - if the value cannot
be converted to this array's component type.public final VArray append(int i)
i - an int value.java.lang.IllegalArgumentException - if the value cannot
be converted to this array's component type.public final VArray append(long l)
l - a long value.java.lang.IllegalArgumentException - if the value cannot
be converted to this array's component type.public final VArray append(float f)
f - a float value.java.lang.IllegalArgumentException - if the value cannot
be converted to this array's component type.public final VArray append(double d)
d - a double value.java.lang.IllegalArgumentException - if the value cannot
be converted to this array's component type.public final VArray append(java.lang.String str)
string to this array.str - a string.java.lang.IllegalArgumentException - if the character value cannot
be converted to this array's component type.public final VArray append(java.lang.String str, int begin, int end)
string from the specified
begin index to the specified endIndex-1 index.str - a string.begin - the beginning index of the string, inclusive.end - the ending index of the string, exclusive.java.lang.IllegalArgumentException - if the character value cannot
be converted to this array's component type.public final VArray append(char[] carray)
carray - an array of characters.java.lang.IllegalArgumentException - if the character value cannot
be converted to this array's component type.public final VArray append(char[] carray, int begin, int end)
carray - an array of characters.begin - the beginning index of the character array, inclusive.end - the ending index of the character array, exclusive.java.lang.IllegalArgumentException - if the character value cannot
be converted to this array's component type.java.lang.ArrayIndexOutOfBoundsException - if the begin
or the end is out of range.public final VArray append(VArray varray)
VArray object to
this array.varray - an VArray object.java.lang.IllegalArgumentException - if the component type of
the argument cannot be converted to this array's
component type.public final VArray append(VArray varray, int begin, int end)
VArray object to
this array.varray - an VArray object.begin - the beginning index of the array, inclusive.end - the ending index of the array, exclusive.java.lang.IllegalArgumentException - if the component type of
the argument cannot be converted to this array's
component type.java.lang.ArrayIndexOutOfBoundsException - if the begin
or the end is out of range.public final VArray insert(int offset, VArray varray)
VArray object to
this array from the specified offset.offset - the start index of the components to be inserted.varray - an VArray object.java.lang.IllegalArgumentException - if the component type of
the argument cannot be converted to this array's
component type.public final VArray insert(int offset, VArray varray, int begin, int end)
VArray object to
this array from the specified offset.offset - the start index of the components to be inserted.varray - an VArray object.begin - the beginning index of the array, inclusive.end - the ending index of the array, exclusive.java.lang.IllegalArgumentException - if the component type of
the argument cannot be converted to this array's
component type.java.lang.ArrayIndexOutOfBoundsException - if the begin
or the end is out of range.protected final VArray insertSpace(int offset, int size)
offset.offset - the start index of spaces to be inserted.size - the number of spaces to be inserted.java.lang.ArrayIndexOutOfBoundsException - if the offset
or the size were invalid.public final VArray replace(int begin, int end, VArray varray)
VArray object.begin - the beginning index to replace, inclusive.end - the ending index to replace, exclusive.varray - a replacement VArray object.java.lang.IllegalArgumentException - if the component type of
the argument cannot be converted to this array's
component type.public final VArray replace(int begin, int end, VArray varray, int rBegin, int rEnd)
VArray object.begin - the beginning index to replace, inclusive.end - the ending index to replace, exclusive.varray - a replacement VArray object.rBegin - the beginning index of the replacement, inclusive.rEnd - the ending index of the replacement, exclusive.java.lang.IllegalArgumentException - if the component type of
the argument cannot be converted to this array's
component type.java.lang.ArrayIndexOutOfBoundsException - if the begin,
the end, the rBegin, or
the rEnd is out of range.public final void sort()
public final void sort(Comparer comparer)
comparer - a comparer used by sorting.Comparer,
Sorter.quicksort(java.lang.Object, int, int)public final void sort(int i,
int j,
Comparer comparer)
i - the beginning index to sort, inclusive.j - the ending index to sort, inclusive.comparer - a comparer used by sorting.Comparer,
Sorter.quicksort(java.lang.Object, int, int)public java.lang.Object clone()
clone クラス内 java.lang.Objectpublic java.lang.String toString()
toString クラス内 java.lang.Objectprotected final int capacity()
protected final void ensureCapacity(int minimumCapacity)
protected final void shrinkCapacity()
protected final java.lang.Object newArray(int length)
protected boolean isObjectType(java.lang.Class componentType)