public class ArrayStorage extends Object
Wrapper for HashMap with HashableArray as keys and Integer as values. Implemented for purposes of storing arrays with their unique integer codes.
  • Constructor Details

    • ArrayStorage

      public ArrayStorage()
  • Method Details

    • add

      public void add (long[] array)
      Add a new array to the storage. If it was already presented in the storage then its internal state will not be change. Otherwise it will be associated with a new index which is the sequence number of the added array.
      array - is the array to add
    • get

      public Integer get (long[] array)
      Gets the value associated with the provided array. It is equal to the sequence number of the array which can be used as unique identifier of the array.
      array - the array to obtain its sequence number
      sequence number of the array
    • size

      public int size()
      Gets size of the storage.
      amount of unique stored arrays
    • getAll

      public Set<Map.Entry<HashableArray,Integer>> getAll()
      Gets all stored arrays with its identifiers.
      set of entries of long arrays associated with their sequence number