public class HashCollisionNode
extends HamtNode
Stores a hash and Key-Values that have that same hash
Keys are stored in even indices
Values are stored in odd indices
Storage size may be more than count this facilitates quicker removal by just changing count
All keys must be equal to hash however those keys may be different with respect to Any.equals
public HashCollisionNode(int hash,
int count,
@NotNull
java.lang.Object[] storage)
Stores a hash and Key-Values that have that same hash
Keys are stored in even indices
Values are stored in odd indices
Storage size may be more than count this facilitates quicker removal by just changing count
All keys must be equal to hash however those keys may be different with respect to Any.equals
hash - the hash that is common to all values held in this nodecount - the number of key-values storedstorage - holds the Key-Values@NotNull public java.util.Iterator<tech.codingzen.kata.hamt.InternalEntry> iterator()
public boolean equals(@Nullable
java.lang.Object other)
public int hashCode()
public int getHash()
the hash that is common to all values held in this node
public int getCount()
the number of key-values stored
@NotNull public java.lang.Object[] getStorage()
holds the Key-Values
public int component1()
the hash that is common to all values held in this node
public int component2()
the number of key-values stored
@NotNull public java.lang.Object[] component3()
holds the Key-Values
@NotNull public HashCollisionNode copy(int hash, int count, @NotNull java.lang.Object[] storage)
Stores a hash and Key-Values that have that same hash
Keys are stored in even indices
Values are stored in odd indices
Storage size may be more than count this facilitates quicker removal by just changing count
All keys must be equal to hash however those keys may be different with respect to Any.equals
hash - the hash that is common to all values held in this nodecount - the number of key-values storedstorage - holds the Key-Values@NotNull public java.lang.String toString()
Stores a hash and Key-Values that have that same hash
Keys are stored in even indices
Values are stored in odd indices
Storage size may be more than count this facilitates quicker removal by just changing count
All keys must be equal to hash however those keys may be different with respect to Any.equals