|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectplatypus.UserString
public class UserString
Maintains a table of macros. Macros have the following properties: Strings: Begin with a $ followed by a letter or digit and then any combination of letters, digits, and _ Users can read, write, modify at will Platypus-defined strings: Begin with $_ followed by any combination of letters, digits, and _ characters To the user, Platypus-defined strings are read-only All string names are case-sentistive. Strings are defined with the [def:StringName{contents of string}] default is " " (a single space) strings cannot currently contain commands or other strings Numbers default to 0, implemented in BigDecimal, so no over/undeflow errors possible To print a string to the document, enter an asterisk before the string name: [*StringName] Note: no translation is done of the string before it's printed. Additional info: Platypus will expose its own variables as read-only macros, as indicated above.
| Field Summary | |
|---|---|
(package private) java.util.TreeMap |
uStrings
|
| Constructor Summary | |
|---|---|
UserString()
Create a table for key-value pairs (both strings) |
|
| Method Summary | |
|---|---|
int |
add(java.lang.String key,
java.lang.String value)
Add a macro to the table of user strings |
java.lang.String |
dumpPlatypusStrings()
Dump all the strings defined by Platypus in the table to one long string. |
java.lang.String |
dumpUserStrings()
Dump all the user-defined string to one long string. |
java.lang.String |
extractMacroName(java.lang.String rawString)
Accepts a string that should start with the name of a Platypus string and returns the portion that's a legal system macro name: $PageCount Stops at the first invalid character |
java.lang.String |
get(java.lang.String key)
Retrieve a string based on its key (the macro name) |
int |
sizeof()
How many strings are there in the table? |
java.lang.String |
toString()
Dump all the strings in the table to one long string. |
int |
update(java.lang.String key,
java.lang.String value)
Updates a value by deleting the current KV pair and replacing it with the new one |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
final java.util.TreeMap uStrings
| Constructor Detail |
|---|
public UserString()
| Method Detail |
|---|
public int add(java.lang.String key,
java.lang.String value)
key - the macro namevalue - the macro body
public java.lang.String get(java.lang.String key)
key - the macro name
public int update(java.lang.String key,
java.lang.String value)
key - new keyvalue - new data/value
public int sizeof()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String dumpUserStrings()
public java.lang.String dumpPlatypusStrings()
public java.lang.String extractMacroName(java.lang.String rawString)
rawString - the string that should begin with a system macro name
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||