chemaxon.struc
Class MPropertyContainer

java.lang.Object
  extended bychemaxon.struc.MPropertyContainer
All Implemented Interfaces:
java.lang.Cloneable, java.io.Externalizable, java.io.Serializable

public class MPropertyContainer
extends java.lang.Object
implements java.lang.Cloneable, java.io.Externalizable

Property container.

Since:
Marvin 4.1, 11/20/2005
Version:
4.1, 08/03/2006
Author:
Peter Csizmadia
See Also:
Serialized Form

Constructor Summary
MPropertyContainer()
          Creates an empty property container.
 
Method Summary
 void clear()
          Clears properties.
 java.lang.Object clone()
          Clones this object.
 chemaxon.struc.MProp get(java.lang.String key)
          Gets a property object.
 java.lang.String getKey(int i)
          Gets a property key.
 java.lang.String[] getKeys()
          Returns the property keys.
 java.lang.Object getObject(java.lang.String key)
          Gets a property object.
 java.lang.String getString(java.lang.String key)
          Gets a property.
 boolean isValid(chemaxon.struc.MProp prop)
          Tests whether a coordinate dependent property is still valid.
 void readExternal(java.io.ObjectInput in)
          Restores the property container's state.
 void set(java.lang.String key, chemaxon.struc.MProp value)
          Sets a property object.
 void set(java.lang.String key, chemaxon.struc.MProp value, int opts)
          Sets a property object.
 void setObject(java.lang.String key, java.lang.Object val)
          Sets a property object.
 void setString(java.lang.String key, java.lang.String value)
          Sets a property.
 int size()
          Gets the total number of properties.
 void writeExternal(java.io.ObjectOutput out)
          Saves the property container's state.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MPropertyContainer

public MPropertyContainer()
Creates an empty property container.

Method Detail

clear

public void clear()
Clears properties.


size

public int size()
Gets the total number of properties.

Returns:
number of properties

getKeys

public java.lang.String[] getKeys()
Returns the property keys.

Returns:
the array of keys

getKey

public java.lang.String getKey(int i)
Gets a property key.

Parameters:
i - property index
Returns:
the property name

getString

public java.lang.String getString(java.lang.String key)
Gets a property.

Parameters:
key - property name
Returns:
the value of the property, or null if the key is not found

get

public chemaxon.struc.MProp get(java.lang.String key)
Gets a property object.

Parameters:
key - property name
Returns:
the value of the property, or null if the key is not found

setString

public void setString(java.lang.String key,
                      java.lang.String value)
Sets a property. Setting null value removes the property.

Parameters:
key - the property name
value - the value or null

set

public void set(java.lang.String key,
                chemaxon.struc.MProp value)
Sets a property object. Setting null value removes the property.

Parameters:
key - the property name
value - the value or null

set

public void set(java.lang.String key,
                chemaxon.struc.MProp value,
                int opts)
Sets a property object. Setting null value removes the property.

Parameters:
key - the property name
value - the value or null
opts - 0 or MProp.COORDDEP

isValid

public boolean isValid(chemaxon.struc.MProp prop)
Tests whether a coordinate dependent property is still valid.

Parameters:
prop - the property
Returns:
true if the property is valid, false otherwise
See Also:
MProp.COORDDEP, set(String, MProp, int)

getObject

public java.lang.Object getObject(java.lang.String key)
Gets a property object.

Parameters:
key - property name
Returns:
the value of the property, or null if the key is not found

setObject

public void setObject(java.lang.String key,
                      java.lang.Object val)
Sets a property object. Setting null value removes the property.

Parameters:
key - the property name
val - the value or null

clone

public java.lang.Object clone()
Clones this object.


readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Restores the property container's state.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - the stream to read data from in order to restore the object
Throws:
java.io.IOException - if I/O errors occur
java.lang.ClassNotFoundException - If the class for an object being restored cannot be found.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Saves the property container's state.

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - the stream to write the object to
Throws:
java.io.IOException - Includes any I/O exceptions that may occur