Package adams.data.threeway
Class L1Point
- java.lang.Object
-
- adams.data.container.AbstractDataContainer<L2Point>
-
- adams.data.threeway.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_Comparatorthe default comparator.protected L2Pointm_MaxXpoint of greatest x.protected L2Pointm_MaxYpoint of greatest y.protected L2Pointm_MinXpoint of smallest x.protected L2Pointm_MinYpoint of smallest y.protected ThreeWayDatam_Parentthe parent.protected doublem_Xx.protected doublem_Yy.
-
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 voidadd(double x, double y)Add a L2Point.voidassign(adams.data.container.DataContainer<L2Point> other)Obtains the stored variables from the other data point, but not the actual data points.voidassign(adams.data.container.DataPoint other)Obtains the stored variables from the other data point.intcompareToHeader(Object o)Compares this object with the specified object for order.L2Pointfind(double z)Returns the L2Point with the exact x, null if not found.L2PointfindClosest(double z)Returns the L2Point with the z closest to the one provided.ObjectgetClone()Returns a clone of itself.adams.data.container.DataPointComparator<L2Point>getComparator()Returns the comparator in use.L2PointgetMaxX()Get point with greatest X.L2PointgetMaxY()Get point with greatest X.L2PointgetMinX()Get point with smallest X.L2PointgetMinY()Get point with smallest Y.adams.data.container.DataContainergetParent()Returns the parent this point belongs to.doublegetX()Return the X.doublegetY()Returns the Y.booleanhasParent()Returns whether the point has a parent.protected voidinvalidateMinMax()Invalidates the min/max abundance/timestamp points.protected booleanmodifiedListener(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.L2PointnewPoint()Returns a new instance of a DataContainer point.voidsetParent(adams.data.container.DataContainer value)Sets the parent this point belongs to.voidsetX(double x)Set the X.voidsetY(double value)Sets the Y.L1PointStatistictoStatistic()Returns a statistic object of this GC point.StringtoString()Returns a string representation of the GC points.protected voidvalidateMinMax()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
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Field Detail
-
m_Parent
protected ThreeWayData m_Parent
the parent.
-
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 xy- the y
-
L1Point
public L1Point(ThreeWayData parent, double x, double y)
Constructor.- Parameters:
parent- the parentx- the xy- the y
-
-
Method Detail
-
newComparator
public adams.data.container.DataPointComparator<L2Point> newComparator()
Returns a new instance of the default comparator.- Specified by:
newComparatorin interfaceadams.data.container.DataContainer<L2Point>- Returns:
- the comparator instance
-
getComparator
public adams.data.container.DataPointComparator<L2Point> getComparator()
Returns the comparator in use.- Specified by:
getComparatorin interfaceadams.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:
getClonein interfaceadams.core.CloneHandler- Specified by:
getClonein interfaceadams.data.container.DataContainer<L2Point>- Specified by:
getClonein interfaceadams.data.container.DataPoint- Overrides:
getClonein classadams.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.
-
modifiedListener
protected boolean modifiedListener(boolean modified)
Method that gets notified about changes in the collection of data points.- Overrides:
modifiedListenerin classadams.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:
assignin interfaceadams.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:
newPointin interfaceadams.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:
setParentin interfaceadams.data.container.DataPoint- Parameters:
value- the parent
-
getParent
public adams.data.container.DataContainer getParent()
Returns the parent this point belongs to.- Specified by:
getParentin interfaceadams.data.container.DataPoint- Returns:
- the parent, can be null
-
hasParent
public boolean hasParent()
Returns whether the point has a parent.- Specified by:
hasParentin interfaceadams.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 xy- 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:
compareToHeaderin interfaceadams.data.container.DataContainer<L2Point>- Overrides:
compareToHeaderin classadams.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:
toStringin classadams.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
-
-