Class BagDatatype<AV extends AttributeValue>

  • Type Parameters:
    AV - Java type implementing this datatype (instance type)

    public class BagDatatype<AV extends AttributeValue>
    extends Datatype<Bag<AV>>
    Bag datatype for bags of primitive datatypes
    • Method Detail

      • isInstance

        public boolean isInstance​(Value val)
        Description copied from class: Datatype
        This method returns true if the specified value argument is an instance of the represented datatype; it returns false otherwise
        Specified by:
        isInstance in class Datatype<Bag<AV extends AttributeValue>>
        Parameters:
        val - value to be checked
        Returns:
        true iff val is an instance of this datatype
      • cast

        public Bag<AV> cast​(Value val)
                     throws ClassCastException
        Description copied from class: Datatype
        Casts a value to the class or interface represented by this datatype.
        Specified by:
        cast in class Datatype<Bag<AV extends AttributeValue>>
        Parameters:
        val - value to be cast
        Returns:
        the value after casting, or null if val is null
        Throws:
        ClassCastException - if the value is not null and is not assignable to the type V.
      • getTypeParameter

        public Optional<? extends Datatype<?>> getTypeParameter()
        Description copied from class: Datatype
        Return type parameter e.g. the bag element datatype (datatype of every element in a bag of this datatype); null if this is a primitive type (no sub-elements)
        Specified by:
        getTypeParameter in class Datatype<Bag<AV extends AttributeValue>>
        Returns:
        datatype parameter, null for primitive datatypes
      • newArray

        public Bag<AV>[] newArray​(int length)
        Description copied from class: Datatype
        Creates a new array with this as component type
        Specified by:
        newArray in class Datatype<Bag<AV extends AttributeValue>>
        Parameters:
        length - length of the new array
        Returns:
        the new array
      • getElementType

        public Datatype<AV> getElementType()
        Returns the bag element datatype (datatype of every element in a bag of this datatype). Same as getTypeParameter().
        Returns:
        bag element datatype