public class PartialNode
extends HamtNode
Stores both references and values
Keys are stored in even indices
Values are stored in odd indices
Key-Values/References are stored in pairs located at indices 2*i and 2*i+1 where 0 <= i <= 8
Keys are stored at index 2i and the corresponding values at index 2i + 1
References to another class HamtNode are stored at index 2i + 1 and null must be stored at index 2i
storage must have size equal to 2*count
0 <= count <= 16 If any BitmapIndexedNode would store more than 16 elements then that node must be
converted to an class ArrayNode
count must be the number of 1 bits in bitmap
class HamtNode,
class ArrayNodepublic PartialNode(int bitmap,
@NotNull
java.lang.Object[] storage)
Stores both references and values
Keys are stored in even indices
Values are stored in odd indices
Key-Values/References are stored in pairs located at indices 2*i and 2*i+1 where 0 <= i <= 8
Keys are stored at index 2i and the corresponding values at index 2i + 1
References to another class HamtNode are stored at index 2i + 1 and null must be stored at index 2i
storage must have size equal to 2*count
0 <= count <= 16 If any BitmapIndexedNode would store more than 16 elements then that node must be
converted to an class ArrayNode
count must be the number of 1 bits in bitmap
bitmap - stores all the indices of Key-Value/References and the number of Key-Value/Referencesstorage - stores the Key-Value and/or Referencesclass HamtNode,
class ArrayNode@NotNull public java.util.Iterator<tech.codingzen.kata.hamt.InternalEntry> iterator()
public boolean equals(@Nullable
java.lang.Object other)
public int hashCode()
public int getBitmap()
stores all the indices of Key-Value/References and the number of Key-Value/References
@NotNull public java.lang.Object[] getStorage()
stores the Key-Value and/or References
public int component1()
stores all the indices of Key-Value/References and the number of Key-Value/References
@NotNull public java.lang.Object[] component2()
stores the Key-Value and/or References
@NotNull public PartialNode copy(int bitmap, @NotNull java.lang.Object[] storage)
Stores both references and values
Keys are stored in even indices
Values are stored in odd indices
Key-Values/References are stored in pairs located at indices 2*i and 2*i+1 where 0 <= i <= 8
Keys are stored at index 2i and the corresponding values at index 2i + 1
References to another class HamtNode are stored at index 2i + 1 and null must be stored at index 2i
storage must have size equal to 2*count
0 <= count <= 16 If any BitmapIndexedNode would store more than 16 elements then that node must be
converted to an class ArrayNode
count must be the number of 1 bits in bitmap
bitmap - stores all the indices of Key-Value/References and the number of Key-Value/Referencesstorage - stores the Key-Value and/or Referencesclass HamtNode,
class ArrayNode@NotNull public java.lang.String toString()
Stores both references and values
Keys are stored in even indices
Values are stored in odd indices
Key-Values/References are stored in pairs located at indices 2*i and 2*i+1 where 0 <= i <= 8
Keys are stored at index 2i and the corresponding values at index 2i + 1
References to another class HamtNode are stored at index 2i + 1 and null must be stored at index 2i
storage must have size equal to 2*count
0 <= count <= 16 If any BitmapIndexedNode would store more than 16 elements then that node must be
converted to an class ArrayNode
count must be the number of 1 bits in bitmap
class HamtNode,
class ArrayNode