|
JMV 0.80 Programmer's Documentation | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--NameList
Storage class to store an Object and to be able to access it from its name or its index. Good for storeing many objects that may have the same name.
Constructor Summary | |
NameList()
Constructor |
Method Summary | |
int |
addName(java.lang.String name,
java.lang.Object value)
Adds a new entry |
int |
getIndex(java.lang.String name)
Gets the index of an entry based on its name |
java.lang.String |
getName(int index)
Gets the name of an entry based on its index |
java.lang.Object |
getValue(int index)
Gets the Object stored in an entry based on its index |
java.lang.Object |
getValue(java.lang.String name)
Gets the Object stored in an entry based on its name |
void |
setName(int index,
java.lang.String newname)
Sets the name of an entry based on its index |
void |
setValue(int index,
java.lang.Object value)
Sets an Object in an entry based on its index |
int |
size()
Gets the number of entries |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NameList()
Method Detail |
public int size()
public int addName(java.lang.String name, java.lang.Object value)
name
- the name of the new entryvalue
- the Object to store
public java.lang.String getName(int index)
index
- the index of the Object to get
public void setName(int index, java.lang.String newname)
index
- the index of the entry whose name is to be changednewname
- the new namepublic int getIndex(java.lang.String name)
name
- the name of the entry
public java.lang.Object getValue(java.lang.String name)
name
- the name of the entry
public java.lang.Object getValue(int index)
index
- the index of the entry
public void setValue(int index, java.lang.Object value)
index
- the index of the entry to modifyvalue
- the new Object to store in this entry
|
Copyright (C) 2000-2002 The Board of Trustees of the University of Illinois | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |