VelocityDbHashSetT Methods |
The VelocityDbHashSetT generic type exposes the following members.
Name | Description | |
---|---|---|
Add |
Add item to this VelocityDbHashSet. Returns bool indicating whether item was added (won't be
added if already present)
| |
Clear |
Remove all items from this set. This clears the elements but not the underlying
buckets and slots array. Follow this call by TrimExcess to release these.
| |
Contains |
Checks if this hashset contains the item
| |
CopyTo(T) |
Copies the entire List to a compatible one-dimensional array, starting at the beginning of the target array.
| |
CopyTo(T, Int32) |
Copy items in this hashset to array, starting at arrayIndex
| |
CopyTo(T, Int32, Int32) |
Copies a range of elements from the List(Of T) to a compatible one-dimensional array, starting at the specified index of the target array.
| |
CreateSetComparer |
Used for deep equality of VelocityDbHashSet testing
| |
ExceptWith |
Remove items in other from this set. Modifies this set.
| |
GetEnumerator |
Returns an enumerator that iterates through a collection
| |
GetObjectData |
Serialization usage other than VelocityDb serialization
| |
IntersectWith |
Takes the intersection of this set with other. Modifies this set.
Implementation Notes:
We get better perf if other is a hashset using same equality comparer, because we
get constant contains check in other. Resulting cost is O(n1) to iterate over this.
If we can't go above route, iterate over the other and mark intersection by checking
contains in this. Then loop over and delete any unmarked elements. Total cost is n2+n1.
Attempts to return early based on counts alone, using the property that the
intersection of anything with the empty set is the empty set.
| |
IsProperSubsetOf |
Checks if this is a proper subset of other (i.e. strictly contained in)
Implementation Notes:
The following properties are used up-front to avoid element-wise checks:
1. If this is the empty set, then it's a proper subset of a set that contains at least
one element, but it's not a proper subset of the empty set.
2. If other has unique elements according to this equality comparer, and this has >=
the number of elements in other, then this can't be a proper subset.
Furthermore, if other is a hashset using the same equality comparer, we can use a
faster element-wise check.
| |
IsProperSupersetOf |
Checks if this is a proper superset of other (i.e. other strictly contained in this)
Implementation Notes:
This is slightly more complicated than above because we have to keep track if there
was at least one element not contained in other.
The following properties are used up-front to avoid element-wise checks:
1. If this is the empty set, then it can't be a proper superset of any set, even if
other is the empty set.
2. If other is an empty set and this contains at least 1 element, then this is a proper
superset.
3. If other has unique elements according to this equality comparer, and other's count
is greater than or equal to this count, then this can't be a proper superset
Furthermore, if other has unique elements according to this equality comparer, we can
use a faster element-wise check.
| |
IsSubsetOf |
Checks if this is a subset of other.
Implementation Notes:
The following properties are used up-front to avoid element-wise checks:
1. If this is the empty set, then it's a subset of anything, including the empty set
2. If other has unique elements according to this equality comparer, and this has more
elements than other, then it can't be a subset.
Furthermore, if other is a hashset using the same equality comparer, we can use a
faster element-wise check.
| |
IsSupersetOf |
Checks if this is a superset of other
Implementation Notes:
The following properties are used up-front to avoid element-wise checks:
1. If other has no elements (it's the empty set), then this is a superset, even if this
is also the empty set.
2. If other has unique elements according to this equality comparer, and this has less
than the number of elements in other, then this can't be a superset
| |
Overlaps |
Checks if this set overlaps other (i.e. they share at least one item)
| |
Remove |
Remove item from this hashset
| |
RemoveWhere |
Remove elements that match specified predicate. Returns the number of elements removed
| |
SetEquals |
Checks if this and other contain the same elements. This is set equality:
duplicates and order are ignored
| |
SymmetricExceptWith |
Takes symmetric difference (XOR) with other and this set. Modifies this set.
| |
TrimExcess |
Sets the capacity of this list to the size of the list (rounded up to nearest prime),
unless count is 0, in which case we release references.
This method can be used to minimize a list's memory overhead once it is known that no
new elements will be added to the list. To completely clear a list and release all
memory referenced by the list, execute the following statements:
list.Clear();
list.TrimExcess();
| |
UnionWith |
Take the union of this VelocityDbHashSet with other. Modifies this set.
Implementation note: GetSuggestedCapacity (to increase capacity in advance avoiding
multiple resizes ended up not being useful in practice; quickly gets to the
point where it's a wasteful check.
|
Name | Description | |
---|---|---|
ToStringDetails(SessionBase, Boolean) | Overloaded.
Object details as a string
(Defined by Utilities.) | |
ToStringDetails(Schema, TypeVersion, Boolean) | Overloaded.
Currently only used by Database Manager
(Defined by Utilities.) |