uk.ac.starlink.ttools.plot2
Class PointCloud

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.PointCloud

@Equality
public class PointCloud
extends 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
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
 Iterable<double[]> createDataPosIterable(DataStore dataStore)
          Returns an iterable over data positions.
 boolean equals(Object o)
           
 SubCloud[] getSubClouds()
          Returns an array of the subclouds in this point cloud.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

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 Iterable<double[]> createDataPosIterable(DataStore dataStore)
Returns an iterable over data positions. Iteration is over dataDimCount-element arrays giving position in data space. The same double[] 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 class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.