org.jscience.chemistry.gui.extended.molecule
Class PropAttributes

java.lang.Object
  extended by org.jscience.chemistry.gui.extended.molecule.PropAttributes

public class PropAttributes
extends java.lang.Object

This is a base class which the Atom and Bond classes include. It provides the common functionality of property pairs which can be added to the end of either an Atom or a Bond


Field Summary
 java.util.Properties prop
          The property to be maninpulate
 
Constructor Summary
PropAttributes()
          Default constuctor
PropAttributes(PropAttributes propSource)
          Copy Constructor, using clone on property
PropAttributes(java.util.Properties prop)
          Constructor if a property exist, create a copy with (clone)
 
Method Summary
 boolean checkIfKeyExist(java.lang.String key)
          Check to see if a key is in the atom's property list
 java.util.Properties getProperties()
          access the atom's properties
 java.lang.String getPropertyValue(java.lang.String key)
          Get a value from the Atoms property
 java.lang.String getPropertyValue(java.lang.String key, java.lang.String defValue)
          Get a value from the Atoms property
 boolean setPropertyValue(java.lang.String key, java.lang.String value)
          Get a value from the Atoms property
 java.lang.String toString()
          Overridden to String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

prop

public java.util.Properties prop
The property to be maninpulate

Constructor Detail

PropAttributes

public PropAttributes()
Default constuctor


PropAttributes

public PropAttributes(java.util.Properties prop)
Constructor if a property exist, create a copy with (clone)

Parameters:
prop - DOCUMENT ME!

PropAttributes

public PropAttributes(PropAttributes propSource)
Copy Constructor, using clone on property

Parameters:
propSource - DOCUMENT ME!
Method Detail

toString

public java.lang.String toString()
Overridden to String

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

getProperties

public java.util.Properties getProperties()
access the atom's properties

Returns:
DOCUMENT ME!

checkIfKeyExist

public boolean checkIfKeyExist(java.lang.String key)
Check to see if a key is in the atom's property list

Parameters:
key - value to look for
Returns:
true if it exist

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String key)
Get a value from the Atoms property

Parameters:
key - value to search for
Returns:
string value for the parameter passed in, null if not found

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String key,
                                         java.lang.String defValue)
Get a value from the Atoms property

Parameters:
key - value to search for
defValue - value to return if search failes
Returns:
string value for the parameter passed in, default if not found

setPropertyValue

public boolean setPropertyValue(java.lang.String key,
                                java.lang.String value)
Get a value from the Atoms property

Parameters:
key - key to set
value - value to set
Returns:
true if it worked, false on failure