Initializes storage for the specified HLLType and changes the instance's #type. @param type the HLLType to initialize storage for. This cannot be null and must be an instantiable type. (For instance, it cannot be HLLType#UNDEFINED.)
(final HLLType type)
| 482 | * it cannot be {@link HLLType#UNDEFINED}.) |
| 483 | */ |
| 484 | private void initializeStorage(final HLLType type) { |
| 485 | this.type = type; |
| 486 | switch(type) { |
| 487 | case EMPTY: |
| 488 | // nothing to be done |
| 489 | break; |
| 490 | case EXPLICIT: |
| 491 | this.explicitStorage = new LongOpenHashSet(); |
| 492 | break; |
| 493 | case SPARSE: |
| 494 | this.sparseProbabilisticStorage = new Int2ByteOpenHashMap(); |
| 495 | break; |
| 496 | case FULL: |
| 497 | this.probabilisticStorage = new BitVector(regwidth, m); |
| 498 | break; |
| 499 | default: |
| 500 | throw new RuntimeException("Unsupported HLL type " + type); |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | // ======================================================================== |
| 505 | // Cardinality |
no outgoing calls
no test coverage detected