Class L1Point

  • All Implemented Interfaces:
    adams.core.CloneHandler, adams.core.Mergeable<adams.data.container.DataContainer>, adams.core.UniqueIDHandler, adams.data.container.DataContainer<L2Point>, adams.data.container.DataPoint, adams.data.id.IDHandler, adams.data.id.MutableIDHandler, Serializable, Comparable, Iterable<L2Point>, Collection<L2Point>

    public class L1Point
    extends adams.data.container.AbstractDataContainer<L2Point>
    implements adams.data.container.DataPoint
    Level 1 data point.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static adams.data.container.DataPointComparator<L2Point> m_Comparator
      the default comparator.
      protected L2Point m_MaxX
      point of greatest x.
      protected L2Point m_MaxY
      point of greatest y.
      protected L2Point m_MinX
      point of smallest x.
      protected L2Point m_MinY
      point of smallest y.
      protected ThreeWayData m_Parent
      the parent.
      protected double m_X
      x.
      protected double m_Y
      y.
      • Fields inherited from class adams.data.container.AbstractDataContainer

        m_ID, m_Points, m_UUID
    • Constructor Summary

      Constructors 
      Constructor Description
      L1Point()
      Constructor.
      L1Point​(double x, double y)
      Constructor.
      L1Point​(ThreeWayData parent, double x, double y)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(double x, double y)
      Add a L2Point.
      void assign​(adams.data.container.DataContainer<L2Point> other)
      Obtains the stored variables from the other data point, but not the actual data points.
      void assign​(adams.data.container.DataPoint other)
      Obtains the stored variables from the other data point.
      int compareToHeader​(Object o)
      Compares this object with the specified object for order.
      L2Point find​(double z)
      Returns the L2Point with the exact x, null if not found.
      L2Point findClosest​(double z)
      Returns the L2Point with the z closest to the one provided.
      Object getClone()
      Returns a clone of itself.
      adams.data.container.DataPointComparator<L2Point> getComparator()
      Returns the comparator in use.
      L2Point getMaxX()
      Get point with greatest X.
      L2Point getMaxY()
      Get point with greatest X.
      L2Point getMinX()
      Get point with smallest X.
      L2Point getMinY()
      Get point with smallest Y.
      adams.data.container.DataContainer getParent()
      Returns the parent this point belongs to.
      double getX()
      Return the X.
      double getY()
      Returns the Y.
      boolean hasParent()
      Returns whether the point has a parent.
      protected void invalidateMinMax()
      Invalidates the min/max abundance/timestamp points.
      protected boolean modifiedListener​(boolean modified)
      Method that gets notified about changes in the collection of data points.
      adams.data.container.DataPointComparator<L2Point> newComparator()
      Returns a new instance of the default comparator.
      L2Point newPoint()
      Returns a new instance of a DataContainer point.
      void setParent​(adams.data.container.DataContainer value)
      Sets the parent this point belongs to.
      void setX​(double x)
      Set the X.
      void setY​(double value)
      Sets the Y.
      L1PointStatistic toStatistic()
      Returns a statistic object of this GC point.
      String toString()
      Returns a string representation of the GC points.
      protected void validateMinMax()
      Initializes the min/max abundance/timestmap points.
      • Methods inherited from class adams.data.container.AbstractDataContainer

        add, addAll, clear, compareTo, compareToData, contains, containsAll, ensureCapacity, equals, equalsData, equalsHeader, getHeader, getID, getUniqueID, hashCode, isEmpty, iterator, mergeWith, newInstance, remove, removeAll, retainAll, setID, size, toArray, toArray, toList, toList, toTreeSet, toTreeSet, trimToSize
    • Field Detail

      • m_X

        protected double m_X
        x.
      • m_Y

        protected double m_Y
        y.
      • m_MaxX

        protected L2Point m_MaxX
        point of greatest x.
      • m_MinX

        protected L2Point m_MinX
        point of smallest x.
      • m_MaxY

        protected L2Point m_MaxY
        point of greatest y.
      • m_MinY

        protected L2Point m_MinY
        point of smallest y.
      • m_Comparator

        protected static adams.data.container.DataPointComparator<L2Point> m_Comparator
        the default comparator.
    • Constructor Detail

      • L1Point

        public L1Point()
        Constructor.
      • L1Point

        public L1Point​(double x,
                       double y)
        Constructor.
        Parameters:
        x - the x
        y - the y
      • L1Point

        public L1Point​(ThreeWayData parent,
                       double x,
                       double y)
        Constructor.
        Parameters:
        parent - the parent
        x - the x
        y - the y
    • Method Detail

      • newComparator

        public adams.data.container.DataPointComparator<L2Point> newComparator()
        Returns a new instance of the default comparator.
        Specified by:
        newComparator in interface adams.data.container.DataContainer<L2Point>
        Returns:
        the comparator instance
      • getComparator

        public adams.data.container.DataPointComparator<L2Point> getComparator()
        Returns the comparator in use.
        Specified by:
        getComparator in interface adams.data.container.DataContainer<L2Point>
        Returns:
        the comparator in use
      • getClone

        public Object getClone()
        Returns a clone of itself. Sets the parent to null!
        Specified by:
        getClone in interface adams.core.CloneHandler
        Specified by:
        getClone in interface adams.data.container.DataContainer<L2Point>
        Specified by:
        getClone in interface adams.data.container.DataPoint
        Overrides:
        getClone in class adams.data.container.AbstractDataContainer<L2Point>
        Returns:
        the clone
      • assign

        public void assign​(adams.data.container.DataContainer<L2Point> other)
        Obtains the stored variables from the other data point, but not the actual data points.
        Specified by:
        assign in interface adams.data.container.DataContainer<L2Point>
        Overrides:
        assign in class adams.data.container.AbstractDataContainer<L2Point>
        Parameters:
        other - the data point to get the values from
      • modifiedListener

        protected boolean modifiedListener​(boolean modified)
        Method that gets notified about changes in the collection of data points.
        Overrides:
        modifiedListener in class adams.data.container.AbstractDataContainer<L2Point>
        Parameters:
        modified - whether the action modified the collection
        Returns:
        the same as the input
      • assign

        public void assign​(adams.data.container.DataPoint other)
        Obtains the stored variables from the other data point.
        Specified by:
        assign in interface adams.data.container.DataPoint
        Parameters:
        other - the data point to get the values from
      • newPoint

        public L2Point newPoint()
        Returns a new instance of a DataContainer point.
        Specified by:
        newPoint in interface adams.data.container.DataContainer<L2Point>
        Returns:
        the new DataContainer point
      • setParent

        public void setParent​(adams.data.container.DataContainer value)
        Sets the parent this point belongs to.
        Specified by:
        setParent in interface adams.data.container.DataPoint
        Parameters:
        value - the parent
      • getParent

        public adams.data.container.DataContainer getParent()
        Returns the parent this point belongs to.
        Specified by:
        getParent in interface adams.data.container.DataPoint
        Returns:
        the parent, can be null
      • hasParent

        public boolean hasParent()
        Returns whether the point has a parent.
        Specified by:
        hasParent in interface adams.data.container.DataPoint
        Returns:
        true if the point belongs to a data structure
      • invalidateMinMax

        protected void invalidateMinMax()
        Invalidates the min/max abundance/timestamp points.
      • validateMinMax

        protected void validateMinMax()
        Initializes the min/max abundance/timestmap points.
      • getMaxY

        public L2Point getMaxY()
        Get point with greatest X.
        Returns:
        point
      • getMinY

        public L2Point getMinY()
        Get point with smallest Y.
        Returns:
        point
      • getMaxX

        public L2Point getMaxX()
        Get point with greatest X.
        Returns:
        point
      • getMinX

        public L2Point getMinX()
        Get point with smallest X.
        Returns:
        point
      • add

        public void add​(double x,
                        double y)
        Add a L2Point.
        Parameters:
        x - the x
        y - the y
      • find

        public L2Point find​(double z)
        Returns the L2Point with the exact x, null if not found.
        Parameters:
        z - the z to look for
        Returns:
        the L2Point or null if not found
      • findClosest

        public L2Point findClosest​(double z)
        Returns the L2Point with the z closest to the one provided.
        Parameters:
        z - the z to look for
        Returns:
        the L2Point
      • setX

        public void setX​(double x)
        Set the X.
        Parameters:
        x - the X
      • getX

        public double getX()
        Return the X.
        Returns:
        X
      • setY

        public void setY​(double value)
        Sets the Y.
        Parameters:
        value - the Y
      • getY

        public double getY()
        Returns the Y.
        Returns:
        the Y
      • 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 adams.data.container.DataContainer<L2Point>
        Overrides:
        compareToHeader in class adams.data.container.AbstractDataContainer<L2Point>
        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.
      • toString

        public String toString()
        Returns a string representation of the GC points.
        Overrides:
        toString in class adams.data.container.AbstractDataContainer<L2Point>
        Returns:
        a string representation
      • toStatistic

        public L1PointStatistic toStatistic()
        Returns a statistic object of this GC point.
        Returns:
        statistics about this GC point