Class OAVAttributeType

  • Direct Known Subclasses:
    OAVJavaAttributeType

    public class OAVAttributeType
    extends java.lang.Object
    Type definition for an attribute of objects stored as OAV triples. Type handling is useful for debugging and may be ignored for performance in production environments.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Object def
      The default value (only supported for single-valued attributes).
      protected int hashcode
      Hash code (cached for speed).
      protected OAVAttributeType idxattr
      The index attribute (used for fetching the key value of an oav object).
      static java.lang.String LIST
      Constant for list multiplicity.
      static java.lang.String MAP
      Constant for map multiplicity.
      protected java.lang.String mult
      The multiplicity type.
      static java.util.Set MULTIPLICITIES_ALL
      Set of all multiplicity types (->use an enum).
      static java.util.Set MULTIPLICITIES_MAPS
      Set of map multiplicity types.
      static java.util.Set MULTIPLICITIES_MULT
      Set of collection multiplicity types.
      protected java.lang.String name
      The name of the OAV attribute type.
      static java.lang.String NONE
      Constants for no multiplicity.
      static OAVAttributeType OBJECTTYPE  
      static java.lang.String ORDEREDMAP
      Constant for an ordered map multiplicity.
      protected OAVObjectType otype
      The object type having the attribute.
      static java.lang.String QUEUE
      Constants for queue multiplicity.
      static java.lang.String SET
      Constant for set multiplicity.
      protected OAVObjectType type
      The type.
    • Field Detail

      • NONE

        public static final java.lang.String NONE
        Constants for no multiplicity.
        See Also:
        Constant Field Values
      • QUEUE

        public static final java.lang.String QUEUE
        Constants for queue multiplicity.
        See Also:
        Constant Field Values
      • LIST

        public static final java.lang.String LIST
        Constant for list multiplicity.
        See Also:
        Constant Field Values
      • SET

        public static final java.lang.String SET
        Constant for set multiplicity.
        See Also:
        Constant Field Values
      • MAP

        public static final java.lang.String MAP
        Constant for map multiplicity.
        See Also:
        Constant Field Values
      • ORDEREDMAP

        public static final java.lang.String ORDEREDMAP
        Constant for an ordered map multiplicity.
        See Also:
        Constant Field Values
      • MULTIPLICITIES_ALL

        public static final java.util.Set MULTIPLICITIES_ALL
        Set of all multiplicity types (->use an enum).
      • MULTIPLICITIES_MULT

        public static final java.util.Set MULTIPLICITIES_MULT
        Set of collection multiplicity types.
      • MULTIPLICITIES_MAPS

        public static final java.util.Set MULTIPLICITIES_MAPS
        Set of map multiplicity types.
      • otype

        protected OAVObjectType otype
        The object type having the attribute.
      • name

        protected java.lang.String name
        The name of the OAV attribute type.
      • mult

        protected java.lang.String mult
        The multiplicity type.
      • def

        protected java.lang.Object def
        The default value (only supported for single-valued attributes).
      • idxattr

        protected OAVAttributeType idxattr
        The index attribute (used for fetching the key value of an oav object).
      • hashcode

        protected final int hashcode
        Hash code (cached for speed).
    • Constructor Detail

      • OAVAttributeType

        protected OAVAttributeType​(OAVObjectType otype,
                                   java.lang.String name,
                                   OAVObjectType type,
                                   java.lang.String mult,
                                   java.lang.Object def,
                                   OAVAttributeType idxattr)
        Create a new OAV attribute type.
        Parameters:
        otype - The object type holding the attribute.
        name - The name of the OAV attribute type.
        mult - The multiplicity.
        type - The type.
        def - The default value.
    • Method Detail

      • getObjectType

        public OAVObjectType getObjectType()
        Get the object type (the type of the object holding this attribute).
        Returns:
        The objecttype.
      • getName

        public java.lang.String getName()
        Get the name of the OAV attribute type.
        Returns:
        The name of the OAV attribute type.
      • getMultiplicity

        public java.lang.String getMultiplicity()
        Get the multiplicity.
        Returns:
        The multiplicity.
      • getType

        public OAVObjectType getType()
        Get the attribute type (the type of the value stored via this attribute).
        Returns:
        The type.
      • getDefaultValue

        public java.lang.Object getDefaultValue()
        Get the default value.
        Returns:
        The default value.
      • getIndexAttribute

        public OAVAttributeType getIndexAttribute()
        Get the index attribute.
        Returns:
        The index attribute.
      • toString

        public java.lang.String toString()
        Get the string representation.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation.
      • hashCode

        public final int hashCode()
        Compute the hashcode.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hashcode.
      • calcHashCode

        protected int calcHashCode()
        Compute the hashcode.
        Returns:
        The hashcode.
      • equals

        public boolean equals​(java.lang.Object obj)
        Test for equality.
        Overrides:
        equals in class java.lang.Object
        Returns:
        True, if equal.