chemaxon.alchemist
Class AlchemistProfile

java.lang.Object
  extended by chemaxon.alchemist.AlchemistProfile

public class AlchemistProfile
extends java.lang.Object

This is a Profile for various categorized property key-value pairs used by Alchemist based applications and components.
Keys are hierarchical by convention: "application.subcategories.key"-like Strings
Values are XML-Encodable objects.
Reading and writing process is handled with XMLEncoder and XMLDecoder

Author:
Istvan Cseh
See Also:
XMLEncoder, XMLDecoder

Constructor Summary
AlchemistProfile()
          Constructs an empty AlchemistProfile
 
Method Summary
 void clear()
          Removes all key-value mappings.
 boolean containsKey(java.lang.String key)
          Returns true if there is mapping for specified key
 java.lang.Object get(java.lang.String key)
          Returns the value specified by key Returns null if no such key exists
 boolean isEmpty()
          Returns true if this profile contains no key-value pairs
 void put(java.lang.String key, java.lang.Object value)
          Stores the value with the specified key
 void read(java.io.InputStream inputStream)
          Reads the profile from stream
 java.lang.Object remove(java.lang.String key)
          Removes the value specified by key
 java.lang.String toString()
           
 void write(java.io.OutputStream outputStream)
          Writes the profile to stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AlchemistProfile

public AlchemistProfile()
Constructs an empty AlchemistProfile

Method Detail

put

public void put(java.lang.String key,
                java.lang.Object value)
Stores the value with the specified key

Parameters:
key - is the key
value - is the value

get

public java.lang.Object get(java.lang.String key)
Returns the value specified by key Returns null if no such key exists

Parameters:
key - is the key
Returns:
the value, or null

remove

public java.lang.Object remove(java.lang.String key)
Removes the value specified by key

Parameters:
key - is the key to be removed
Returns:
the value for specified key

clear

public void clear()
Removes all key-value mappings.


containsKey

public boolean containsKey(java.lang.String key)
Returns true if there is mapping for specified key

Parameters:
key - is the key
Returns:
true if there is mapping for specified key

isEmpty

public boolean isEmpty()
Returns true if this profile contains no key-value pairs

Returns:
true if this profile contains no key-value pairs

read

public void read(java.io.InputStream inputStream)
Reads the profile from stream

Parameters:
inputStream - is the stream read profile from

write

public void write(java.io.OutputStream outputStream)
Writes the profile to stream

Parameters:
outputStream - is the stream write profile to

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object