Class WeightedSet<K extends FieldValue>

  • All Implemented Interfaces:
    Cloneable, Comparable<FieldValue>, Map<K,​Integer>

    public final class WeightedSet<K extends FieldValue>
    extends CollectionFieldValue<K>
    implements Map<K,​Integer>
    A weighted set, a unique set of keys with an associated integer weight. This class uses an encapsulated Map (actually a LinkedHashMap) that associates each key with its weight (value).
    Author:
    Einar M R Rosenvinge
    • Constructor Detail

      • WeightedSet

        public WeightedSet​(DataType type)
        Creates a new WeightedSet.
        Parameters:
        type - the data type for the field that this weighted set is associated with
      • WeightedSet

        public WeightedSet​(DataType type,
                           int initialCapacity)
        Creates a new weighted set with a given initial capacity.
        Parameters:
        initialCapacity - the initial capacity to use for the encapsulated Map