Class AbstractDataContainer<T extends DataPoint>

    • Field Detail

      • m_ID

        protected String m_ID
        the ID of the sequence.
      • m_UUID

        protected long m_UUID
        the unique ID.
    • Constructor Detail

      • AbstractDataContainer

        public AbstractDataContainer()
        Initializes the container.
    • Method Detail

      • setID

        public void setID​(String value)
        Sets the ID of the sequence.
        Specified by:
        setID in interface MutableIDHandler
        Parameters:
        value - the new ID
      • getID

        public String getID()
        Returns the ID of the sequence.
        Specified by:
        getID in interface IDHandler
        Returns:
        the ID
      • getUniqueID

        public long getUniqueID()
        Returns the unique ID.
        Specified by:
        getUniqueID in interface UniqueIDHandler
        Returns:
        the ID
      • assign

        public void assign​(DataContainer<T> other)
        Obtains the stored variables from the other data point, but not the actual data points.
        Specified by:
        assign in interface DataContainer<T extends DataPoint>
        Parameters:
        other - the data point to get the values from
      • compareToHeader

        public int compareToHeader​(Object o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Specified by:
        compareToHeader in interface DataContainer<T extends DataPoint>
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • compareToData

        public int compareToData​(Object o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Specified by:
        compareToData in interface DataContainer<T extends DataPoint>
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • equalsData

        public boolean equalsData​(Object obj)
        Indicates whether some other container's header is "equal to" this ones.
        Specified by:
        equalsData in interface DataContainer<T extends DataPoint>
        Parameters:
        obj - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument; false otherwise.
      • compareTo

        public int compareTo​(Object o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Specified by:
        compareTo in interface Comparable<T extends DataPoint>
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • equalsHeader

        public boolean equalsHeader​(Object obj)
        Indicates whether some other chromatogram's header is "equal to" this ones.
        Specified by:
        equalsHeader in interface DataContainer<T extends DataPoint>
        Parameters:
        obj - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument; false otherwise.
      • equals

        public boolean equals​(Object obj)
        Indicates whether some other object is "equal to" this one.
        Specified by:
        equals in interface Collection<T extends DataPoint>
        Overrides:
        equals in class Object
        Parameters:
        obj - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument; false otherwise.
      • modifiedListener

        protected boolean modifiedListener​(boolean modified)
        Method that gets notified about changes in the collection of data points. Just passes the modified state through.

        The default implementation only passes the value through.
        Parameters:
        modified - whether the action modified the collection
        Returns:
        the same as the input
      • isEmpty

        public boolean isEmpty()
        Returns whether the DataContainer is empty.
        Specified by:
        isEmpty in interface Collection<T extends DataPoint>
        Returns:
        true if empty
      • ensureCapacity

        public void ensureCapacity​(int minCapacity)
        Ensures that the capacity is at least the specified minimum.
        Parameters:
        minCapacity - the minimum capacity that the container should have for storing data points
      • trimToSize

        public void trimToSize()
        Trims the capacity of this container to be the container's current size.
      • add

        public boolean add​(T point)
        Adds the point to the list of points.
        Specified by:
        add in interface Collection<T extends DataPoint>
        Parameters:
        point - the point to add
        Returns:
        true if the points changed
      • addAll

        public boolean addAll​(Collection points)
        Adds all the points to the list of points.
        Specified by:
        addAll in interface Collection<T extends DataPoint>
        Parameters:
        points - the points to add
        Returns:
        true if the points changed
      • remove

        public boolean remove​(Object point)
        Removes the given point from its list of points.
        Specified by:
        remove in interface Collection<T extends DataPoint>
        Parameters:
        point - the point to remove
        Returns:
        true if the points changed
      • removeAll

        public boolean removeAll​(Collection points)
        Removes all the points from the list of points.
        Specified by:
        removeAll in interface Collection<T extends DataPoint>
        Parameters:
        points - the points to remove
        Returns:
        true if the points changed
      • contains

        public boolean contains​(Object point)
        Checks whether the given point is already stored.
        Specified by:
        contains in interface Collection<T extends DataPoint>
        Parameters:
        point - the point to check
        Returns:
        true if point already exists in list
      • containsAll

        public boolean containsAll​(Collection points)
        Checks whether all the given points are already stored.
        Specified by:
        containsAll in interface Collection<T extends DataPoint>
        Parameters:
        points - the points to check
        Returns:
        true if points already exist in list
      • retainAll

        public boolean retainAll​(Collection points)
        Retains all the given points and removes the others.
        Specified by:
        retainAll in interface Collection<T extends DataPoint>
        Parameters:
        points - the points to keep
        Returns:
        true if points changed
      • size

        public int size()
        Returns the number of points stored in the DataContainer.
        Specified by:
        size in interface Collection<T extends DataPoint>
        Returns:
        the number of points
      • mergeWith

        public void mergeWith​(DataContainer other)
        Adds copies of all the points from the given container to its own. No will get overwritten, only added.
        Specified by:
        mergeWith in interface Mergeable<T extends DataPoint>
        Parameters:
        other - the container to merge with
      • toArray

        public Object[] toArray()
        Returns the stored points as array.
        Specified by:
        toArray in interface Collection<T extends DataPoint>
        Returns:
        the points as array
      • toArray

        public Object[] toArray​(Object[] array)
        Returns the stored points as array.
        Specified by:
        toArray in interface Collection<T extends DataPoint>
        Parameters:
        array - the array into which the points of this DataContainer are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
        Returns:
        the points as array
      • toList

        public List<T> toList()
        Returns a list with the points. Very fast, as it only returns the internal linked list.
        Specified by:
        toList in interface DataContainer<T extends DataPoint>
        Returns:
        a list with all the points
      • toTreeSet

        public TreeSet<T> toTreeSet​(DataPointComparator comparator)
        Returns a treeset with the points, sorted according to the given comparator.
        Specified by:
        toTreeSet in interface DataContainer<T extends DataPoint>
        Parameters:
        comparator - the comparator to use
        Returns:
        a treeset with all the points
      • hashCode

        public int hashCode()
        Returns the hash code for this DataContainer.
        Specified by:
        hashCode in interface Collection<T extends DataPoint>
        Overrides:
        hashCode in class Object
        Returns:
        the hash code
      • toString

        public String toString()
        Returns a string representation of the DataContainer.
        Overrides:
        toString in class Object
        Returns:
        the string representation
      • newInstance

        public static DataContainer newInstance​(DataContainer cont)
        Returns a new (empty) instance of the same class as the specified container.
        Parameters:
        cont - the container to use as a class template
        Returns:
        the instance or null in case of an error