Class CommentResource
- java.lang.Object
-
- net.ssehub.easy.varModel.management.CommentResource
-
public class CommentResource extends java.lang.ObjectA simple comment resource emulating basic functionalities ofProperties, which, however, interprets IVML qualified names according to its own convention.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description CommentResource()Creates a comment resource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears this resource.booleancontainsKey(java.lang.String key)Returns whether a mapping for the givenkeyis known.java.lang.Stringget(java.lang.String key)Returns the resource mapping for the givenkey.booleanisEmpty()Returns whether this resource is empty.voidload(java.io.Reader reader)Loads the resource from a givenreader.voidput(java.lang.String key, java.lang.String value)Adds a new mapping.voidremove(java.lang.String key)Removes the mapping stored forkey.voidstore(java.io.Writer writer)Stores the resource to the given writer.java.lang.StringtoString()
-
-
-
Field Detail
-
ESCAPE
private static final char ESCAPE
- See Also:
- Constant Field Values
-
SEPARATOR
private static final char SEPARATOR
- See Also:
- Constant Field Values
-
mapping
private java.util.Map<java.lang.String,java.lang.String> mapping
-
-
Method Detail
-
load
public void load(java.io.Reader reader) throws java.io.IOExceptionLoads the resource from a givenreader. Mappings are added/overwritten, not cleared before.- Parameters:
reader- the reader to load the resource from- Throws:
java.io.IOException- in case of I/O errors
-
store
public void store(java.io.Writer writer) throws java.io.IOExceptionStores the resource to the given writer.- Parameters:
writer- the writer to store the resource to- Throws:
java.io.IOException- in case of I/O errors
-
clear
public void clear()
Clears this resource.
-
isEmpty
public boolean isEmpty()
Returns whether this resource is empty.- Returns:
trueif it is empty,falseelse
-
get
public java.lang.String get(java.lang.String key)
Returns the resource mapping for the givenkey.- Parameters:
key- the key to return the mapping for- Returns:
- the mapped value, may be null if no mapping exists
-
put
public void put(java.lang.String key, java.lang.String value)Adds a new mapping.- Parameters:
key- the key for the mapping (must not be null)value- the value to be assigned tokey
-
remove
public void remove(java.lang.String key)
Removes the mapping stored forkey. Nothing will happen if the mapping does not exist.- Parameters:
key- the key tor remove the mapping for
-
containsKey
public boolean containsKey(java.lang.String key)
Returns whether a mapping for the givenkeyis known.- Parameters:
key- the key to look for- Returns:
trueif there is a mapping,falseelse
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-