Package chemaxon.marvin.io
Class MFieldAccessor
- java.lang.Object
-
- chemaxon.marvin.io.MFieldAccessor
-
@PublicAPI public abstract class MFieldAccessor extends Object
Abstract class for extracting fields (properties) from input and storing them. Under development, please do not implement it yet!- Since:
- Marvin 5.0, 11/08/2007
-
-
Constructor Summary
Constructors Constructor Description MFieldAccessor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
getFields(int irec, Molecule mol, String[] keys, MProp[] values)
Extracts properties.abstract String[]
getKeys(int irec, Molecule mol)
Gets the keys in a record.abstract Molecule
getMainMolecule(int irec, Molecule mol)
Gets the main molecule object in a record.abstract boolean
isEditable(int irec, Molecule mol, String key)
Tests whether a field is editable or not.protected String
propToString(MProp p)
Converts a property to a string.void
setField(int irec, Molecule mol, String key, MProp p)
Sets a property.abstract void
setFields(int irec, Molecule mol, String[] keys, MProp[] values)
Sets properties.
-
-
-
Method Detail
-
getMainMolecule
public abstract Molecule getMainMolecule(int irec, Molecule mol)
Gets the main molecule object in a record.- Parameters:
irec
- the record numbermol
- input molecule, may benull
in case of an implementation for which the record number is enough- Returns:
- the main molecule object or
null
if it does not exist
-
getKeys
public abstract String[] getKeys(int irec, Molecule mol)
Gets the keys in a record.- Parameters:
irec
- the record numbermol
- input molecule, may benull
in case of an implementation for which the record number is enough- Returns:
- the array of keys
-
getFields
public abstract void getFields(int irec, Molecule mol, String[] keys, MProp[] values)
Extracts properties.- Parameters:
irec
- the record numbermol
- input molecule, may benull
in case of an implementation for which the record number is enoughkeys
- array of field keysvalues
- the output array, may containnull
if a property is not found
-
setFields
public abstract void setFields(int irec, Molecule mol, String[] keys, MProp[] values)
Sets properties.- Parameters:
irec
- the record numbermol
- input molecule, may benull
in case of an implementation for which the record number is enoughkeys
- array of field keysvalues
- array of values
-
isEditable
public abstract boolean isEditable(int irec, Molecule mol, String key)
Tests whether a field is editable or not.- Parameters:
irec
- the record numbermol
- input molecule, may benull
in case of an implementation for which the record number is enoughkey
- the field key- Returns:
true
if setFields works for this key,false
otherwise
-
setField
public final void setField(int irec, Molecule mol, String key, MProp p)
Sets a property.- Parameters:
irec
- the record numbermol
- input molecule, may benull
in case of an implementation for which the record number is enoughkey
- the field keyp
- the property value
-
-