T - Specifies the type of elements in the sequence.
Remarks: The container is allocated in memory and the predefined maximum size can be at most 2,147,483,647 (Integer.MAX_VALUE) elements of type T.
public class Vector<T> extends java.lang.Object implements IRanSequence32<T,Vector.Iterator>, IInsertSequence<T,Vector.Iterator>
| Modifier and Type | Class and Description |
|---|---|
class |
Vector.Iterator
Defines a random iterator that provides constant-time
methods for moving forward and backward in arbitrary-sized
steps and for comparing two iterators.
|
class |
Vector.ReverseIterator
Defines a random-access iterator that enables
backward traversal of a range.
|
class |
Vector.UIterator
Defines a random-access unchecked iterator that provides
constant-time methods for moving forward and backward in
arbitrary-sized steps and for comparing two iterators.
|
class |
Vector.UReverseIterator
Defines a reverse iterator that enables backward
traversal of a range.
|
| Constructor and Description |
|---|
Vector(java.lang.Class<T> type,
int maxSize)
Creates an empty sequence of the specified type.
|
Vector(int n,
T item,
int maxSize)
Creates a sequence of the specified type and
initializes it with the specified element.
|
Vector(Vector<T> x)
Constructs a new instance of the Vector from
another sequence.
|
| Modifier and Type | Method and Description |
|---|---|
void |
Add(int n,
T item)
Appends to the back of the sequence n copies of
the specified value.
|
void |
Add(T item)
Adds an element to the end of the sequence.
|
<TInpIter extends IInpIter<T,TInpIter>> |
Add(TInpIter first,
TInpIter last)
Appends the specified elements to the back of the sequence.
|
void |
Assign(int n,
T item)
Erases all the elements and replaces them with
n copies of item.
|
void |
Assign(T item)
Erases all the elements and replaces them with
the specified value.
|
<TInpIter extends IInpIter<T,TInpIter>> |
Assign(TInpIter first,
TInpIter last)
Erases a sequence and copies the specified elements
to the empty sequence.
|
T |
Back()
Gets the last element of the sequence.
|
Vector.Iterator |
Begin()
Returns a random-access iterator to the first element
in the container.
|
void |
Clear()
Erases all the elements of the sequence.
|
T[] |
Container()
Gets the underlying container of the current instance.
|
boolean |
Contains(IPredicate<T> pred)
Determines whether an element is in the sequence.
|
boolean |
Contains(T item)
Determines whether an element is in the sequence.
|
void |
CopyTo(T[] array,
int arrayIndex)
Copies the sequence to a compatible one-dimensional array,
starting at the specified index of the target array.
|
boolean |
Empty()
Tests if the sequence is empty (the size of
the sequence is zero).
|
Vector.Iterator |
End()
Returns a random-access iterator to the position that is
one past the final element in the container.
|
boolean |
equals(java.lang.Object obj)
Tests whether this instance is equal to a specified object.
|
boolean |
equals(Vector<T> x)
Tests whether this instance is equal to a specified
Vector object.
|
int |
Erase(int first,
int last)
Removes a range of elements in a sequence from specified
positions.
|
Vector.Iterator |
Erase(Vector.Iterator pos)
Removes an element in a sequence from a specified position.
|
Vector.Iterator |
Erase(Vector.Iterator first,
Vector.Iterator last)
Removes a range of elements in a sequence from specified
positions.
|
Vector.UIterator |
Erase(Vector.UIterator pos)
Removes an element in a sequence from a specified position.
|
Vector.UIterator |
Erase(Vector.UIterator first,
Vector.UIterator last)
Removes a range of elements in a sequence from specified
positions.
|
void |
EraseBegin(Vector.Iterator pos)
Removes the elements in a sequence from the beginning of the container
to a specified position.
|
void |
EraseBegin(Vector.UIterator pos)
Removes the elements in a sequence from the beginning of the container
to a specified position.
|
void |
EraseEnd(Vector.Iterator pos)
Removes the elements in a sequence from a specified
position to the end of the container.
|
void |
EraseEnd(Vector.UIterator pos)
Removes the elements in a sequence from a specified
position to the end of the container.
|
int |
First()
Gets the position of the first element in the sequence.
|
T |
Front()
Gets the first element of the sequence.
|
int |
hashCode()
Returns the hash code for this instance.
|
int |
IndexOf(IPredicate<T> pred)
Searches for the specified object and returns the zero-based index
of the first occurrence within the entire sequence.
|
int |
IndexOf(T item)
Searches for the specified object and returns the zero-based index
of the first occurrence within the entire sequence.
|
void |
Insert(int index,
T item)
Inserts an element into the sequence before the element
at a specified position.
|
void |
Insert(Vector.Iterator pos,
int n,
T item)
Inserts a number of elements into the sequence before
the element at a specified position.
|
Vector.Iterator |
Insert(Vector.Iterator pos,
T item)
Inserts an element into the sequence before the element
at a specified position.
|
<TInpIter extends IInpIter<T,TInpIter>> |
Insert(Vector.Iterator pos,
TInpIter first,
TInpIter last)
Inserts a range of elements into the sequence before
the element at a specified position..
|
void |
Insert(Vector.UIterator pos,
int n,
T item)
Inserts a number of elements into the sequence before
the element at a specified position.
|
Vector.UIterator |
Insert(Vector.UIterator pos,
T item)
Inserts an element into the sequence before the element
at a specified position.
|
<TInpIter extends IInpIter<T,TInpIter>> |
Insert(Vector.UIterator pos,
TInpIter first,
TInpIter last)
Inserts a range of elements into the sequence before
the element at a specified position..
|
T |
Item(int index)
Gets a sequence element at a specified position.
|
int |
Last()
Gets the position that is one past the final element in the sequence.
|
void |
Load(java.lang.String fileName)
Erases all the elements and replaces them with
the elements stored in the specified file.
|
int |
MaxSize()
Returns the maximum possible length of the sequence.
|
void |
PAdd(int n,
T item)
Parallel Add: Appends to the back of the sequence n copies of
the specified value.
|
<TInpIter extends IInpIter<T,TInpIter>> |
PAdd(TInpIter first,
TInpIter last)
Parallel Add: Appends the specified elements to the back of the sequence.
|
void |
PAssign(int n,
T item)
Parallel Assign: Erases all the elements and replaces them with
n copies of item.
|
void |
PAssign(T item)
Parallel Assign: Erases all the elements and replaces them with
the specified value.
|
<TInpIter extends IInpIter<T,TInpIter>> |
PAssign(TInpIter first,
TInpIter last)
Parallel Assign: Erases a sequence and copies the specified elements
to the empty sequence.
|
boolean |
PContains(IPredicate<T> pred)
Parallel Contains: Determines whether an element is in the sequence.
|
boolean |
PContains(T item)
Parallel Contains: Determines whether an element is in the sequence.
|
void |
PCopyTo(T[] array,
int arrayIndex)
Parallel CopyTo: Copies the sequence to a compatible one-dimensional array,
starting at the specified index of the target array.
|
boolean |
PEquals(Vector<T> x)
Parallel Equals: Tests whether this instance is equal to a specified
Vector object.
|
Vector.Iterator |
PErase(Vector.Iterator pos)
Parallel Erase: Removes an element in a sequence from a specified position.
|
Vector.UIterator |
PErase(Vector.UIterator pos)
Parallel Erase: Removes an element in a sequence from a specified position.
|
int |
PIndexOf(IPredicate<T> pred)
Parallel IndexOf: Searches for the specified object and returns the zero-based index
of the first occurrence within the entire sequence.
|
int |
PIndexOf(T item)
Parallel IndexOf: Searches for the specified object and returns the zero-based index
of the first occurrence within the entire sequence.
|
void |
PInsert(int index,
T item)
Parallel Insert: Inserts an element into the sequence before the element
at a specified position.
|
Vector.Iterator |
PInsert(Vector.Iterator pos,
T item)
Parallel Insert: Inserts an element into the sequence before the element
at a specified position.
|
Vector.UIterator |
PInsert(Vector.UIterator pos,
T item)
Parallel Insert: Inserts an element into the sequence before the element
at a specified position.
|
void |
PopBack()
Deletes the element at the end of the sequence.
|
void |
PopFront()
Deletes the element at the beginning of the sequence.
|
boolean |
PRemove(IPredicate<T> pred)
Parallel Remove: Removes the first occurrence of a specific object from
the sequence.
|
boolean |
PRemove(T item)
Parallel Remove: Removes the first occurrence of a specific object from
the sequence.
|
void |
PRemoveAt(int index)
Parallel RemoveAt: Removes the element at the specified index of the sequence.
|
void |
PushBack(T item)
Adds an element to the end of the sequence.
|
void |
PushFront(T item)
Adds an element to the beginning of the sequence.
|
void |
Read(java.io.DataInput reader)
Loads the entire container from the specified reader.
|
boolean |
Remove(IPredicate<T> pred)
Removes the first occurrence of a specific object from
the sequence.
|
boolean |
Remove(T item)
Removes the first occurrence of a specific object from
the sequence.
|
void |
RemoveAt(int index)
Removes the element at the specified index of the sequence.
|
void |
Resize(int newSize)
Specifies a new size for a sequence.
|
void |
Resize(int newSize,
T item)
Specifies a new size for a sequence.
|
Vector.ReverseIterator |
ReverseBegin()
Returns a random-access reverse iterator to the first
element in the reversed container.
|
Vector.ReverseIterator |
ReverseEnd()
Returns a random-access reverse iterator to the position
that is one past the final element in the reversed container.
|
void |
Save(java.lang.String fileName)
Saves the container elements to the specified file.
|
void |
SetBack(T value)
Sets the last element of the sequence.
|
void |
SetFront(T value)
Sets the first element of the sequence.
|
void |
SetItem(int index,
T value)
Sets a sequence element at a specified position.
|
int |
Size()
Returns the number of elements in the sequence.
|
void |
Swap(Vector<T> x)
Exchanges the elements of two vectors.
|
void |
SwapRef(Vector<T> x)
Swaps the member references of two sequences.
|
void |
ToStream(java.io.PrintStream sw)
Writes the elements of the current container to the
specified stream.
|
void |
ToStream(Vector.Iterator first,
Vector.Iterator last,
java.io.PrintStream sw)
Writes the elements of the current container from the
specified range to the specified stream.
|
java.lang.String |
toString()
Returns a string that represents the content of the current container.
|
java.lang.String |
ToString(Vector.Iterator first,
Vector.Iterator last)
Returns a string that represents the elements of the
current container from the specified range.
|
java.lang.Class<T> |
Type()
Returns the type of the elements in the container.
|
Vector.UIterator |
UBegin()
Returns a random-access unchecked iterator to the first element
in the container.
|
Vector.UIterator |
UEnd()
Returns a random-access unchecked iterator to the position that is
one past the final element in the container.
|
Vector.UReverseIterator |
UReverseBegin()
Returns a random-access unchecked reverse iterator to the first
element in the reversed container.
|
Vector.UReverseIterator |
UReverseEnd()
Returns a random-access unchecked reverse iterator to the position
that is one past the final element in the reversed container.
|
void |
Write(java.io.DataOutput writer)
Stores the entire container to the specified writer.
|
public Vector(java.lang.Class<T> type, int maxSize)
type - The specified data type.maxSize - The maximum size of the sequence.public Vector(int n,
T item,
int maxSize)
n - The number of copies of an element being
inserted into the sequence.item - The value of the sequence's elements.maxSize - The maximum size of the sequence.public java.lang.Class<T> Type()
Type in interface IContainer32<T>public void Load(java.lang.String fileName)
fileName - The specified file.java.lang.RuntimeException - If an I/O error occurs.public void Save(java.lang.String fileName)
fileName - The specified file.java.lang.RuntimeException - If an I/O error occurs.public void Read(java.io.DataInput reader)
reader - The specified reader.java.lang.RuntimeException - If an I/O error occurs.
Remarks: The container must be stored previously to the specified stream using the Write method.
public void Write(java.io.DataOutput writer)
writer - The specified writer.java.lang.RuntimeException - If an I/O error occurs.
Remarks: The container must be read from the specified stream using the Read method.
public void Assign(T item)
item - The value of the element being inserted into
the sequence.public void PAssign(T item)
item - The value of the element being inserted into
the sequence.public void Assign(int n,
T item)
n - The number of copies of an element being
inserted into the sequence.item - The value of the element being inserted into
the sequence.java.lang.RuntimeException - When the
number of copies of an element being inserted into the sequence is
greater than the maximum size of the sequence.public void PAssign(int n,
T item)
n - The number of copies of an element being
inserted into the sequence.item - The value of the element being inserted into
the sequence.java.lang.RuntimeException - When the
number of copies of an element being inserted into the sequence is
greater than the maximum size of the sequence.public <TInpIter extends IInpIter<T,TInpIter>> void Assign(TInpIter first, TInpIter last)
TInpIter - The type of iterators in the specified range.first - Position of the first element in the range
of elements to be copied.last - Position that is one past the final element
in the range of elements to be copied.java.lang.RuntimeException - When the iterator range is invalid and the
number of elements being inserted into the sequence exceeds the maximum
size of the sequence.public <TInpIter extends IInpIter<T,TInpIter>> void PAssign(TInpIter first, TInpIter last)
TInpIter - The type of iterators in the specified range.first - Position of the first element in the range
of elements to be copied.last - Position that is one past the final element
in the range of elements to be copied.java.lang.RuntimeException - When the iterator range is invalid and the
number of elements being inserted into the sequence exceeds the maximum
size of the sequence.public void Add(int n,
T item)
n - The number of copies of an element being
appended to the sequence.item - The value of the element being appended to
the sequence.java.lang.RuntimeException - When the
number of copies of an element being appended to the sequence
exceeds the maximum size of the sequence.public void PAdd(int n,
T item)
n - The number of copies of an element being
appended to the sequence.item - The value of the element being appended to
the sequence.java.lang.RuntimeException - When the
number of copies of an element being appended to the sequence
exceeds the maximum size of the sequence.public <TInpIter extends IInpIter<T,TInpIter>> void Add(TInpIter first, TInpIter last)
TInpIter - The type of iterators in the specified range.first - Position of the first element in the range
of elements to be copied.last - Position that is one past the final element
in the range of elements to be copied.java.lang.RuntimeException - When the iterator range is invalid and the
number of elements being appended to the sequence exceeds the maximum
size of the sequence.public <TInpIter extends IInpIter<T,TInpIter>> void PAdd(TInpIter first, TInpIter last)
TInpIter - The type of iterators in the specified range.first - Position of the first element in the range
of elements to be copied.last - Position that is one past the final element
in the range of elements to be copied.java.lang.RuntimeException - When the iterator range is invalid and the
number of elements being appended to the sequence exceeds the maximum
size of the sequence.public int Size()
Size in interface IContainer32<T>public int MaxSize()
MaxSize in interface IContainer32<T>public boolean Empty()
public T Item(int index)
Item in interface IRanSequence32<T,Vector.Iterator>index - The zero-based index of the element to get or set.java.lang.RuntimeException - When the
specified index is out of [0, Size - 1] range.public void SetItem(int index,
T value)
SetItem in interface IRanSequence32<T,Vector.Iterator>index - The zero-based index of the element to get or set.value - The specified value to be set.java.lang.RuntimeException - When the specified index is out of
[0, Size - 1] range.public boolean Contains(T item)
item - The object to locate in the sequence.public boolean PContains(T item)
item - The object to locate in the sequence.public boolean Contains(IPredicate<T> pred)
pred - A user-defined predicate function that defines
the condition to be satisfied by the element being searched for.public boolean PContains(IPredicate<T> pred)
pred - A user-defined predicate function that defines
the condition to be satisfied by the element being searched for.public int IndexOf(T item)
item - The object to locate in the sequence.public int PIndexOf(T item)
item - The object to locate in the sequence.public int IndexOf(IPredicate<T> pred)
pred - A user-defined predicate function that defines
the condition to be satisfied by the element being searched for.public int PIndexOf(IPredicate<T> pred)
pred - A user-defined predicate function that defines
the condition to be satisfied by the element being searched for.public void Add(T item)
item - The item to be added to the end of the sequence.java.lang.RuntimeException - When the container's
size is equal to the maximum size.public void Insert(int index,
T item)
index - The position in the sequence where the element
is inserted that must be inside of the [0, Size) range.item - The value of the element being inserted
into the sequence.
Remarks: The insertion operation can be expensive.
java.lang.RuntimeException - When the the index is outside of the
[0, Size) range or the container's size is equal to
the maximum size of the storage.public void PInsert(int index,
T item)
index - The position in the sequence where the element
is inserted that must be inside of the [0, Size) range.item - The value of the element being inserted
into the sequence.
Remarks: The insertion operation can be expensive.
java.lang.RuntimeException - When the
the index is outside of the [0, Size) range or the container's
size is equal to the maximum size of the storage.public boolean Remove(T item)
item - The object to remove from the sequence.public boolean PRemove(T item)
item - The object to remove from the sequence.public boolean Remove(IPredicate<T> pred)
pred - A user-defined predicate function that defines
the condition to be satisfied by the element being removed.public boolean PRemove(IPredicate<T> pred)
pred - A user-defined predicate function that defines
the condition to be satisfied by the element being removed.public void RemoveAt(int index)
index - The zero-based index of the element to remove.java.lang.RuntimeException - When
the index is outside of the [0, Size - 1] range.
Remarks: This method is an O(n) operation, where n is Min(index, Count - index).
public void PRemoveAt(int index)
index - The zero-based index of the element to remove.java.lang.RuntimeException - When
the index is outside of the [0, Size - 1] range.
Remarks: This method is an O(n) operation, where n is Min(index, Count - index).
public void Clear()
Clear in interface IContainer32<T>public void CopyTo(T[] array, int arrayIndex)
array - The one-dimensional array that is the
destination of the elements copied from sequence.
The array must have zero-based indexing.arrayIndex - The zero-based index in array at
which copying begins.public void PCopyTo(T[] array, int arrayIndex)
array - The one-dimensional array that is the
destination of the elements copied from sequence.
The array must have zero-based indexing.arrayIndex - The zero-based index in array at
which copying begins.public Vector.Iterator Begin()
Begin in interface IFwdContainer32<T,Vector.Iterator>public Vector.Iterator End()
End in interface IFwdContainer32<T,Vector.Iterator>public Vector.UIterator UBegin()
public Vector.UIterator UEnd()
public Vector.ReverseIterator ReverseBegin()
public Vector.ReverseIterator ReverseEnd()
public Vector.UReverseIterator UReverseBegin()
public Vector.UReverseIterator UReverseEnd()
public T[] Container()
public int First()
public int Last()
public T Front()
Remarks: The container must contain at least one element.
Front in interface IFrontSequence<T>java.lang.RuntimeException - When the
container is empty.public void SetFront(T value)
SetFront in interface IFrontSequence<T>value - The value to be set at the front of the sequence.
Remarks: The container must contain at least one element.
java.lang.RuntimeException - When the container is empty.public T Back()
Back in interface IBackSequence<T>java.lang.RuntimeException - When the container is empty.public void SetBack(T value)
SetBack in interface IBackSequence<T>value - The value to be set at the back of the sequence.java.lang.RuntimeException - When the container is empty.public void PushBack(T item)
PushBack in interface IBackSequence<T>item - The element added to the end of the sequence.java.lang.RuntimeException - When the container's
size is equal to the maximum size.public void PopBack()
PopBack in interface IBackSequence<T>java.lang.RuntimeException - When the
container is empty.public void PushFront(T item)
PushFront in interface IFrontSequence<T>item - The element added to the beginning of
the sequence.java.lang.RuntimeException - When the
container starts at the position zero in the sequence.public void PopFront()
PopFront in interface IFrontSequence<T>java.lang.RuntimeException - When the container is empty.public Vector.UIterator Insert(Vector.UIterator pos, T item)
pos - The position in the sequence where the element
is inserted.item - The value of the element being inserted
into the sequence.Remarks: The insertion operation can be expensive.
java.lang.RuntimeException - When the
specified iterator is invalid or the container's size is equal to
the maximum size of the storage.public Vector.UIterator PInsert(Vector.UIterator pos, T item)
pos - The position in the sequence where the element
is inserted.item - The value of the element being inserted
into the sequence.Remarks: The insertion operation can be expensive.
java.lang.RuntimeException - When the
specified iterator is invalid or the container's size is equal to
the maximum size of the storage.public Vector.Iterator Insert(Vector.Iterator pos, T item)
Insert in interface IInsertSequence<T,Vector.Iterator>pos - The position in the sequence where the element
is inserted.item - The value of the element being inserted
into the sequence.Remarks: The insertion operation can be expensive.
java.lang.RuntimeException - When the
specified iterator is invalid or the container's size is equal to
the maximum size of the storage.public Vector.Iterator PInsert(Vector.Iterator pos, T item)
pos - The position in the sequence where the element
is inserted.item - The value of the element being inserted
into the sequence.Remarks: The insertion operation can be expensive.
java.lang.RuntimeException - When the
specified iterator is invalid or the container's size is equal to
the maximum size of the storage.public void Insert(Vector.UIterator pos, int n, T item)
pos - The position in the sequence where the elements
are inserted.n - The number of elements being inserted into the sequence.item - The value of the elements being inserted
into the sequence.
Remarks: The insertion operation can be expensive.
java.lang.RuntimeException - When the
specified iterator is invalid or the container's size plus number of
elements to be inserted is equal to the maximum size of the storage.public void Insert(Vector.Iterator pos, int n, T item)
pos - The position in the sequence where the elements
are inserted.n - The number of elements being inserted into the sequence.item - The value of the elements being inserted
into the sequence.
Remarks: The insertion operation can be expensive.
java.lang.RuntimeException - When the
specified iterator is invalid or the container's size plus number of
elements to be inserted is equal to the maximum size of the storage.public <TInpIter extends IInpIter<T,TInpIter>> void Insert(Vector.UIterator pos, TInpIter first, TInpIter last)
TInpIter - The type of iterators in the specified range.pos - The position in the sequence where the elements
are inserted.first - An input iterator addressing the position of the
first element in the range to be inserted.last - An input iterator addressing the position that is
one past the final element in the range to be inserted.
Remarks: The insertion operation can be expensive.
java.lang.RuntimeException - When the
specified iterator is invalid or the container's size plus number of
elements to be inserted is equal to the maximum size of the storage.public <TInpIter extends IInpIter<T,TInpIter>> void Insert(Vector.Iterator pos, TInpIter first, TInpIter last)
TInpIter - The type of iterators in the specified ranges.pos - The position in the sequence where the elements
are inserted.first - An input iterator addressing the position of the
first element in the range to be inserted.last - An input iterator addressing the position that is
one past the final element in the range to be inserted.
Remarks: The insertion operation can be expensive.
java.lang.RuntimeException - When the
specified iterator is invalid or the container's size plus number of
elements to be inserted is equal to the maximum size of the storage.public Vector.UIterator Erase(Vector.UIterator pos)
pos - Position of the element to be removed from the
sequence.Remarks: The erase operation can be expensive.
public Vector.UIterator PErase(Vector.UIterator pos)
pos - Position of the element to be removed from the
sequence.Remarks: The erase operation can be expensive.
public Vector.Iterator Erase(Vector.Iterator pos)
pos - Position of the element to be removed from the
sequence.Remarks: The erase operation can be expensive.
public Vector.Iterator PErase(Vector.Iterator pos)
pos - Position of the element to be removed from the
sequence.Remarks: The erase operation can be expensive.
public int Erase(int first,
int last)
first - Position of the first element removed from
the sequence.last - Position just beyond the last element removed
from the sequence.Remarks: The erase operation can be expensive.
public Vector.UIterator Erase(Vector.UIterator first, Vector.UIterator last)
first - Position of the first element removed from
the sequence.last - Position just beyond the last element removed
from the sequence.Remarks: The erase operation can be expensive.
public Vector.Iterator Erase(Vector.Iterator first, Vector.Iterator last)
first - Position of the first element removed from
the sequence.last - Position just beyond the last element removed
from the sequence.Remarks: The erase operation can be expensive.
public void EraseBegin(Vector.UIterator pos)
pos - Position of the first element in the sequence after removing
the specified elements.
Remarks: The EraseBegin is a constant time operation.
java.lang.RuntimeException - When the
specified iterator is invalid.public void EraseBegin(Vector.Iterator pos)
pos - Position of the first element in the sequence after removing
the specified elements.
Remarks: The EraseBegin is a constant time operation.
java.lang.RuntimeException - When the
specified iterator is invalid.public void EraseEnd(Vector.UIterator pos)
pos - Position of the first element removed from
the sequence.
Remarks: The EraseEnd is a constant time operation.
java.lang.RuntimeException - When the
specified iterator is invalid.public void EraseEnd(Vector.Iterator pos)
pos - Position of the first element removed from
the sequence.
Remarks: The EraseEnd is a constant time operation.
java.lang.RuntimeException - When the
specified iterator is invalid.public void Resize(int newSize)
newSize - The new size of the sequence.
Remarks: If the new size is larger than the original size, the new objects are assigned the default value.
java.lang.RuntimeException - When the specified size is greater
than maximum size of the storage.public void Resize(int newSize,
T item)
newSize - The new size of the sequence.item - The value of new elements added to the
sequence, if the new size is larger than the original size.java.lang.RuntimeException - When the specified size is greater
than maximum size of the storage.public void Swap(Vector<T> x)
x - A sequence whose elements are to be exchanged.
Remarks: The complexity is linear with the size of the containers.
public void SwapRef(Vector<T> x)
x - A sequence whose elements are to be exchanged.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - An object to compare with this instance.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(Vector<T> x)
x - An object to compare with this instance.public boolean PEquals(Vector<T> x)
x - An object to compare with this instance.public java.lang.String toString()
toString in class java.lang.ObjectRemarks: If the container has a great number of elements this function may throw an exception. It is recommended to use the overloaded function to limit the number of elements that are dumped to a string.
public java.lang.String ToString(Vector.Iterator first, Vector.Iterator last)
first - Position of the first element in the range
of elements.last - Position that is one past the final element
in the range of elements.
Remarks: If the specified range has a great number of elements this function may throw an exception.
public void ToStream(java.io.PrintStream sw)
sw - A StreamWriter object to write to.public void ToStream(Vector.Iterator first, Vector.Iterator last, java.io.PrintStream sw)
first - Position of the first element in the range
of elements.last - Position that is one past the final element
in the range of elements.sw - A StreamWriter object to write to.Copyright© 2012 Progeneric Systems, Inc. All Rights Reserved.