MCPcopy Index your code
hub / github.com/aggregateknowledge/java-hll / initializeStorage

Method initializeStorage

src/main/java/net/agkn/hll/HLL.java:484–502  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 4

HLLMethod · 0.95
addRawMethod · 0.95
heterogenousUnionMethod · 0.95
homogeneousUnionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected