NAME
Chemistry::Obj - Abstract chemistry object
SYNOPSIS
use base "Chemistry::Obj";
Chemistry::Obj::accessor('myattr1', 'myattr2');
DESCRIPTION
This module implements some generic methods that are used by Chemistry::Mol, Chemistry::Atom, Chemistry::Bond, etc.
Common Attributes
There are some common attributes that may be found in molecules, bonds, and atoms, such as id, name, and type. They are all accessed through the methods of the same name. For example, to get the id, call $obj->id; to set the id, call $obj->id('new_id').
- id
-
Objects should have a unique ID. The user has the responsibility for uniqueness if he assigns ids; otherwise a unique ID is assigned sequentially.
- name
-
An arbitrary name for an object. The name doesn't need to be unique.
- type
-
The interpretation of this attribute is not specified here, but it's typically used for bond orders and atom types.
- attr
-
A space where the user can store any kind of information about the object. The accessor method for attr expects the attribute name as the first parameter, and (optionally) the new value as the second parameter.
SEE ALSO
Chemistry::Atom, Chemistry::Bond, Chemistry::Mol
AUTHOR
Ivan Tubert <itub@cpan.org>
COPYRIGHT
Copyright (c) 2003 Ivan Tubert. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.