The IndexSet type exposes the following members.
Back to Top
Back to Top
Back to Top
Back to Top
Constructors
Name | Description | |
---|---|---|
IndexSet | Creates an empty IndexSet.
| |
IndexSet(IndexSet) | Creates an IndexSet as a copy of another IndexSet.
| |
IndexSet(Int32, Boolean) | Creates an IndexSet with the specified capacity.
| |
IndexSet(Int32, IEnumerable Int32 ) | Creates an IndexSet with specified capacity and initial content.
|
Methods
Name | Description | |
---|---|---|
AddIndex |
Adds the index to the set. If the index is already in the set,
nothing is changed.
| |
AddIndexes(IEnumerable Int32 ) | Adds the specified indexes to the set. | |
AddIndexes(Int32, Int32) |
Adds a range of indexes to the set.
| |
And(IndexSet) |
Performs a logical AND between this and that IndexSet.
Note: the method changes the internal state of this IndexSet | |
And(IndexSet, IndexSet) |
Returns a new IndexSet that is a logical AND between two IndexSet.
| |
AsReadOnly | Returns this if read-only, otherwise a read-only clone. | |
Assign(IndexSet) |
Copies the content of the specified IndexSet into this
one.
| |
Assign(Int32, UInt32 ) |
Assigns the indexes from the specified array of
indexes encoded as bits.
The length of the bits array must be
(capacity + 31)/32 | |
AssignComplement |
Copies the complement of the specified IndexSet into this
one. In other words, this IndexSet will contain the
indexes NOT in that IndexSet.
| |
AsWritable | Returns a clone if this is read-only, otherwise this. | |
Clear |
Removes all indexes from the set.
| |
Clone | Creates a writable copy of this IndexSet. | |
Contains |
Determines whether this IndexSet contains all indexes of
that IndexSet.
| |
CopyTo |
Copies the indexes in the set to the array starting
at the offset.
| |
DeleteIndexPositions |
Deletes a range of index positions. Existing indexes from
startIndex+count | |
Equals(Object) |
Tests that object is an IndexSet and is equal to this one.
(Overrides Object Equals(Object).) | |
Equals(IndexSet) |
Tests if this IndexSet and that IndexSet have the same Capacity and
contain exactly the same indexes.
| |
Fill |
Adds all indexes (as defined by Capacity) to the set.
| |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetBits |
Fills the specified array with the indexes encoded as
bits. The length of the bits array must be
(Capacity + 31)/32 | |
GetEnumerator |
Returns an enumerator for the IndexSet.
| |
GetHashCode |
Returns a hash code for the current state of the IndexSet.
(Overrides Object GetHashCode .) | |
GetNextIndex | Gets the index after the specified one.
| |
GetPreviousIndex | Gets the index before the specified one.
| |
GetSubsetCount |
Gets the number of indexes in a subset defined by the startIndex
and endIndex arguments.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
HasIndex |
Returns a bool indicating if the index is a member of the set.
| |
InsertIndexPositions |
Makes room for more indexes. Existing indexes
from startIndex and above are moved up.
| |
Intersects |
Determines whether this and that IndexSet have any
indexes in common.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Not |
Inverts the set. Any index that was included in the set
will be excluded and vice versa.
Note: the method changes the internal state of this IndexSet | |
Not(IndexSet) |
Returns a new IndexSet that is the complement of the specified source set.
Any index that is included in the source set will be excluded and vice versa.
| |
NthSmallestIndex | Gets the Nth smallest index.
Caution: This method is slow (linear time), so you must ensure that your
algorithm (or the one using your algorithm) never calls this method
many times, which could result in quadratic time.
| |
Or(IndexSet) |
Performs a logical OR between this and that IndexSet.
Note: the method changes the internal state of this IndexSet | |
Or(IndexSet, IndexSet) |
Returns a new IndexSet that is a logical OR between two IndexSet.
| |
RemoveIndex |
Removes the index from the set. If the index is not in the set,
nothing is changed.
| |
RemoveIndexes(IEnumerable Int32 ) | Removes the specified indexes from the set. | |
RemoveIndexes(Int32, Int32) |
Removes a range of indexes from the set.
| |
SetReadOnly | Sets this IndexSet to read-only. | |
Subtract(IndexSet) |
Subtracts that IndexSet from this one. In other words,
the indexes in that IndexSet are removed from this.
Note: the method changes the internal state of this IndexSet | |
Subtract(IndexSet, IndexSet) |
Returns a new IndexSet that is a subtraction between two IndexSet.
In other words, the new IndexSet is a copy of
set1 without the indexes in
set2.
| |
ToString |
Returns a string representation of the IndexSet. Each index position
is represented by a 0 or 1, where 1 indicates that the index is
in the set.
(Overrides Object ToString .) | |
Xor(IndexSet) |
Performs a logical XOR between this and that IndexSet.
Note: the method changes the internal state of this IndexSet | |
Xor(IndexSet, IndexSet) |
Returns a new IndexSet that is a logical XOR between two IndexSet.
|
Properties
Name | Description | |
---|---|---|
Capacity |
Controls the total number of indexes that
the IndexSet can hold
(numbered Capacity-1 | |
Count |
Number of indexes currently in the set.
| |
First |
Gets the first index in the IndexSet.
| |
IsEmpty |
True if the set has no indexes (Count == 0).
| |
IsFull |
True if the all indexes are in the set (Count == Capacity).
| |
IsReadOnly |
Tells if this IndexSet is read-only.
| |
Item |
Indexer. Returns a bool indicating if the index is a member of the set.
| |
Last |
Gets the last index in the IndexSet.
|
Explicit Interface Implementations
Name | Description | |
---|---|---|
IEnumerable GetEnumerator |
IEnumerable.GetEnumerator implementation.
|
See Also