Class ImmutableOrdinalSet<E extends OrdinalValue<E>>

    • Constructor Detail

      • ImmutableOrdinalSet

        ImmutableOrdinalSet()
    • Method Detail

      • of

        public static <E extends OrdinalValue<E>> ImmutableOrdinalSet<E> of()
        Returns singleton empty immutable ordinal set
        Type Parameters:
        E - element type
        Returns:
        empty set
      • of

        @SafeVarargs
        public static <E extends OrdinalValue<E>> ImmutableOrdinalSet<E> of​(E first,
                                                                            E... rest)
        Creates immutable ordinal set from 1 or more elements. All elements expected to have same OrdinalValue.domain() as the first element, otherwise exception will be thrown.
        Type Parameters:
        E - element type
        Parameters:
        first - first element
        rest - the rest of elements
        Returns:
        empty set
      • copyOf

        public static <E extends OrdinalValue<E>> ImmutableOrdinalSet<E> copyOf​(java.lang.Iterable<? extends E> elements)
        Creates immutable ordinal set from iterable of elements. All elements expected to have same OrdinalValue.domain() as the first element, otherwise exception will be thrown.
        Type Parameters:
        E - the element type
        Parameters:
        elements - the elements, no nulls allowed
        Returns:
        the immutable ordinal set
      • copyOf

        public static <E extends OrdinalValue<E>> ImmutableOrdinalSet<E> copyOf​(E[] elements)
        Creates immutable ordinal set from array of elements. All elements expected to have same OrdinalValue.domain() as the first element, otherwise exception will be thrown.
        Type Parameters:
        E - the element type
        Parameters:
        elements - the elements, no nulls allowed
        Returns:
        the immutable ordinal set
      • add

        @Deprecated
        public final boolean add​(E e)
        Deprecated.
        Modification operation are not supported.
        Will throw an exception and leave the collection unmodified.
        Specified by:
        add in interface java.util.Collection<E extends OrdinalValue<E>>
        Specified by:
        add in interface java.util.Set<E extends OrdinalValue<E>>
        Overrides:
        add in class com.google.common.collect.ForwardingCollection<E extends OrdinalValue<E>>
        Throws:
        java.lang.UnsupportedOperationException - always
      • remove

        @Deprecated
        public final boolean remove​(java.lang.Object object)
        Deprecated.
        Modification operation are not supported.
        Will throw an exception and leave the collection unmodified.
        Specified by:
        remove in interface java.util.Collection<E extends OrdinalValue<E>>
        Specified by:
        remove in interface java.util.Set<E extends OrdinalValue<E>>
        Overrides:
        remove in class com.google.common.collect.ForwardingCollection<E extends OrdinalValue<E>>
        Throws:
        java.lang.UnsupportedOperationException - always
      • addAll

        @Deprecated
        public final boolean addAll​(java.util.Collection<? extends E> newElements)
        Deprecated.
        Modification operation are not supported.
        Will throw an exception and leave the collection unmodified.
        Specified by:
        addAll in interface java.util.Collection<E extends OrdinalValue<E>>
        Specified by:
        addAll in interface java.util.Set<E extends OrdinalValue<E>>
        Overrides:
        addAll in class com.google.common.collect.ForwardingCollection<E extends OrdinalValue<E>>
        Throws:
        java.lang.UnsupportedOperationException - always
      • removeAll

        @Deprecated
        public final boolean removeAll​(java.util.Collection<?> oldElements)
        Deprecated.
        Modification operation are not supported.
        Will throw an exception and leave the collection unmodified.
        Specified by:
        removeAll in interface java.util.Collection<E extends OrdinalValue<E>>
        Specified by:
        removeAll in interface java.util.Set<E extends OrdinalValue<E>>
        Overrides:
        removeAll in class com.google.common.collect.ForwardingCollection<E extends OrdinalValue<E>>
        Throws:
        java.lang.UnsupportedOperationException - always
      • retainAll

        @Deprecated
        public final boolean retainAll​(java.util.Collection<?> elementsToKeep)
        Deprecated.
        Modification operation are not supported.
        Will throw an exception and leave the collection unmodified.
        Specified by:
        retainAll in interface java.util.Collection<E extends OrdinalValue<E>>
        Specified by:
        retainAll in interface java.util.Set<E extends OrdinalValue<E>>
        Overrides:
        retainAll in class com.google.common.collect.ForwardingCollection<E extends OrdinalValue<E>>
        Throws:
        java.lang.UnsupportedOperationException - always
      • clear

        @Deprecated
        public final void clear()
        Deprecated.
        Modification operation are not supported.
        Will throw an exception and leave the collection unmodified.
        Specified by:
        clear in interface java.util.Collection<E extends OrdinalValue<E>>
        Specified by:
        clear in interface java.util.Set<E extends OrdinalValue<E>>
        Overrides:
        clear in class com.google.common.collect.ForwardingCollection<E extends OrdinalValue<E>>
        Throws:
        java.lang.UnsupportedOperationException - always
      • incrementCounters

        public abstract void incrementCounters​(int[] counters)
        Coarse grained method to effectively collect containment information without re-packing internal structures to temporary collections.

        For any contained element, corresponding value in array by ordinal index will be incremented.

        Parameters:
        counters - array of counters where indexes corresponds to ordinal values
        Throws:
        java.lang.RuntimeException - if counters array length do not correspond to ordinal indexes of contained values
      • containsAny

        public boolean containsAny​(java.util.Collection<?> collection)