Class CommentResource
java.lang.Object
net.ssehub.easy.varModel.management.CommentResource
A simple comment resource emulating basic functionalities of
Properties, which, however, interprets IVML
qualified names according to its own convention.- Author:
- Holger Eichelberger
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears this resource.booleancontainsKey(String key) Returns whether a mapping for the givenkeyis known.Returns the resource mapping for the givenkey.booleanisEmpty()Returns whether this resource is empty.voidLoads the resource from a givenreader.voidAdds a new mapping.voidRemoves the mapping stored forkey.voidStores the resource to the given writer.toString()
-
Field Details
-
ESCAPE
private static final char ESCAPE- See Also:
-
SEPARATOR
private static final char SEPARATOR- See Also:
-
mapping
-
-
Constructor Details
-
CommentResource
public CommentResource()Creates a comment resource.
-
-
Method Details
-
load
Loads the resource from a givenreader. Mappings are added/overwritten, not cleared before.- Parameters:
reader- the reader to load the resource from- Throws:
IOException- in case of I/O errors
-
store
Stores the resource to the given writer.- Parameters:
writer- the writer to store the resource to- Throws:
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
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
Adds a new mapping.- Parameters:
key- the key for the mapping (must not be null)value- the value to be assigned tokey
-
remove
Removes the mapping stored forkey. Nothing will happen if the mapping does not exist.- Parameters:
key- the key tor remove the mapping for
-
containsKey
Returns whether a mapping for the givenkeyis known.- Parameters:
key- the key to look for- Returns:
trueif there is a mapping,falseelse
-
toString
-