|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.wlu.cs.levy.RAAM.Vectionary
Vectionary is a class supporting a mapping from strings to vectors (double-precision arrays).
Constructor Summary | |
Vectionary(int size)
Creates a dictionary with vector entries of specified size. |
Method Summary | |
int |
count()
Returns number of entries. |
void |
enter(java.lang.String s,
double[] p)
Enters a string<->vector mapping into the dictionary |
void |
enter(java.lang.String s,
double[][] pts)
Enters vectors->string mappings into the dictionary. |
java.lang.String |
lookup(double[] p)
Returns string that keys vector. |
double[][] |
lookup(java.lang.String s)
Returns vector(s) keyed by string. |
java.lang.String |
toString()
Overrides Object.toString() method. |
int |
width()
Returns vector size. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Vectionary(int size)
size
- vector sizeMethod Detail |
public void enter(java.lang.String s, double[] p) throws java.lang.IllegalArgumentException
s
- the stringp
- the vector
java.lang.IllegalArgumentException
- if array length not equal to
length specified in call to constructorpublic void enter(java.lang.String s, double[][] pts)
s
- the stringpts
- the vectors
java.lang.IllegalArgumentException
- if array length not equal to
length specified in call to constructorpublic java.lang.String toString()
toString
in class java.lang.Object
public double[][] lookup(java.lang.String s) throws java.lang.IllegalArgumentException
s
- the string
java.lang.IllegalArgumentException
- if there is no such keypublic java.lang.String lookup(double[] p) throws java.lang.IllegalArgumentException
p
- the vector
java.lang.IllegalArgumentException
- if there is no key for that vectorpublic int width()
public int count()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |