Class DefaultUniqueIndex<K>

    • Constructor Detail

      • DefaultUniqueIndex

        public DefaultUniqueIndex​(java.lang.Iterable<K> keys,
                                  boolean includeNull)
        Creates a new index with a set of keys. Note: the keys do not need to be unique
        Parameters:
        keys - the keys
      • DefaultUniqueIndex

        public DefaultUniqueIndex​(java.util.List<K> keys)
        Creates a new index with a set of keys. Note: the keys do not need to be unique
        Parameters:
        keys - the keys
      • DefaultUniqueIndex

        public DefaultUniqueIndex​(K... keys)
      • DefaultUniqueIndex

        public DefaultUniqueIndex​(UniqueIndex.Duplicate duplicate,
                                  K... keys)
        Creates a new index with an ordered list of unique keys.
        Parameters:
        keys - the unique keys
      • DefaultUniqueIndex

        public DefaultUniqueIndex​(UniqueIndex<K> index,
                                  java.util.Comparator<K> comparator)
    • Method Detail

      • contains

        public boolean contains​(K key)
      • getAddress

        public int getAddress​(K key)
      • keys

        public java.lang.Iterable<K> keys()
        Specified by:
        keys in interface com.macrofocus.index.Index<K>
        Overrides:
        keys in class AbstractUniqueIndex<K>
      • getKey

        public K getKey​(int i)
      • getSize

        public int getSize()
      • keepAddresses

        public UniqueIndex<K> keepAddresses​(int[] addresses)