|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jimmc.util.Items
An order list of named items.
Field Summary | |
protected java.util.Vector |
items
Our list of Item objects. |
Constructor Summary | |
Items()
Create an empty Items list. |
Method Summary | |
void |
addItem(Item item)
Add an item to our list. |
void |
addItem(java.lang.String name,
java.lang.Object value)
Add an item to our list. |
Item |
getItem(int n)
Get the Nth item. |
Item |
getItem(java.lang.String name)
Get the named item, or null of no item of that name. |
java.lang.String |
getName(int n)
Get the name of the Nth item. |
java.lang.String[] |
getNames()
Get all names. |
java.lang.Object |
getValue(int n)
Get the value of the Nth item. |
java.lang.Object |
getValue(java.lang.String name)
Get the value of the named item, or null if not found. |
static Items |
parseItems(java.lang.String s)
Parse a string such as produced by toString()
into an Items object. |
void |
setValue(int n,
java.lang.Object value)
Set the value of the Nth item. |
void |
setValue(java.lang.String name,
java.lang.Object value)
Set the value of the named item, or add it if not found. |
void |
setValues(Items items)
Set the values of all items by name that we find in the given items. |
int |
size()
Get the number of items in our list. |
java.lang.String |
toString()
Generate a string such as {name1=value1,name2=value2} |
void |
toString(java.lang.StringBuffer sb,
java.lang.String sep)
Convert to a string using the specified separator. |
java.lang.String |
toStringNoBraces()
Generate a string like toString, but without the enclosing braces. |
void |
toStringNoBraces(java.lang.StringBuffer sb)
Convert to a string without the enclosing braces. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Vector items
Constructor Detail |
public Items()
Method Detail |
public void addItem(Item item)
item
- The item to add to our list. We just put a pointer
to this item into our list, we do not make a copy.public void addItem(java.lang.String name, java.lang.Object value)
name
- The name of the item.value
- The value of the item. We put a pointer to this
value in the Item, but do not make a copy of the value.public int size()
public void setValues(Items items)
public void setValue(int n, java.lang.Object value)
public void setValue(java.lang.String name, java.lang.Object value)
public Item getItem(int n)
public Item getItem(java.lang.String name)
public java.lang.String[] getNames()
public java.lang.String getName(int n)
public java.lang.Object getValue(int n)
public java.lang.Object getValue(java.lang.String name)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringNoBraces()
public void toStringNoBraces(java.lang.StringBuffer sb)
public void toString(java.lang.StringBuffer sb, java.lang.String sep)
public static Items parseItems(java.lang.String s)
toString()
into an Items object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |