public class PointDataSet<N extends java.lang.Number> extends java.util.ArrayList<Point<N>> implements DataSet
If your data are not only numerical, consider using a GenericDataSet instead.
GenericDataSet
,
Serialized FormConstructor and Description |
---|
PointDataSet()
Create an empty PointDataSet
|
PointDataSet(java.util.Collection<? extends Point<N>> pts)
Create a new PointDataSet from a previous collection of Points
|
PointDataSet(int initial)
Create an empty PointDataSet with a specified initial capacity
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
Point<N> point)
Add a new point to this DataSet at a specified position
|
boolean |
add(Point<N> point)
Add a new point to this DataSet
|
boolean |
addAll(java.util.Collection<? extends Point<N>> pts)
Add a collection of points to this DataSet
|
boolean |
addAll(int index,
java.util.Collection<? extends Point<N>> pts)
Add a collection of points to this DataSet starting at a specified
position if there are data at the specified position, these will be
shifted
|
void |
addPoint(N... coords)
Add a new point to the data set, given the values for each dimension.
|
static <N extends java.lang.Number> |
constructDataSet(java.lang.Class<N> objclass,
java.lang.Object array)
This is a convinient method to transform a statically defined primitive
array to PointDataSet object.
|
int |
getDimensions()
Retrieve how many dimensions this dataset refers to.
|
java.lang.String |
getPointValue(int point,
int dimension)
Retrieve data information from a point.
|
Point<N> |
set(int index,
Point<N> point)
Replace the Point at the specified position with the provided one
|
clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, size, subList, toArray, toArray, trimToSize
public PointDataSet()
public PointDataSet(int initial)
initial
- The initial capacity of this PointDataSetpublic PointDataSet(java.util.Collection<? extends Point<N>> pts) throws java.lang.NumberFormatException
pts
- The collection of Points to use as a modeljava.lang.NumberFormatException
- If the given collection is not in
the correct formatpublic boolean add(Point<N> point) throws java.lang.NumberFormatException
add
in interface java.util.Collection<Point<N extends java.lang.Number>>
add
in interface java.util.List<Point<N extends java.lang.Number>>
add
in class java.util.ArrayList<Point<N extends java.lang.Number>>
point
- The point to add to this DataSetjava.lang.NumberFormatException
- If the given collection is not in
the correct formatpublic void add(int index, Point<N> point) throws java.lang.NumberFormatException
add
in interface java.util.List<Point<N extends java.lang.Number>>
add
in class java.util.ArrayList<Point<N extends java.lang.Number>>
index
- Where to add this pointpoint
- The point to add to this DataSetjava.lang.NumberFormatException
- If the given collection is not in
the correct formatpublic boolean addAll(java.util.Collection<? extends Point<N>> pts) throws java.lang.NumberFormatException
addAll
in interface java.util.Collection<Point<N extends java.lang.Number>>
addAll
in interface java.util.List<Point<N extends java.lang.Number>>
addAll
in class java.util.ArrayList<Point<N extends java.lang.Number>>
pts
- The points colelctionjava.lang.NumberFormatException
- If the given collection is not in
the correct formatpublic boolean addAll(int index, java.util.Collection<? extends Point<N>> pts) throws java.lang.NumberFormatException
addAll
in interface java.util.List<Point<N extends java.lang.Number>>
addAll
in class java.util.ArrayList<Point<N extends java.lang.Number>>
index
- Where to start adding point data.pts
- The point collection to addjava.lang.NumberFormatException
- If the given collection is not in
the correct formatpublic Point<N> set(int index, Point<N> point) throws java.lang.NumberFormatException
set
in interface java.util.List<Point<N extends java.lang.Number>>
set
in class java.util.ArrayList<Point<N extends java.lang.Number>>
index
- The position of the point to be alteredpoint
- The point to usejava.lang.NumberFormatException
- If the given collection is not in
the correct formatpublic void addPoint(N... coords)
coords
- a list of primitive data of the same type of this
collection. Could also be boxed variables too.public int getDimensions()
getDimensions
in interface DataSet
DataSet.getDimensions()
public java.lang.String getPointValue(int point, int dimension)
getPointValue
in interface DataSet
point
- The point numberdimension
- The point dimension (or "column") to request data fromDataSet.getPointValue(int,int)
public static final <N extends java.lang.Number> PointDataSet<N> constructDataSet(java.lang.Class<N> objclass, java.lang.Object array) throws java.lang.ArrayStoreException
objclass
- The class of this PointDataSet. For example for Double
precision numbers, this parameter should be Double.classarray
- The array containing the primitive datajava.lang.ArrayStoreException
- If some misconfiguration is
performed on the provided array object