Class ContentType<T>

  • Type Parameters:
    T - the type of values that the content type is used for
    All Implemented Interfaces:
    IDescribable, IType<T>
    Direct Known Subclasses:
    KindOfQuantity, StructContentType

    public class ContentType<T>
    extends Object
    implements IType<T>
    A content type describes what kind of data a value is. It's not specific unit, like seconds/minutes or bytes/MB, but it could be time or memory.

    Data values of the same content type should be able share a single axis in a graph.

    • Field Detail

      • m_identifier

        protected final String m_identifier
    • Constructor Detail

      • ContentType

        public ContentType​(String identifier,
                           String localizedName)
    • Method Detail

      • getDefaultFormatter

        public IFormatter<T> getDefaultFormatter()
      • getIdentifier

        public String getIdentifier()
        Description copied from interface: IType
        String identifying the type. It must never be localized and it should only contain characters that are safe to use in various configuration files, e.g. in XML.
        Specified by:
        getIdentifier in interface IType<T>
        type identifier
      • getAccessorKeys

        public Map<IAccessorKey<?>,​? extends IDescribable> getAccessorKeys()
        Description copied from interface: IType
        Get keys for the accessors that this type knows of. Note that the returned accessors does not necessarily cover all possible data from the items of this type, and that it is always possible to define additional accessors that get or calculate values from the items in non-standard ways.

        Should only be used for low level type inspection. Iterators etc. should use a collection of predefined attributes.

        Specified by:
        getAccessorKeys in interface IType<T>
        keys for the accessors defined for this type
      • hasAttribute

        public boolean hasAttribute​(ICanonicalAccessorFactory<?> attribute)
        Description copied from interface: IType
        Tell if attribute can return an accessor for this type. This method is semantically equivalent to attribute.getAccessor(type) != null, but may be cheaper.
        Specified by:
        hasAttribute in interface IType<T>
        attribute - attribute to check
        true if the attribute can return an accessor for this type, false if not
      • getAccessor

        public <M> IMemberAccessor<M,​T> getAccessor​(IAccessorKey<M> attribute)
        Description copied from interface: IType
        Internal low-level mechanism for retrieving a member accessor for a type, or null if not available.

        This is only intended to be used by implementors of IAccessorFactory. All other usage should be replaced with ICanonicalAccessorFactory.getAccessor(IType) call to pre-defined accessors.

        Specified by:
        getAccessor in interface IType<T>
        Type Parameters:
        M - accessor value type
        attribute - the identifier for the field
        a member accessor
      • lookupNameFor

        protected static String lookupNameFor​(String typeIdentifier)