Class XAttributeInfoImpl

  • All Implemented Interfaces:
    XAttributeInfo

    public class XAttributeInfoImpl
    extends java.lang.Object
    implements XAttributeInfo
    This class provides aggregate information about attributes within one container in the log type hierarchy. For example, it may store information about all event attributes in a log.
    Author:
    Christian W. Guenther (christian@deckfour.org)
    • Constructor Summary

      Constructors 
      Constructor Description
      XAttributeInfoImpl()
      Creates a new attribute information registry.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Collection<java.lang.String> getAttributeKeys()
      Provides access to prototypes of all registered attributes' keys.
      java.util.Collection<XAttribute> getAttributes()
      Provides access to prototypes of all registered attributes.
      java.util.Collection<XAttribute> getAttributesForExtension​(XExtension extension)
      For a given extension, returns prototypes of all registered attributes defined by that extension.
      java.util.Collection<XAttribute> getAttributesForType​(java.lang.Class<? extends XAttribute> type)
      For a given type, returns prototypes of all registered attributes with that type.
      java.util.Collection<XAttribute> getAttributesWithoutExtension()
      Returns prototypes of all registered attributes defined by no extension.
      int getFrequency​(java.lang.String key)
      Returns the total frequency, i.e.
      int getFrequency​(XAttribute attribute)
      Returns the total frequency, i.e.
      java.util.Collection<java.lang.String> getKeysForExtension​(XExtension extension)
      For a given extension, returns the keys of all registered attributes defined by that extension.
      java.util.Collection<java.lang.String> getKeysForType​(java.lang.Class<? extends XAttribute> type)
      For a given type, returns the keys of all registered attributes with that type.
      java.util.Collection<java.lang.String> getKeysWithoutExtension()
      Returns keys of all registered attributes defined by no extension.
      double getRelativeFrequency​(java.lang.String key)
      Returns the relative frequency, i.e.
      double getRelativeFrequency​(XAttribute attribute)
      Returns the relative frequency, i.e.
      void register​(XAttribute attribute)
      Registers a concrete attribute with this registry.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XAttributeInfoImpl

        public XAttributeInfoImpl()
        Creates a new attribute information registry.
    • Method Detail

      • getAttributes

        public java.util.Collection<XAttribute> getAttributes()
        Description copied from interface: XAttributeInfo
        Provides access to prototypes of all registered attributes.
        Specified by:
        getAttributes in interface XAttributeInfo
        Returns:
        A collection of attribute prototypes.
      • getAttributeKeys

        public java.util.Collection<java.lang.String> getAttributeKeys()
        Description copied from interface: XAttributeInfo
        Provides access to prototypes of all registered attributes' keys.
        Specified by:
        getAttributeKeys in interface XAttributeInfo
        Returns:
        A collection of attribute keys.
      • getFrequency

        public int getFrequency​(java.lang.String key)
        Description copied from interface: XAttributeInfo
        Returns the total frequency, i.e. number of occurrences, for the requested attribute.
        Specified by:
        getFrequency in interface XAttributeInfo
        Parameters:
        key - Key of an attribute.
        Returns:
        Total frequency of that attribute as registered.
      • getFrequency

        public int getFrequency​(XAttribute attribute)
        Description copied from interface: XAttributeInfo
        Returns the total frequency, i.e. number of occurrences, for the requested attribute.
        Specified by:
        getFrequency in interface XAttributeInfo
        Parameters:
        attribute - An attribute.
        Returns:
        Total frequency of that attribute as registered.
      • getRelativeFrequency

        public double getRelativeFrequency​(java.lang.String key)
        Description copied from interface: XAttributeInfo
        Returns the relative frequency, i.e. between 0 and 1, for the requested attribute.
        Specified by:
        getRelativeFrequency in interface XAttributeInfo
        Parameters:
        key - Key of an attribute.
        Returns:
        Relative frequency of that attribute as registered.
      • getRelativeFrequency

        public double getRelativeFrequency​(XAttribute attribute)
        Description copied from interface: XAttributeInfo
        Returns the relative frequency, i.e. between 0 and 1, for the requested attribute.
        Specified by:
        getRelativeFrequency in interface XAttributeInfo
        Parameters:
        attribute - An attribute.
        Returns:
        Relative frequency of that attribute as registered.
      • getAttributesForType

        public java.util.Collection<XAttribute> getAttributesForType​(java.lang.Class<? extends XAttribute> type)
        Description copied from interface: XAttributeInfo
        For a given type, returns prototypes of all registered attributes with that type.
        Specified by:
        getAttributesForType in interface XAttributeInfo
        Parameters:
        type - Requested attribute type (type-specific attribute interface class).
        Returns:
        A collection of attribute prototypes registered for that type.
      • getKeysForType

        public java.util.Collection<java.lang.String> getKeysForType​(java.lang.Class<? extends XAttribute> type)
        Description copied from interface: XAttributeInfo
        For a given type, returns the keys of all registered attributes with that type.
        Specified by:
        getKeysForType in interface XAttributeInfo
        Parameters:
        type - Requested attribute type (type-specific attribute interface class).
        Returns:
        A collection of attribute keys registered for that type.
      • getAttributesForExtension

        public java.util.Collection<XAttribute> getAttributesForExtension​(XExtension extension)
        Description copied from interface: XAttributeInfo
        For a given extension, returns prototypes of all registered attributes defined by that extension.
        Specified by:
        getAttributesForExtension in interface XAttributeInfo
        Parameters:
        extension - Requested attribute extension.
        Returns:
        A collection of attribute prototypes registered for that extension.
      • getKeysForExtension

        public java.util.Collection<java.lang.String> getKeysForExtension​(XExtension extension)
        Description copied from interface: XAttributeInfo
        For a given extension, returns the keys of all registered attributes defined by that extension.
        Specified by:
        getKeysForExtension in interface XAttributeInfo
        Parameters:
        extension - Requested attribute extension.
        Returns:
        A collection of attribute keys registered for that extension.
      • getAttributesWithoutExtension

        public java.util.Collection<XAttribute> getAttributesWithoutExtension()
        Description copied from interface: XAttributeInfo
        Returns prototypes of all registered attributes defined by no extension.
        Specified by:
        getAttributesWithoutExtension in interface XAttributeInfo
        Returns:
        A collection of attribute prototypes registered for no extension.
      • getKeysWithoutExtension

        public java.util.Collection<java.lang.String> getKeysWithoutExtension()
        Description copied from interface: XAttributeInfo
        Returns keys of all registered attributes defined by no extension.
        Specified by:
        getKeysWithoutExtension in interface XAttributeInfo
        Returns:
        A collection of attribute keys registered for no extension.
      • register

        public void register​(XAttribute attribute)
        Registers a concrete attribute with this registry.
        Parameters:
        attribute - Attribute to be registered.