de.lehmannet.om
Class SchemaElement

java.lang.Object
  extended by de.lehmannet.om.SchemaElement
All Implemented Interfaces:
ISchemaElement
Direct Known Subclasses:
EquPosition, Eyepiece, Filter, Finding, Imager, Lens, Observation, Observer, Scope, Session, Site, Target

public abstract class SchemaElement
extends java.lang.Object
implements ISchemaElement

The SchemaElement represents the root class for all schema element classes. It provides a simple implemantation of the ISchemaInterface, so that any subclass inherits a unique ID.

Since:
1.0
Author:
doergn@users.sourceforge.net

Field Summary
 
Fields inherited from interface de.lehmannet.om.ISchemaElement
XML_ELEMENT_ATTRIBUTE_ID
 
Constructor Summary
SchemaElement()
          Constructs a new instance of a Schema Element.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Overwrittes equals(Object) method from java.lang.Object.
abstract  java.lang.String getDisplayName()
          Returns a display name for this element.
 java.lang.String getID()
          Returns a unique ID of this schema element.
 void setID(java.lang.String newID)
          Sets a unique ID of this schema element.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaElement

public SchemaElement()
Constructs a new instance of a Schema Element.
Any instance of a Schema Element has a unique ID which identifies the element, and which allows to link serveral elements.

Method Detail

equals

public boolean equals(java.lang.Object obj)
Overwrittes equals(Object) method from java.lang.Object.
Checks if the ID of this SchemaElement is equal to the given SchemaElement. If the given object is not derived from ISchemaElemnt, false is returned as well.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The Object to compare this SchemaElement with.
Returns:
true if the given Object is an instance of ISchemaElement and its ID equals this SchemaElements ID.
See Also:
Object

getID

public java.lang.String getID()
Returns a unique ID of this schema element.
The ID is used to link this element with other XML elements in the schema.

Specified by:
getID in interface ISchemaElement
Returns:
Returns a String representing a unique ID of this schema element.

setID

public void setID(java.lang.String newID)
Sets a unique ID of this schema element.
The ID is used to link this element with other XML elements in the schema.
Call this method only, if your know what you're doing.

Parameters:
newID - The new unique ID for this object.

getDisplayName

public abstract java.lang.String getDisplayName()
Returns a display name for this element.
The method differs from the toString() method as toString() shows more technical information about the element. Also the formating of toString() can spread over several lines.
This method returns a string (in one line) that can be used as displayname in e.g. a UI dropdown box.

Specified by:
getDisplayName in interface ISchemaElement
Returns:
Returns a String with a one line display name
See Also:
java.lang.Object.toString();