Package cdc.enums

Interface MaskSupport<M extends Mask<M,​V>,​V>

  • Type Parameters:
    M - The mask type.
    V - The value type.

    public interface MaskSupport<M extends Mask<M,​V>,​V>
    Interface describing a mask type.
    Author:
    Damien Carbonne
    • Method Detail

      • getMaskClass

        Class<M> getMaskClass()
        Returns:
        The mask class.
      • getType

        ListType<V> getType()
        Returns:
        The associated List type.
      • isNullable

        boolean isNullable()
        Returns:
        true if null is a valid mask value.
      • empty

        M empty()
        Returns:
        The empty mask.
      • full

        M full()
        Returns:
        The fill mask (at the time of call).
      • create

        M create()
        Returns:
        The empty mask.
      • create

        M create​(V value)
        Creates a mask with one value.
        Parameters:
        value - The value.
        Returns:
        The mask that contains value.
      • create

        M create​(V... values)
        Creates a mask from an array.
        Parameters:
        values - The values (possibly including null).
        Returns:
        The created mask.
      • create

        M create​(Iterable<V> values)
        Creates a mask from an iterable.
        Parameters:
        values - The values (possibly including null).
        Returns:
        The created mask.
      • create

        M create​(Predicate<V> predicate)
        Creates a mask from a predicate.
        Parameters:
        predicate - A predicate of values to include.
        Returns:
        The created mask.
      • create

        M create​(boolean enabled)
        Creates a full or empty mask.

        WARNING: Full is meaningful at the time of calling this constructor. It may become false if values change after this call.

        Parameters:
        enabled - If true, creates a full mask. An empty mask otherwise.
        Returns:
        The created mask.
      • newSet

        Set<V> newSet​(int size)
        Creates a Set that is compliant with implementation.

        This allows using the best implementation.

        Parameters:
        size - The initial set size.
        Returns:
        A new Set.