org.pz.platypus
Class SystemStrings

java.lang.Object
  extended by org.pz.platypus.SystemStrings

public class SystemStrings
extends java.lang.Object

Manages the user-visible Platypus system strings (version #, etc.) System strings have the format of starting with: _ followed by any number of alphanumerics or _ They can be read by the document processing, but they are not modifiable by the document.

Author:
alb (Andrew Binstock)

Field Summary
private  java.util.TreeMap sysStrings
           
 
Constructor Summary
SystemStrings()
           
 
Method Summary
 int add(java.lang.String key, java.lang.String value)
          Add a string to collection of Platypus system strings.
 java.lang.String dump(Literals lits)
          Returns a string containing all the keys and values formatted one-to-a-line for printing to console or document.
 int getSize()
          How many system Strings are defined
 java.lang.String getString(java.lang.String key)
          Returns the string associated to a given key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sysStrings

private final java.util.TreeMap sysStrings
Constructor Detail

SystemStrings

public SystemStrings()
Method Detail

add

public int add(java.lang.String key,
               java.lang.String value)
Add a string to collection of Platypus system strings. Only Platypus can do this internally. The user cannot add strings.

Parameters:
key - string that should start with _
value - where any legal string is OK except null
Returns:
Status.OK; on error: Status.INVALID_PARAM or Status.INVALID_PARAM_NULL

getString

public java.lang.String getString(java.lang.String key)
Returns the string associated to a given key

Parameters:
key - the key to use for the lookup
Returns:
the string; null, if an error occurs

dump

public java.lang.String dump(Literals lits)
Returns a string containing all the keys and values formatted one-to-a-line for printing to console or document.

Parameters:
lits - literals to use in the dump output
Returns:
a printable/displayable string with all the strings, 1 per line.

getSize

public int getSize()
How many system Strings are defined

Returns:
number of key value pairs.


Copyright © 2008-10 Pacific Data Works LLC