Class ArrayStorage
java.lang.Object
com.itextpdf.pdfoptimizer.handlers.imagequality.processors.utils.ArrayStorage
Wrapper for
HashMap
with HashableArray
as keys and Integer
as values. Implemented for purposes of storing arrays with their unique integer codes.
-
Constructor Summary
-
Method Summary
-
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.- Parameters:
-
array
- is the array to add
-
get
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.- Parameters:
-
array
- the array to obtain its sequence number - Returns:
- sequence number of the array
-
size
public int size()Gets size of the storage.- Returns:
- amount of unique stored arrays
-
getAll
Gets all stored arrays with its identifiers.- Returns:
- set of entries of long arrays associated with their sequence number
-