Class EquatableValueSet

  • All Implemented Interfaces:
    ValueSet, AutoCloseable

    public class EquatableValueSet
    extends Object
    implements ValueSet
    A set containing values that are uniquely identifiable. Assumes an infinite number of possible values. The values may be collectively included (aka whitelist) or collectively excluded (aka !whitelist).
    See Also:
    ValueSet
    • Field Detail

      • nullAllowed

        public final boolean nullAllowed
    • Constructor Detail

      • EquatableValueSet

        public EquatableValueSet​(Block valueBlock,
                                 boolean whiteList,
                                 boolean nullAllowed)
        Constructs a new EquatableValueSet.
        Parameters:
        valueBlock - The values that are in this ValueSet expressed as a Block of Apache Arrow records.
        whiteList - True if this ValueSet is a white list (only these values), False if these are excluded values.
        nullAllowed - True if null values should be considered part of this ValueSet, False otherwise.
    • Method Detail

      • newBuilder

        public static EquatableValueSet.Builder newBuilder​(BlockAllocator allocator,
                                                           org.apache.arrow.vector.types.pojo.ArrowType type,
                                                           boolean isWhiteList,
                                                           boolean nullAllowed)
        Used to construct new Builder for EquatableValueSet.
        Parameters:
        allocator - The BlockAllocator to use when allocating Apache Arrow resources.
        type - The type of the field that this EquatableValueSet will apply to.
        isWhiteList - True if the EquatableValueSet will be a whitelist.
        nullAllowed - True if the EquatableValueSet should include NULL.
        Returns:
        A new Builder that can be used to add values and create a new EquatableValueSet.
      • isNullAllowed

        public boolean isNullAllowed()
        Conveys if nulls should be allowed.
        Specified by:
        isNullAllowed in interface ValueSet
        Returns:
        True if NULLs satisfy this constraint, false otherwise.
        See Also:
        ValueSet
      • getSchema

        protected org.apache.arrow.vector.types.pojo.Schema getSchema()
      • getValueBlock

        public Block getValueBlock()
        Provides access to all the values in this ValueSet.
        Returns:
        The Block of Apache Arrow records in this ValueSet.
      • getType

        public org.apache.arrow.vector.types.pojo.ArrowType getType()
        The Arrow Type of the field this constraint applies to.
        Specified by:
        getType in interface ValueSet
        Returns:
        The ArrowType of the field this ValueSet applies to.
        See Also:
        ValueSet
      • isWhiteList

        public boolean isWhiteList()
        Conveys if this ValueSet if a white list.
        Returns:
        True if the values in this ValueSet are part of a whitelist (e.g. list of values to include) vs a list of * values to exclude.
      • getValues

        public Block getValues()
        Provides access to all the values in this ValueSet.
        Returns:
        The Block of Apache Arrow records in this ValueSet.
      • getValue

        public Object getValue​(int pos)
        Retrieves the value at a specific position in this ValueSet.
        Parameters:
        pos - The position to retrieve, should be < size of ValueSet
        Returns:
        The value at that position.
      • isNone

        public boolean isNone()
        Conveys if no value can satisfy this ValueSet.
        Specified by:
        isNone in interface ValueSet
        Returns:
        True if no value can satisfy this ValueSet, false otherwise.
        See Also:
        ValueSet
      • isAll

        public boolean isAll()
        Conveys if any value can satisfy this ValueSet.
        Specified by:
        isAll in interface ValueSet
        Returns:
        True if any value can satisfy this ValueSet, false otherwise.
        See Also:
        ValueSet
      • isSingleValue

        public boolean isSingleValue()
        Conveys if this ValueSet contains a single value.
        Specified by:
        isSingleValue in interface ValueSet
        Returns:
        True if this ValueSet contains only a single value.
      • getSingleValue

        public Object getSingleValue()
        Attempts to return the single value contained in this ValueSet.
        Specified by:
        getSingleValue in interface ValueSet
        Returns:
        The single value contained in this ValueSet.
        Throws:
        IllegalStateException - if this ValueSet does not contain exactly 1 value.
      • containsValue

        public boolean containsValue​(Marker marker)
        Used to test if the supplied value (in the form of a Marker) is contained in this ValueSet.
        Specified by:
        containsValue in interface ValueSet
        Parameters:
        marker - The value to test in the form of a Marker.
        Returns:
        True if the value is contained in the ValueSet, False otherwise.
      • containsValue

        public boolean containsValue​(Object value)
        Used to test if the supplied value is contained in this ValueSet.
        Specified by:
        containsValue in interface ValueSet
        Parameters:
        value - The value to test.
        Returns:
        True if the value is contained in the ValueSet, False otherwise.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object