Package chemaxon.struc
Class MPropertyContainer
java.lang.Object
chemaxon.struc.MPropertyContainer
- All Implemented Interfaces:
Externalizable
,Serializable
,Cloneable
Property container.
- Since:
- Marvin 4.1, 11/20/2005
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears properties.clone()
Clones this object.boolean
Tests whether the container contains the specified property object.void
flatten()
Flattens hierarchically specified RDF properties.Gets a property object.getKey
(int i) Gets a property key.String[]
getKeys()
Returns the property keys.Gets a property object.Gets the list of basic properties.Deprecated, for removal: This API element is subject to removal in a future version.boolean
boolean
Tests whether a property is a self reference to the containing molecule.boolean
Tests whether a coordinate dependent property is still valid.void
Restores the property container's state.void
Removes a property.void
Replaces or removes a property.void
Sets a property object.void
Sets a property object.void
Sets a property object.void
Sets a property.int
size()
Gets the total number of properties.void
Saves the property container's state.
-
Constructor Details
-
MPropertyContainer
public MPropertyContainer()Creates an empty property container.
-
-
Method Details
-
clear
public void clear()Clears properties. -
size
public int size()Gets the total number of properties.- Returns:
- number of properties
-
getKeys
Returns the property keys.- Returns:
- the array of keys
-
getKey
Gets a property key.- Parameters:
i
- property index- Returns:
- the property name
-
getString
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public String getString(String key) Deprecated, for removal: This API element is subject to removal in a future version.As of Marvin 5.7, replaced byMPropHandler.convertToString(MPropertyContainer, String)
Gets a property.- Parameters:
key
- property name- Returns:
- the value of the property, or null if the key is not found
-
get
Gets a property object.- Parameters:
key
- property name- Returns:
- the value of the property, or null if the key is not found
-
setString
Sets a property. Setting null value removes the property.- Parameters:
key
- the property namevalue
- the value or null
-
set
Sets a property object. Setting null value removes the property.- Parameters:
key
- the property namevalue
- the value or null
-
set
Sets a property object. Setting null value removes the property.- Parameters:
key
- the property namevalue
- the value or nullopts
- 0 orMProp.COORDDEP
-
remove
Removes a property.- Parameters:
p
- the object- Since:
- Marvin 4.1.6, 02/21/2007
-
replace
Replaces or removes a property.- Parameters:
oldp
- the old objectnewp
- the new object ornull
to remove- Since:
- Marvin 4.1.6, 02/14/2007
-
contains
Tests whether the container contains the specified property object.- Parameters:
p
- the object- Since:
- Marvin 4.1.6, 02/21/2007
-
isValid
Tests whether a coordinate dependent property is still valid.- Parameters:
prop
- the property- Returns:
true
if the property is valid,false
otherwise- See Also:
-
isSelfReference
Tests whether a property is a self reference to the containing molecule.- Parameters:
p
- the property- Returns:
true
if the property is a self reference,false
otherwise- Since:
- Marvin 5.0, 11/05/2007
-
isHierarchic
public boolean isHierarchic()Tests whether the property list contains subcollections likeMListProp
andMHashProp
. A property list containing names in MDL RDfile style can be made hierarchic by callinghierarchize()
.- Returns:
true
if the property list contains subcollections,false
otherwise- Since:
- Marvin 4.1.6, 02/15/2007
-
hierarchize
- Returns:
- the most likely "root" name (the name of the first
MHashProp
type property) ornull
- Since:
- Marvin 4.1.6, 02/14/2007
- See Also:
-
flatten
public void flatten()Flattens hierarchically specified RDF properties. The inverse operation ofhierarchize()
.- Since:
- Marvin 4.1.6, 02/14/2007
- See Also:
-
getPropList
Gets the list of basic properties. Properties containers likeMListProp
andMHashProp
are not added to the list but searched recursively for their basic elements.- Returns:
- the list of
MProp
objects - Since:
- Marvin 4.1.6, 02/15/2007
-
getObject
Gets a property object.- Parameters:
key
- property name- Returns:
- the value of the property, or null if the key is not found
-
setObject
Sets a property object. Setting null value removes the property.- Parameters:
key
- the property nameval
- the value or null
-
clone
Clones this object. -
readExternal
Restores the property container's state.- Specified by:
readExternal
in interfaceExternalizable
- Parameters:
in
- the stream to read data from in order to restore the object- Throws:
IOException
- if I/O errors occurClassNotFoundException
- If the class for an object being restored cannot be found.
-
writeExternal
Saves the property container's state.- Specified by:
writeExternal
in interfaceExternalizable
- Parameters:
out
- the stream to write the object to- Throws:
IOException
- Includes any I/O exceptions that may occur
-
MPropHandler.convertToString(MPropertyContainer, String)