public final class Sample extends Object implements Serializable
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
double |
get(int index)
Return the slot value at the given position.
|
int |
hashCode() |
boolean |
isFull()
Test whether all sample slots are occupied.
|
Sample |
newSample()
Create a new
Sample object, with all slots available, with the
same size as this one. |
int |
nextIndex()
Return the index of the next free
double slot. |
static Sample |
of(double[] values)
Create a new
Sample object with the values. |
static Sample |
of(int length)
Create a new
Sample object of the given length. |
int |
size()
Return the number of
double slots the Sample class
stores. |
DoubleStream |
stream()
Returns a sequential
DoubleStream with the slot values of
this Sample object. |
String |
toString() |
double[] |
values()
Return the sample
double values (slots). |
public int size()
double slots the Sample class
stores.double slotspublic int nextIndex()
double slot. If all
slots are occupied, -1 is returned.double slot, or
-1 if all slots are occupiedpublic boolean isFull()
true if all sample slots are occupied,
false otherwisepublic double[] values()
double values (slots).double values (slots).public DoubleStream stream()
DoubleStream with the slot values of
this Sample object.DoubleStream for the sample valuespublic double get(int index)
index - the value indexindexIndexOutOfBoundsException - if the index is out of range
(index < 0 || index >= size())public Sample newSample()
Sample object, with all slots available, with the
same size as this one.Sample objectpublic static Sample of(double[] values)
Sample object with the values.values - the slot values of the created Sample objectSample object with the valuesIllegalArgumentException - if the length of the given values
is zeropublic static Sample of(int length)
Sample object of the given length.length - the length of the new Sample objectSample object of the given lengthIllegalArgumentException - if the given length is smaller
then one© 2007-2017 Franz Wilhelmstötter (2017-04-27 23:07)