Generic type of this collection (e.g.
Generic type of this collection (e.g. Map, Map2, Set).
Immutable variant of this collection.
Immutable variant of this collection.
Mutable variant of this collection.
Mutable variant of this collection.
Status of the slots in the hash table.
Removes all elements from this collection, deallocating its arrays.
Removes all elements from this collection, deallocating its arrays.
Checks if two collections are equal.
Checks if two collections are equal.
Equal means the collections have the same generic type (which is checked
by the method ptrCastT
) and the same contents.
Comparing metal collections with any other collection types (including those from Scala) will return false.
Grow the underlying array to best accomodate the map's size.
Grow the underlying array to best accomodate the map's size.
To preserve hashing access speed, the map's size should never be more than 66% of the underlying array's size. When this size is reached, the map needs to be updated (using this method) to have a larger array.
The underlying array's size must always be a multiple of 2, which means this method grows the array's size by 2x (or 4x if the map is very small). This doubling helps amortize the cost of resizing, since as the map gets larger growth will happen less frequently. This method returns a null of type Unit1[A] to trigger specialization without allocating an actual instance.
Growing is an O(n) operation, where n is the map's size.
Hashes the contents of the collection to an Int value.
Hashes the contents of the collection to an Int value.
By xor'ing all the collection's element hashes together, we can be sure that collections with the same contents will have the same hashCode regardless of the order those items appear.
Returns true if the container is empty, false otherwise.
Returns true if the container is empty, false otherwise.
Slots for keys.
Point at which we should grow.
Return the size of this container; we use Long
so that big containers
can be manipulated.
Return the size of this container; we use Long
so that big containers
can be manipulated.
Mask = nSlots - 1, used for hashing.
Creates a mutable copy of this collection.
Creates a mutable copy of this collection.
Returns true if the container is non-empty, false otherwise.
Returns true if the container is non-empty, false otherwise.
Flag indicating that the equals methods of this object should be called in priority.
Returns a pointer to the start of this container instance.
Returns a pointer to the start of this container instance.
Adds the given key to the container.
Adds the given key to the container, similarly to ptrAddKey
, but takes the key
from the given array, which should be of type Array[K]
.
Adds the given key to the container, similarly to ptrAddKey
, but takes the key
from the given array, which should be of type Array[K]
. The array type is however
recovered at runtime to avoid boxing.
Tests if the parameter has the same generic type, and returns an optional cast.
Checks that the pointed element exists in the other collection and has the same value.
Returns a pointer to the given item, if it exists, or null.
Returns a pointer to the given item, if it exists, or null.
Returns the hashCode of the pointed element.
Returns the key pointed by ptr
.
Returns a pointer to the next element if available, or returns a null pointer.
Removes the pointed element.
Removes the pointed element, and returns the pointer to the next element, or null if at the end.
Returns the toString representation of the pointed element.
Returns the value of the object pointed by the pointer.
Removes all elements from this collection, keeping the all allocated arrays.
Removes all elements from this collection, keeping the all allocated arrays.
Returns an immutable version of this mutable collection.
Returns an immutable version of this mutable collection. The mutable instance is cleared.
Number of defined slots.
String prefix used in the toString
method.
String prefix used in the toString
method.
Returns this collection if already immutable, or an immutable copy.
Returns this collection if already immutable, or an immutable copy.
Number of used slots.
Slots for values.