Class XLogImpl

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<XTrace>, java.util.Collection<XTrace>, java.util.List<XTrace>, java.util.RandomAccess, XAttributable, XElement, XLog

    public class XLogImpl
    extends java.util.ArrayList<XTrace>
    implements XLog
    Implementation for the XLog interface.
    Author:
    Christian W. Guenther (christian@deckfour.org)
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      XLogImpl​(XAttributeMap attributeMap)
      Creates a new log.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accept​(XVisitor visitor)  
      java.lang.Object clone()
      Creates an identical copy of this element.
      XAttributeMap getAttributes()
      Retrieves the attributes set for this element.
      java.util.List<XEventClassifier> getClassifiers()
      This method returns the list of classifiers defined for this log.
      java.util.Set<XExtension> getExtensions()
      Retrieves the extensions used by this element, i.e.
      java.util.List<XAttribute> getGlobalEventAttributes()
      This method returns a list of attributes which are global for all events, i.e.
      java.util.List<XAttribute> getGlobalTraceAttributes()
      This method returns a list of attributes which are global for all traces, i.e.
      XLogInfo getInfo​(XEventClassifier classifier)
      Returns the cached info if the given classifier is the cached classifier.
      boolean hasAttributes()
      Checks for the existence of attributes.
      void setAttributes​(XAttributeMap attributes)
      Sets the map of attributes for this element.
      void setInfo​(XEventClassifier classifier, XLogInfo info)
      Sets the cached classifier and info to the given objects.
      • Methods inherited from class java.util.ArrayList

        add, add, addAll, addAll, clear, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
      • Methods inherited from class java.util.AbstractCollection

        containsAll, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
    • Constructor Detail

      • XLogImpl

        public XLogImpl​(XAttributeMap attributeMap)
        Creates a new log.
        Parameters:
        attributeMap - The attribute map used to store this log's attributes.
    • Method Detail

      • setAttributes

        public void setAttributes​(XAttributeMap attributes)
        Description copied from interface: XAttributable
        Sets the map of attributes for this element.
        Specified by:
        setAttributes in interface XAttributable
        Parameters:
        attributes - A map of attributes.
      • hasAttributes

        public boolean hasAttributes()
        Description copied from interface: XAttributable
        Checks for the existence of attributes. This method can be a more efficient way of checking for the existance of attributes than using XAttributable.getAttributes() in certain situations.
        Specified by:
        hasAttributes in interface XAttributable
        Returns:
        whether this element has any attributes
      • getExtensions

        public java.util.Set<XExtension> getExtensions()
        Description copied from interface: XAttributable
        Retrieves the extensions used by this element, i.e. the extensions used by all attributes of this element, and the element itself.
        Specified by:
        getExtensions in interface XAttributable
        Returns:
        A set of extensions.
      • clone

        public java.lang.Object clone()
        Description copied from interface: XElement
        Creates an identical copy of this element.
        Specified by:
        clone in interface XElement
        Overrides:
        clone in class java.util.ArrayList<XTrace>
        Returns:
        An identical clone.
      • getClassifiers

        public java.util.List<XEventClassifier> getClassifiers()
        Description copied from interface: XLog
        This method returns the list of classifiers defined for this log. This list can be used for reading or writing, i.e., it must be supported to add further classifiers to this list.
        Specified by:
        getClassifiers in interface XLog
        Returns:
        The list of classifiers defined for this log.
      • getGlobalEventAttributes

        public java.util.List<XAttribute> getGlobalEventAttributes()
        Description copied from interface: XLog
        This method returns a list of attributes which are global for all events, i.e. every event in the log is guaranteed to have these attributes.
        Specified by:
        getGlobalEventAttributes in interface XLog
        Returns:
        List of ubiquitous event attributes.
      • getGlobalTraceAttributes

        public java.util.List<XAttribute> getGlobalTraceAttributes()
        Description copied from interface: XLog
        This method returns a list of attributes which are global for all traces, i.e. every trace in the log is guaranteed to have these attributes.
        Specified by:
        getGlobalTraceAttributes in interface XLog
        Returns:
        List of ubiquitous trace attributes.
      • accept

        public boolean accept​(XVisitor visitor)
        Specified by:
        accept in interface XLog
      • getInfo

        public XLogInfo getInfo​(XEventClassifier classifier)
        Returns the cached info if the given classifier is the cached classifier. Returns null otherwise.
        Specified by:
        getInfo in interface XLog
        Parameters:
        classifier - The given classifier.
        Returns:
        The cached info for the given classifier, null if not available.
      • setInfo

        public void setInfo​(XEventClassifier classifier,
                            XLogInfo info)
        Sets the cached classifier and info to the given objects.
        Specified by:
        setInfo in interface XLog
        Parameters:
        classifier - The given classifier.
        info - The given info.