Package uk.ac.starlink.ttools.plot2
Class PointCloud
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.PointCloud
-
@Equality public class PointCloud extends java.lang.Object
Represents an unordered set of data positions forming part of a plot. An iterator over the points is provided. Instances of this class may also be compared for equality: if instances compare equal, the iterators will dispense the same positions, though not necessarily in the same order.The unordered semantics of this class is imposed by the equality requirement. Most of the ordering could be restored by rewording the contract a bit differently if that becomes useful, but at time of writing it's not needed.
- Since:
- 13 Feb 2013
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description PointCloud(SubCloud subCloud)
Constructs a point cloud from a single subcloud.PointCloud(SubCloud[] subClouds)
Constructs a point cloud from an array of subclouds.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterable<double[]>
createDataPosIterable(DataStore dataStore)
Returns an iterable over data positions.boolean
equals(java.lang.Object o)
SubCloud[]
getSubClouds()
Returns an array of the subclouds in this point cloud.int
hashCode()
-
-
-
Constructor Detail
-
PointCloud
public PointCloud(SubCloud[] subClouds)
Constructs a point cloud from an array of subclouds. The order of the items in the array may determine the sequence of point iteration, but does not affect equality with respect to other instances.- Parameters:
subClouds
- array of cloud components
-
PointCloud
public PointCloud(SubCloud subCloud)
Constructs a point cloud from a single subcloud.- Parameters:
subCloud
- cloud component
-
-
Method Detail
-
createDataPosIterable
public java.lang.Iterable<double[]> createDataPosIterable(DataStore dataStore)
Returns an iterable over data positions. Iteration is overdataDimCount
-element arrays giving position in data space. The samedouble[]
array object is returned each time with different contents, so beware of storing it between iterations.- Parameters:
dataStore
- data storage object- Returns:
- iterable over data positions
-
getSubClouds
public SubCloud[] getSubClouds()
Returns an array of the subclouds in this point cloud.- Returns:
- subcloud array
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-