|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.util.DoubleList
public class DoubleList
Like a List
but contains doubles. Backed by an array so arbitrary-position
insertion is expensive, but insertion at the end of the list is fast, and access is fast.
Constructor Summary | |
---|---|
DoubleList()
|
|
DoubleList(int initialSize)
|
Method Summary | |
---|---|
void |
add(double d)
inserts d at the end of the list. |
void |
add(int index,
double d)
Inserts d into the list after the first index elements. |
void |
clear()
|
double |
get(int index)
gets the value of the index-th element of the list. |
boolean |
isEmpty()
returns true iff the list contains no elements. |
static void |
main(java.lang.String[] args)
|
double |
set(int index,
double d)
sets the index-th element of the list to d, and returns the old value of the index-th element. |
int |
size()
|
double[] |
toArray()
as implemented, returns the actual array! Danger! |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DoubleList()
public DoubleList(int initialSize)
Method Detail |
---|
public void clear()
public void add(double d)
public void add(int index, double d) throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
public int size()
public double get(int index) throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
public double[] toArray()
public boolean isEmpty()
public double set(int index, double d) throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |