|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.biffle.cliff.pearl.PropSet
Encapsulates the 'properties files' used by Pearl devices for both device settings and file metadata. This version is immutable. The PropSet provides accessor methods for the properties in the set. It makes no attempt at determining the type of a given key, and instead provides accessors for the four types of properties (numeric, string, string list, and byte array). PropSets are typically stored in a textual representation. The format is simple: it consists of a series of newline-terminated lines, each of which contains a key, an equals sign ('='), and a value. The value can be numeric (such as '12' or '0x4A'), textual (such as 'Hello, World!'), binary (such as '\x00abc\x1Bef'), or a list of string tokens (such as ';bob;alice;jim;'). Though I've set the examples here in quotes for clarity, the quotes do not appear in the file. As noted in the binary example, any bytes that might interfere with text processing are escaped as '\xDD', where DD is the hex value of the byte. Primarily, bytes between 0x00 and 0x1B seem to be escaped.
| Constructor Summary | |
PropSet(java.lang.String set)
Creates a PropSet from its textual representation. |
|
| Method Summary | |
boolean |
containsProperty(java.lang.String key)
Checks if the PropSet contains a given property. |
byte[] |
getBytes(java.lang.String key)
Returns the value of a property as a list of bytes. |
long |
getLong(java.lang.String key)
Returns the value of a property as a long. |
java.lang.String |
getString(java.lang.String key)
Returns the value of a property as a String. |
java.lang.String[] |
getStringList(java.lang.String key)
Returns the value of a property as a list of Strings. |
java.util.Set |
keySet()
Returns the property names as a Set. |
void |
setString(java.lang.String key,
java.lang.String value)
|
java.lang.String |
toString()
Converts the PropSet to a textual representation. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public PropSet(java.lang.String set)
| Method Detail |
public java.util.Set keySet()
public boolean containsProperty(java.lang.String key)
public long getLong(java.lang.String key)
public java.lang.String getString(java.lang.String key)
public java.lang.String[] getStringList(java.lang.String key)
public byte[] getBytes(java.lang.String key)
public void setString(java.lang.String key,
java.lang.String value)
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||