|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.ultrametrics.rcs.ControlInformation
Encapsulation of a control information for an RCS object.
"control information" is a Map plus some intelligence about how to parse the information from a reader containing raw RCS data.
Field Summary | |
static java.lang.String |
_rcsId
|
protected static char |
DELIMITER
control information default block delimiter. |
static java.lang.String |
EXT_RCS
RCS file default extension. |
protected java.util.HashMap |
map
A map containing the name-value key pairs. |
protected java.io.BufferedReader |
reader
A buffered reader from which the control keys and elements are parsed. |
Constructor Summary | |
ControlInformation(java.io.BufferedReader reader)
Construct a new map of control information. |
Method Summary | |
protected void |
clear()
Calling clear is optional and provided as a mechanism to save memory by reducing what otherwise might be duplicate instances of objects. |
boolean |
containsKey(java.lang.String key)
Determine whether or not this control information contains the specified key. |
void |
dump()
Similar to toString(), but more verbose and dumps directly to stderr. |
protected abstract java.util.Collection |
getAllowedKeys()
Retrieve the collection of allowed keys (from the implementor's concrete instance). |
Element |
getElement(java.lang.String key)
Retrieve a control element. |
protected Element |
getFirstElement(java.lang.String key)
The first element in an RCS control block is delimited differently compared to subsequent blocks. |
protected abstract boolean |
isKeyAllowed(java.lang.String key)
Determine whether a key would be allowed (in the implementor's concrete instance of a control block). |
protected static java.util.Collection |
makeKeyCollection(java.lang.String[] keyArray)
Convenience method to convert an array of keys into a collection. |
protected boolean |
parse()
Parse known keys and values in the form of map, from the reader. |
protected Element |
parseNextElement()
Parse the next block of data. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.util.HashMap map
protected java.io.BufferedReader reader
protected static char DELIMITER
public static final java.lang.String EXT_RCS
public static final java.lang.String _rcsId
Constructor Detail |
public ControlInformation(java.io.BufferedReader reader)
reader
- the buffered reader from which elements will be
subsequently parsed.Method Detail |
public boolean containsKey(java.lang.String key)
key
- the control key.public Element getElement(java.lang.String key)
key
- the control key.protected abstract boolean isKeyAllowed(java.lang.String key)
key
- the control key.protected abstract java.util.Collection getAllowedKeys()
protected void clear()
After the object implementing control information is populated, he can optionally signal to the garbage collector that the map and reader is no longer in use.
This means that subsequent calls to key or element accessors will fail. Presumably the implementing class will have already retrieved that information and placed it in local storage.
protected Element getFirstElement(java.lang.String key) throws java.io.IOException
key
- the control key.protected Element parseNextElement() throws java.io.IOException, ParserException
protected boolean parse() throws ParserException
Assumes that this class's reader is positioned at the head of the block which contains the desired elements. Executing this method 'consumes' the data, meaning the reader will be positioned after the block processed.
public void dump()
protected static java.util.Collection makeKeyCollection(java.lang.String[] keyArray)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |