public class NumVector extends Vector implements Serializable
capacityIncrement, elementCount, elementDatamodCount| Constructor and Description |
|---|
NumVector() |
NumVector(Collection c) |
NumVector(int initialCapacity) |
NumVector(int initialCapacity,
int capacityIncrement) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(double arg)
Adds a double to the receiver
|
void |
add(int arg)
Adds an int to the receiver
|
void |
add(long arg)
Adds a long to the receiver
|
void |
addAll(Vector aVector)
Adds the elements of aVector to the receiver
|
double |
doubleAt(int pos)
Returns the item at index pos as a double
|
long |
intAt(int pos)
Returns the item at index pos as an int
|
long |
longAt(int pos)
Returns the item at index pos as a long
|
static void |
main(String[] args)
A test routine that creates a NumVector and calculates the stats
|
double |
mean()
Returns a double representing he mean of the receiver's contents
|
String |
printStats()
Calculates mean, std dev, and so on, then returns the resulting
stats as a String.
|
String |
printStatsAsTableRow()
Calculates mean, std dev, and so on, then returns the resulting
stats as a String in table-row format.
|
String |
printStatsTableHeader()
Returns a String for use as a column labels in a table
stat printout.
|
double[] |
stats()
Calculates mean, std dev, and so on, then returns the resulting
stats as an array of doubles.
|
double |
stddev()
Returns a double representing the stddev of the receiver's contents
|
double |
sum()
Returns a double representing the sum of the receiver's contents
|
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSizefinalize, getClass, notify, notifyAll, wait, wait, waitparallelStream, streampublic NumVector()
public NumVector(Collection c)
public NumVector(int initialCapacity)
public NumVector(int initialCapacity,
int capacityIncrement)
public void addAll(Vector aVector)
public void add(double arg)
arg - the double to be storedpublic void add(int arg)
arg - the int to be storedpublic void add(long arg)
arg - the long to be storedpublic double doubleAt(int pos)
pos - the index of the item to be returnedpublic long intAt(int pos)
pos - the index of the item to be returnedpublic long longAt(int pos)
pos - the index of the item to be returnedpublic double mean()
public double stddev()
public String printStats()
public String printStatsAsTableRow()
public String printStatsTableHeader()
public double[] stats()
public double sum()
public static void main(String[] args)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.