|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<java.lang.Number>
com.numericalmethod.suanshu.datastructure.list.NumberList
public class NumberList
This data structure represents a list of Numbers.
It is a wrapper for ArrayList<Number> and
has a set of utility functions for convenient.
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
NumberList()
Construct an empty list of numbers. |
|
NumberList(java.util.Collection<? extends java.lang.Number> c)
Copy constructor to copy from another collection of numbers. |
|
NumberList(java.lang.Number... numbers)
Construct a list of numbers from the inputs. |
|
NumberList(java.lang.String... numbers)
Construct a list of numbers from the inputs. |
|
| Method Summary | |
|---|---|
void |
add(java.lang.Number... numbers)
Add new numbers to the list. |
void |
add(java.lang.String... numbers)
Add new numbers to the list. |
double[] |
doubleArray()
Convert this list of numbers to a double array, if all its elements are real. |
boolean |
hasApproximately(double precision,
java.lang.Number... numbers)
Check whether the list contains the numbers. |
boolean |
hasApproximately(double precision,
java.lang.String... numbers)
Check whether the list contains the numbers. |
boolean |
hasExactly(java.lang.Number... numbers)
Check whether the list contains the numbers. |
boolean |
hasExactly(java.lang.String... numbers)
Check whether the list contains the numbers. |
| Methods inherited from class java.util.ArrayList |
|---|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, iterator, listIterator, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
| Constructor Detail |
|---|
public NumberList()
public NumberList(java.util.Collection<? extends java.lang.Number> c)
c - a collection of Numberspublic NumberList(java.lang.Number... numbers)
numbers - an array of Numberspublic NumberList(java.lang.String... numbers)
numbers - an array of numbers in String| Method Detail |
|---|
public void add(java.lang.Number... numbers)
numbers - an array of Numberspublic void add(java.lang.String... numbers)
numbers - an array of numbers in Stringpublic boolean hasExactly(java.lang.Number... numbers)
A match is true iff
Double == Double; Double != Integer
equal and hashcode functions), e.g., (1.5 == 1.5); (1.5 != 1.5 + ε)
numbers - an array of Numbers
true iff the matching criteria is metpublic boolean hasExactly(java.lang.String... numbers)
A match is true iff
Double == Double; Double != Integer
equal and hashcode functions), e.g., (1.5 == 1.5); (1.5 != 1.5 + ε)
numbers - an array of numbers in String
true iff the matching criteria is met
public boolean hasApproximately(double precision,
java.lang.Number... numbers)
A match is true iff
precision - two numbers are considered the same if their absolute difference is less than or equal to precisionnumbers - an array of Numbers
true iff the matching criteria is met
public boolean hasApproximately(double precision,
java.lang.String... numbers)
A match is true iff
precision - two numbers are considered the same if their absolute difference is less than or equal to precisionnumbers - an array of numbers in String
true iff the matching criteria is metpublic double[] doubleArray()
java.lang.IllegalArgumentException - if the list consists of not entirely doubles
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||