Class CommentResource

java.lang.Object
net.ssehub.easy.varModel.management.CommentResource

public class CommentResource extends Object
A simple comment resource emulating basic functionalities of Properties, which, however, interprets IVML qualified names according to its own convention.
Author:
Holger Eichelberger
  • Field Details

  • Constructor Details

    • CommentResource

      public CommentResource()
      Creates a comment resource.
  • Method Details

    • load

      public void load(Reader reader) throws IOException
      Loads the resource from a given reader. 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

      public void store(Writer writer) throws IOException
      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:
      true if it is empty, false else
    • get

      public String get(String key)
      Returns the resource mapping for the given key.
      Parameters:
      key - the key to return the mapping for
      Returns:
      the mapped value, may be null if no mapping exists
    • put

      public void put(String key, String value)
      Adds a new mapping.
      Parameters:
      key - the key for the mapping (must not be null)
      value - the value to be assigned to key
    • remove

      public void remove(String key)
      Removes the mapping stored for key. Nothing will happen if the mapping does not exist.
      Parameters:
      key - the key tor remove the mapping for
    • containsKey

      public boolean containsKey(String key)
      Returns whether a mapping for the given key is known.
      Parameters:
      key - the key to look for
      Returns:
      true if there is a mapping, false else
    • toString

      public String toString()
      Overrides:
      toString in class Object