public class FSet64<TKey> extends java.lang.Object implements IBidContainer64<TKey,FSet64.Iterator>
Remarks: The value of an element in a set may not be changed directly. Instead, you must delete old values and insert elements with new values. The container is allocated in memory and can contain at most 281,474,976,710,656 elements of type TKey.
| Modifier and Type | Class and Description |
|---|---|
class |
FSet64.Iterator
Defines a bidirectional iterator that can be both
incremented and decremented.
|
class |
FSet64.ReverseIterator
Defines a reverse unchecked iterator that enables
backward traversal of a range.
|
class |
FSet64.UIterator
Defines a bidirectional iterator that can be both
incremented and decremented.
|
class |
FSet64.UReverseIterator
Defines a reverse unchecked iterator that enables
backward traversal of a range.
|
| Modifier and Type | Method and Description |
|---|---|
void |
Add(TKey item)
Adds an object to the collection.
|
<TInpIter extends IInpIter<TKey,TInpIter>> |
Assign(TInpIter first,
TInpIter last)
Erases a set and copies the specified elements
to the empty set.
|
FSet64.Iterator |
Begin()
Returns a bidirectional iterator to the first element
in the container.
|
void |
Clear()
Erases all the elements of the set.
|
boolean |
Contains(TKey item)
Determines whether an element is in the container.
|
void |
CopyTo(TKey[] array,
int arrayIndex)
Copies the container to a compatible one-dimensional array,
starting at the specified index of the target array.
|
long |
Count(TKey key)
Returns the number of elements in the set whose keys match a
specified key.
|
boolean |
Empty()
Tests if the set is empty (the size of
the set is zero).
|
FSet64.Iterator |
End()
Returns a bidirectional iterator to the position that is
one past the final element in the container.
|
Pair<FSet64.Iterator,FSet64.Iterator> |
EqualRange(TKey key)
Finds a pair of iterators respectively to the first element in a
set that is greater than or equal to a specified key and to the
first element in the set that is greater than the key.
|
boolean |
Equals(FSet64<TKey> other)
Tests whether this instance is equal to a specified
set.
|
boolean |
equals(java.lang.Object obj)
Tests whether this instance is equal to a specified
object.
|
FSet64.Iterator |
Erase(FSet64.Iterator pos)
Removes an element in a set from a specified
position.
|
void |
Erase(FSet64.Iterator first,
FSet64.Iterator last)
Removes a range of elements in a set from specified
positions.
|
long |
Erase(TKey key)
Removes the elements in a set that match a specified key.
|
long |
Erase(TKey key1,
TKey key2)
Removes the elements in a set from a specified range.
|
FSet64.Iterator |
Find(TKey key)
Locates the position of the first occurrence of an element that has
a key equivalent to a specified key.
|
int |
hashCode()
Returns the hash code for this instance.
|
<TInpIter extends IInpIter<TKey,TInpIter>> |
Insert(TInpIter first,
TInpIter last)
Inserts a range of elements into the set at a
specified position.
|
Pair<FSet64.Iterator,java.lang.Boolean> |
Insert(TKey key)
Inserts an element into a set.
|
IFunc2Arg<TKey,TKey,java.lang.Boolean> |
KeyCompare()
Returns the function that can compare two sort keys to
determine the relative order of two elements in the set.
|
FSet64.Iterator |
LowerBound(TKey key)
Finds an iterator to the first element in a set that
is equal to or greater than a specified element.
|
long |
MaxSize()
Returns the maximum possible length of the set.
|
void |
PCopyTo(TKey[] array,
int arrayIndex)
Parallel CopyTo: Copies the sequence to a compatible one-dimensional array,
starting at the specified index of the target array.
|
boolean |
Remove(TKey item)
Removes the first occurrence of a specific object from
the container.
|
FSet64.ReverseIterator |
ReverseBegin()
Returns a random-access reverse iterator to the first
element in the reversed container.
|
FSet64.ReverseIterator |
ReverseEnd()
Returns a random-access reverse iterator to the position
that is one past the final element in the reversed container.
|
long |
Size()
Returns the number of elements in the set.
|
void |
Swap(FSet64<TKey> x)
Exchanges the elements of two sets.
|
void |
ToStream(FSet64.Iterator first,
FSet64.Iterator last,
java.io.PrintStream sw)
Writes the elements of the current container from the
specified range to the specified stream.
|
void |
ToStream(java.io.PrintStream sw)
Writes the elements of the current container to the
specified stream.
|
java.lang.String |
toString()
Returns a String that represents the content of the
current container.
|
java.lang.String |
ToString(FSet64.Iterator first,
FSet64.Iterator last)
Returns a String that represents the elements of the
current container from the specified range.
|
java.lang.Class<TKey> |
Type()
Returns the type of the elements in the container.
|
FSet64.UIterator |
UBegin()
Returns a bidirectional iterator to the first element
in the container.
|
FSet64.UIterator |
UEnd()
Returns a bidirectional iterator to the position that is
one past the final element in the container.
|
boolean |
Unique()
Returns true if the container accepts only unique keys.
|
FSet64.Iterator |
UpperBound(TKey key)
Finds an iterator to the first element in a set that
is greater than a specified element.
|
FSet64.UReverseIterator |
UReverseBegin()
Returns a random-access unchecked reverse iterator to the first
element in the reversed container.
|
FSet64.UReverseIterator |
UReverseEnd()
Returns a random-access unchecked reverse iterator to the position
that is one past the final element in the reversed container.
|
public java.lang.Class<TKey> Type()
Type in interface IContainer64<TKey>public <TInpIter extends IInpIter<TKey,TInpIter>> void Assign(TInpIter first, TInpIter last)
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.
Remarks: The input range must be sorted. Use the sort methods of the Algorithms.SortOper class to sort the input range if it is unsorted. Failure to satisfy this condition will corrupt the container.
java.lang.RuntimeException - Thrown when the
iterator range is invalid.public boolean Unique()
public IFunc2Arg<TKey,TKey,java.lang.Boolean> KeyCompare()
public long Size()
Size in interface IContainer64<TKey>public long MaxSize()
MaxSize in interface IContainer64<TKey>public boolean Empty()
public boolean Contains(TKey item)
item - The object to locate in the container.public void Add(TKey item)
item - The object to be added to the collection.public boolean Remove(TKey item)
item - The object to remove from the container.public void Clear()
Clear in interface IContainer64<TKey>public void CopyTo(TKey[] array, int arrayIndex)
array - The one-dimensional array that is the
destination of the elements copied from container.
The array must have zero-based indexing.arrayIndex - The zero-based index in array at
which copying begins.public void PCopyTo(TKey[] 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 FSet64.UIterator UBegin()
public FSet64.UIterator UEnd()
public FSet64.Iterator Begin()
Begin in interface IFwdContainer64<TKey,FSet64.Iterator>public FSet64.Iterator End()
End in interface IFwdContainer64<TKey,FSet64.Iterator>public FSet64.UReverseIterator UReverseBegin()
public FSet64.UReverseIterator UReverseEnd()
public FSet64.ReverseIterator ReverseBegin()
public FSet64.ReverseIterator ReverseEnd()
public long Count(TKey key)
key - The key of the elements to be counted.public FSet64.Iterator Find(TKey key)
key - The key from the set being searched.public FSet64.Iterator LowerBound(TKey key)
key - The key from the set being searched.public FSet64.Iterator UpperBound(TKey key)
key - The key from the set being searched.public Pair<FSet64.Iterator,FSet64.Iterator> EqualRange(TKey key)
key - The key from the set being searched.LowerBound
the key.public Pair<FSet64.Iterator,java.lang.Boolean> Insert(TKey key)
key - The value of an element to be inserted into
the set unless the set already contains that element.public <TInpIter extends IInpIter<TKey,TInpIter>> void Insert(TInpIter first, TInpIter last)
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.java.lang.RuntimeException - Thrown when the
iterator range is invalid.public FSet64.Iterator Erase(FSet64.Iterator pos)
pos - The position of the element to be removed from
the set.java.lang.RuntimeException - Thrown when
the argument iterator is not dereferenceable.public void Erase(FSet64.Iterator first, FSet64.Iterator last)
first - The position of the first element removed from
the set.last - Position just beyond the last element removed
from the set.java.lang.RuntimeException - Thrown when the
specified range is invalid.public long Erase(TKey key)
key - The key value of the elements to be removed
from the set.public long Erase(TKey key1, TKey key2)
key1 - Key of the first element removed from the set.key2 - Key just beyond the last element removed from the set.public void Swap(FSet64<TKey> x)
x - A set whose elements are to be exchanged with the
current instance.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - An object to compare with this instance.public boolean Equals(FSet64<TKey> other)
other - A set to compare with this instance.public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
Remarks: If the container has a large 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.
toString in class java.lang.Objectpublic java.lang.String ToString(FSet64.Iterator first, FSet64.Iterator last)
first - An iterator addressing the position of the
first element in the range of elements.last - An iterator addressing the position that is
one past the final element in the range of elements.
Remarks: If the specified range has a large number of elements, this function may throw an exception.
public void ToStream(java.io.PrintStream sw)
sw - A PrintStream object to write to.public void ToStream(FSet64.Iterator first, FSet64.Iterator last, java.io.PrintStream sw)
first - An iterator addressing the position of the
first element in the range of elements.last - An iterator addressing the position that is
one past the final element in the range of elements.sw - A PrintStream object to write to.Copyright© 2012 Progeneric Systems, Inc. All Rights Reserved.