|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.isi.stella.Stella_Object edu.isi.stella.StandardObject edu.isi.stella.AbstractCollection edu.isi.stella.AbstractDictionary edu.isi.stella.Dictionary edu.isi.stella.KeyValueList
public class KeyValueList
Field Summary | |
---|---|
KvCons |
theKvList
|
Constructor Summary | |
---|---|
KeyValueList()
|
Method Summary | |
---|---|
static Stella_Object |
accessKeyValueListSlotValue(KeyValueList self,
Symbol slotname,
Stella_Object value,
boolean setvalueP)
|
AbstractIterator |
allocateIterator()
|
void |
clear()
Make self an empty dictionary. |
static void |
clTranslateWalkedSystemUnits(KeyValueList systemunits)
|
static List |
concatenateSystemUnits(KeyValueList systemunits)
|
Cons |
consify()
Return a list of key-value pairs in self . |
KeyValueList |
copy()
Return a copy of the kv-list self . |
static void |
cppTranslateWalkedSystemUnits(KeyValueList systemunits)
|
static Stella_Object |
dynamicSlotValue(KeyValueList dynamicslots,
Symbol slotname,
Stella_Object nullvalue)
|
boolean |
emptyP()
|
int |
equalHashCode()
Return an equalP hash code for self . |
static void |
fillInDateSubstitution(KeyValueList substitutionList)
Fill in substitutionList with template variable substitions
for the names YEAR and DATE which correspond to the current year and date. |
void |
insertAt(Stella_Object key,
Stella_Object value)
Insert the entry < key , value > into the association
self . |
static void |
insertAtVariableTable(KeyValueList self,
Symbol variable,
Stella_Object value)
|
void |
insertEntry(Stella_Object key,
Stella_Object value)
Insert an entry < key ,value > to self unless an identical
entry already exists. |
static void |
javaTranslateWalkedSystemUnits(KeyValueList systemunits)
|
static PropertyList |
kvlistToPlist(KeyValueList self)
Convert self into a property list with identical and identically
ordered keys and values. |
void |
kvPush(Stella_Object key,
Stella_Object value)
Add a new entry < key , value > to the front of the association
self . |
int |
length()
|
List |
listify()
Return a list of key-value pairs in self . |
static KeyValueList |
loadConfigurationFile(java.lang.String file)
Read a configuration file and return its content as a configuration table. |
Stella_Object |
lookup(Stella_Object key)
|
static Stella_Object |
lookupVariableTable(KeyValueList self,
Symbol variable)
|
Stella_Object |
lookupWithDefault(Stella_Object key,
Stella_Object renamed_Default)
Lookup key in self and return the result. |
static KeyValueList |
newKeyValueList()
|
boolean |
nonEmptyP()
|
boolean |
objectEqualP(Stella_Object y)
Return TRUE if x and y represent the same set of key/value pairs. |
Stella_Object |
pop()
Remove and return the value of the first element of the kv-list self . |
Surrogate |
primaryType()
Returns the primary type of self . |
static void |
printKeyValueList(KeyValueList self,
java.io.PrintStream stream)
|
void |
printObject(java.io.PrintStream stream)
|
void |
push(KvCons value)
Make value be the new first element of self . |
Stella_Object |
removeAt(Stella_Object key)
Remove the entry that matches the key key . |
void |
removeEntry(Stella_Object key,
Stella_Object value)
Remove the entry that matches < key ,value >. |
KeyValueList |
reverse()
Destructively reverse the members of the list self . |
static void |
saveConfigurationFile(KeyValueList table,
java.lang.String file,
java.lang.String title)
Save table as a configuration file. |
static Stella_Object |
setDynamicSlotValue(KeyValueList dynamicslots,
Symbol slotname,
Stella_Object value,
Wrapper nullwrapper)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public KvCons theKvList
Constructor Detail |
---|
public KeyValueList()
Method Detail |
---|
public static KeyValueList loadConfigurationFile(java.lang.String file)
file
and return its content as a configuration table.
Also enter each property read into the global system configuration table.
Assumes Java-style property file syntax. Each property name is represented
as a wrapped string and each value as a wrapped string/integer/float or boolean.
file
-
public static KeyValueList newKeyValueList()
public static void javaTranslateWalkedSystemUnits(KeyValueList systemunits)
public static void cppTranslateWalkedSystemUnits(KeyValueList systemunits)
public static void saveConfigurationFile(KeyValueList table, java.lang.String file, java.lang.String title)
table
as a configuration file. Uses a Java-style property file syntax.
table
- file
- title
- public static List concatenateSystemUnits(KeyValueList systemunits)
public static Stella_Object setDynamicSlotValue(KeyValueList dynamicslots, Symbol slotname, Stella_Object value, Wrapper nullwrapper)
public static Stella_Object dynamicSlotValue(KeyValueList dynamicslots, Symbol slotname, Stella_Object nullvalue)
public static void clTranslateWalkedSystemUnits(KeyValueList systemunits)
public static void insertAtVariableTable(KeyValueList self, Symbol variable, Stella_Object value)
public static Stella_Object lookupVariableTable(KeyValueList self, Symbol variable)
public static void fillInDateSubstitution(KeyValueList substitutionList)
substitutionList
with template variable substitions
for the names YEAR and DATE which correspond to the current year and date.
These substitutions can then be used with substituteTemplateVariablesInString
substitutionList
- public static void printKeyValueList(KeyValueList self, java.io.PrintStream stream)
public List listify()
self
.
public static PropertyList kvlistToPlist(KeyValueList self)
self
into a property list with identical and identically
ordered keys and values.
self
-
public AbstractIterator allocateIterator()
allocateIterator
in class Dictionary
public int equalHashCode()
equalP
hash code for self
. Note that this
is O(N) in the number of entries of self
.
equalHashCode
in class Stella_Object
public boolean objectEqualP(Stella_Object y)
x
and y
represent the same set of key/value pairs.
objectEqualP
in class Stella_Object
y
-
public void clear()
self
an empty dictionary.
public KeyValueList copy()
self
. The kv-conses in
the copy are freshly allocated.
public boolean nonEmptyP()
public boolean emptyP()
public KeyValueList reverse()
self
.
public Stella_Object pop()
self
. It does NOT return the KV-CONS object. Return null
if
the list is empty.
public void kvPush(Stella_Object key, Stella_Object value)
key
, value
> to the front of the association
self
. This might duplicate an existing entry. If a previous entry existed with key
key
, that entry is retained, but shadowed by this new entry.
key
- value
- public void push(KvCons value)
value
be the new first element of self
. Note that
the rest
slot of value
should be null
, since it will be overwritten.
This might duplicate an existing entry. If a previous entry existed with the
same key as value
, that entry is retained, but shadowed by this new entry.
value
- public void removeEntry(Stella_Object key, Stella_Object value)
key
,value
>.
Assumes that more than one entry can match key
.
key
- value
- public void insertEntry(Stella_Object key, Stella_Object value)
key
,value
> to self
unless an identical
entry already exists. This can generate duplicate entries for key
.
key
- value
- public Stella_Object removeAt(Stella_Object key)
key
.
Return the value of the matching entry, or NULL if there is no matching entry.
Assumes that at most one entry matches key
.
key
-
public void insertAt(Stella_Object key, Stella_Object value)
key
, value
> into the association
self
. If a previous entry existed with key key
, that entry is replaced.
insertAt
in class Dictionary
key
- value
- public int length()
length
in class AbstractCollection
public Stella_Object lookupWithDefault(Stella_Object key, Stella_Object renamed_Default)
key
in self
and return the result.
Return renamed_Default
if no value was found.
key
- renamed_Default
-
public Stella_Object lookup(Stella_Object key)
lookup
in class Dictionary
public Cons consify()
self
.
consify
in class Stella_Object
public void printObject(java.io.PrintStream stream)
printObject
in class Stella_Object
public static Stella_Object accessKeyValueListSlotValue(KeyValueList self, Symbol slotname, Stella_Object value, boolean setvalueP)
public Surrogate primaryType()
Stella_Object
self
.
Gets defined automatically for every non-abstract subclass of OBJECT.
primaryType
in class Stella_Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |