Class XTraceImpl

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

    public class XTraceImpl
    extends java.util.ArrayList<XEvent>
    implements XTrace
    Memory-based implementation for the XTrace 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
      XTraceImpl​(XAttributeMap attributeMap)
      Creates a new trace.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(XVisitor visitor, XLog log)  
      java.lang.Object clone()
      Creates a clone, i.e.
      XAttributeMap getAttributes()
      Retrieves the attributes set for this element.
      java.util.Set<XExtension> getExtensions()
      Retrieves the extensions used by this element, i.e.
      boolean hasAttributes()
      Checks for the existence of attributes.
      int insertOrdered​(XEvent event)
      Insert the event in an ordered manner, if timestamp information is available in this trace.
      void setAttributes​(XAttributeMap attributes)
      Sets the map of attributes for this element.
      • 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

      • XTraceImpl

        public XTraceImpl​(XAttributeMap attributeMap)
        Creates a new trace.
        Parameters:
        attributeMap - Attribute map used to store this trace's attributes.
    • Method Detail

      • 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.
      • 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
      • clone

        public java.lang.Object clone()
        Creates a clone, i.e. deep copy, of this trace.
        Specified by:
        clone in interface XElement
        Overrides:
        clone in class java.util.ArrayList<XEvent>
        Returns:
        An identical clone.
      • insertOrdered

        public int insertOrdered​(XEvent event)
        Description copied from interface: XTrace
        Insert the event in an ordered manner, if timestamp information is available in this trace.
        Specified by:
        insertOrdered in interface XTrace
        Parameters:
        event - the event to be inserted.
        Returns:
        index of the inserted event.