| org.griphyn.vdl.classes.VDL org.griphyn.vdl.classes.Definition
All known Subclasses: org.griphyn.vdl.classes.Transformation, org.griphyn.vdl.classes.Derivation,
Definition | abstract public class Definition extends VDL implements Comparable,Serializable(Code) | | This is a base class which collects attributes that belong to
Transformation and Derivation .
Note: this class has a natural ordering that may be inconsistent with
equals due to differing implementations. The equal method will take
object type and primary key triple into consideration, making extensive
null checks. The compareTo method compares the type and short ids of
the Definitions.
author: Jens-S. Vöckler author: Yong Zhao version: $Revision: 50 $ See Also: Transformation See Also: Derivation See Also: |
Method Summary | |
public int | compareTo(Object o) Implementation of the
java.lang.Comparable interface.
Compares this object with the specified object for order. | public boolean | equals(Object obj) Accessor: match primary keys of two Definitions.
Note, this match is not wildcard capable. | public String | getDescription() Accessor: Obtains the current description state. | public String | getKeyword() Accessor: Obtains the current keyword state.
a string containing a collection of keywords describing thedefinition, or null for no keywords. | public String | getName() Accessor: Obtains the current name of the definition. | public String | getNamespace() Accessor: Obtains the current namespace that is used for the
definition. | public String | getTitle() Accessor: Obtains the current title state. | abstract public int | getType() This is an abstract function that must be implemented by
instantiable children, of which currently only exist
Transformation and
Derivation siblings and derivatives. | public String | getUrl() Accessor: Obtains the current URI definition. | public String | getVersion() Accessor: Obtains the current version of the definition. | public int | hashCode() Calculate a hash code value for the object to support hash tables. | abstract public String | identify() Identify the transformation or derivation by its name. | public boolean | match(int type, String namespace, String name, String version) Accessor: match the primary key of a definition.
Note, this match is not wildcard capable. | public void | setDescription(String description) Accessor: Sets the description. | public void | setKeyword(String keyword) Accessor: Sets or overwrites the keyword list. | public void | setName(String name) Accessor: Sets or overwrite the currently given name. | public void | setNamespace(String namespace) Accessor: Sets or overwrites the namespace identifier. | public void | setTitle(String title) Accessor: Sets the current title for the definition. | public void | setUrl(String url) Accessor: Sets the project reference. | public void | setVersion(String version) Accessor: Sets the version of the definition. | public static String | shortID(Definition d, String namespace, String name, String version) Create the short id from ns:id:version.
Parameters: d - is a Definition, or null for non-siblings Parameters: namespace - is the namespace to use, may be null. Parameters: name - is the name to produce the id for, should not be null. Parameters: version - is a version string, may be null. | public String | shortID() Constructs dynamically a short descriptive, hopefully unique
identifier for this derivation w/o referring to any transformation.
FIXME: Anonymous derivations get their hash code, which is well
for the first versions working without database. | public String | toXML() The toXML method is a partial method, to be incorporated/called
by its sibling class method of the same name. | public void | toXML(Writer stream) The toXML method is a partial method, to be incorporated/called
by its sibling class method of the same name. |
Definition | public Definition()(Code) | | ctor: empty
|
Definition | public Definition(String name)(Code) | | Convenience ctor: name the definition. The name is part of a
logical
Transformation . Note that a
Derivation may
remain anonymous. The namespace will be the default namespace, or
taken from the
Definitions . The version remains unset.
Parameters: name - is the name to be used for the defintion. |
Definition | public Definition(String namespace, String name)(Code) | | Convenience ctor: name the definition. The name is part of a
logical
Transformation . Note that a
Derivation may
remain anonymous. The version remains unset.
Parameters: namespace - is the namespace the name resides in. Parameters: name - is the name to be used for the defintion. |
Definition | public Definition(String namespace, String name, String version)(Code) | | Convenience ctor: name the definition. The name is part of a
logical
Transformation . Note that a
Derivation may
remain anonymous.
Parameters: namespace - is the namespace the name resides in. Parameters: name - is the name to be used for the defintion. Parameters: version - is the version of this definition. |
compareTo | public int compareTo(Object o)(Code) | | Implementation of the
java.lang.Comparable interface.
Compares this object with the specified object for order. Returns a
negative integer, zero, or a positive integer as this object is
less than, equal to, or greater than the specified object. The
definitions are compared by their type, and by their short ids.
Parameters: o - is the object to be compared a negative number, zero, or a positive number, if the object compared against is less than, equals or greater thanthis object. exception: ClassCastException - if the specified object's typeprevents it from being compared to this Object. |
equals | public boolean equals(Object obj)(Code) | | Accessor: match primary keys of two Definitions.
Note, this match is not wildcard capable. The type of the definitions
will also be checked. The primary key of a definition is the triple
namespace, name and version. The equals function is null-capable.
Parameters: obj - the reference object with which to compare. true, if the primary keys match, false otherwise. |
getType | abstract public int getType()(Code) | | This is an abstract function that must be implemented by
instantiable children, of which currently only exist
Transformation and
Derivation siblings and derivatives.
the integer representing the concrete definition type of a instance. The value of -1 *might* be used to indicate an unknowntype. |
hashCode | public int hashCode()(Code) | | Calculate a hash code value for the object to support hash tables.
a hash code value for the object. |
identify | abstract public String identify()(Code) | | Identify the transformation or derivation by its name.
|
match | public boolean match(int type, String namespace, String name, String version)(Code) | | Accessor: match the primary key of a definition.
Note, this match is not wildcard capable. The type of the definitions
will also be checked. The primary key of a definition is the triple
namespace, name and version. This function is null-capable.
Parameters: type - is the type identifier TRANSFORMATION or DERIVATION Parameters: namespace - is the namespace Parameters: name - is the name Parameters: version - is the version true, if the primary keys match, false otherwise. |
shortID | public static String shortID(Definition d, String namespace, String name, String version)(Code) | | Create the short id from ns:id:version.
Parameters: d - is a Definition, or null for non-siblings Parameters: namespace - is the namespace to use, may be null. Parameters: name - is the name to produce the id for, should not be null. Parameters: version - is a version string, may be null. A string which textually identifies a Definition. exception: RuntimeException - , if the name and definition are both null. |
shortID | public String shortID()(Code) | | Constructs dynamically a short descriptive, hopefully unique
identifier for this derivation w/o referring to any transformation.
FIXME: Anonymous derivations get their hash code, which is well
for the first versions working without database. Later versions
with database must use some unique sequence mechanism instead.
a string describing the derivation See Also: Object.hashCode |
toXML | public String toXML()(Code) | | The toXML method is a partial method, to be incorporated/called
by its sibling class method of the same name. For this reason,
it does not fit the
VDL interface.
a string containing the attributes collected in the base class. |
toXML | public void toXML(Writer stream) throws IOException(Code) | | The toXML method is a partial method, to be incorporated/called
by its sibling class method of the same name. For this reason,
it does not fit the
VDL interface.
Parameters: stream - is a stream opened and ready for writing. This can alsobe a string stream for efficient output. exception: IOException - if something fishy happens to the stream. |
|
|