Class Struct |
The Struct class simply provides methods for converting between string and structure representations of information. A good example of it's use in the the addressbook package, where subclasses of this class are used to convert data back and forth between strings (as stored in a DB) and various structures.
Details |
Constructor |
sTypeCons | type of structure, e.g. <b>set</b> or <b>list</b>.
Default is <b>set</b>.
|
Given a structure type, map it into a Struct class.
Methods: |
e | element to add |
nothing useful |
if structure is not a set or list |
Add a single element to the structure.
s | Unicon structured type |
this structure after conversion |
Convert from a Unicon structure form.
fromString(s, prefix:"", terminator:'\n')
s | string form |
prefix | to remove from head of each string structure element |
terminator | to remove from tail of each string structure element |
this structure |
Convert from string form.
elements in this structure |
e | element to remove |
Remove an element from the structure (semi-abstract, only works with set structure - must be overridden for other structures).
(a copy of internal) structure |
Produce a Unicon structure form.
toString(prefix:"", terminator:"\n")
prefix | added to head of each string structure element |
terminator | added to tail of each string structure element |
string formed from elements in this structure |
Produce a string form (required for storing to DB)
Fields: |