org.jscience.ml.om
Class Imager

java.lang.Object
  extended by org.jscience.ml.om.SchemaElement
      extended by org.jscience.ml.om.Imager
All Implemented Interfaces:
IImager, ISchemaElement
Direct Known Subclasses:
CCDImager

public abstract class Imager
extends SchemaElement
implements IImager

An Imager describes a camera. This class is an abstract implementation of org.jscience.ml.om.IImager.
If you need an instance use one of the subclasses.

Since:
1.3

Field Summary
 
Fields inherited from interface org.jscience.ml.om.IImager
CCD, FILM, XML_ELEMENT_IMAGER, XML_ELEMENT_MODEL, XML_ELEMENT_REMARKS, XML_ELEMENT_TYPE, XML_ELEMENT_VENDOR
 
Fields inherited from interface org.jscience.ml.om.ISchemaElement
XML_ELEMENT_ATTRIBUTE_ID
 
Constructor Summary
  Imager(org.w3c.dom.Node imager)
          Constructs a new instance of an Imager from an given XML Schema Node.
protected Imager(java.lang.String model)
          Constructs a new instance of an Imager.
 
Method Summary
 org.w3c.dom.Element addAsLinkToXmlElement(org.w3c.dom.Element parent)
          Adds the imager link to an given XML DOM Element The IImager element itself will be attached to given elements ownerDocument.
abstract  org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element element)
          Adds this IImager to a given parent XML DOM Element.
protected  org.w3c.dom.Element createXmlImagerElement(org.w3c.dom.Element parent)
          Creates an XML DOM Element for the Imager.
 boolean equals(java.lang.Object obj)
          Overwrittes equals(Object) method from java.lang.Object.
 java.lang.String getDisplayName()
          Returns a display name for this element.
 java.lang.String getModel()
          Returns the model name of this imager.
 java.lang.String getRemarks()
          Returns the remarks to this imager.
 java.lang.String getType()
          Returns the type of this imager.
 java.lang.String getVendor()
          Returns the vendor name of this imager.
 void setModel(java.lang.String modelname)
          Sets the model name for the imager.
 void setRemarks(java.lang.String remarks)
          Sets the remarks for this imager.
 void setType(java.lang.String type)
          Sets the type for this imager.
 void setVendor(java.lang.String vendor)
          Sets the vendor name for the imager.
 
Methods inherited from class org.jscience.ml.om.SchemaElement
getID, setID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jscience.ml.om.ISchemaElement
getID
 

Constructor Detail

Imager

public Imager(org.w3c.dom.Node imager)
       throws SchemaException,
              java.lang.IllegalArgumentException
Constructs a new instance of an Imager from an given XML Schema Node.
Normally this constructor is only used by org.jscience.ml.om.util.SchemaLoader

Parameters:
imager - The XML Schema element that represents this imager
Throws:
java.lang.IllegalArgumentException - if parameter is null,
SchemaException - if the given Node does not match the XML Schema specifications

Imager

protected Imager(java.lang.String model)
          throws java.lang.IllegalArgumentException
Constructs a new instance of an Imager.

Parameters:
model - The imager model name
Throws:
java.lang.IllegalArgumentException - if model is null
Method Detail

getDisplayName

public 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
Specified by:
getDisplayName in class SchemaElement
Returns:
Returns a String with a one line display name
See Also:
java.lang.Object.toString();

equals

public boolean equals(java.lang.Object obj)
Overwrittes equals(Object) method from java.lang.Object.
Checks if this imager and the given Object are equal. The given object is equal with this Imager is model, type and vendor are equal.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The Object to compare this Imager with.
Returns:
true if the given Object is an instance of IImager and its modelname, vendorname, and type matches with this Imager.
*
See Also:
Object

addToXmlElement

public abstract org.w3c.dom.Element addToXmlElement(org.w3c.dom.Element element)
Adds this IImager to a given parent XML DOM Element. The IImager element will be set as a child element of the passed element.

Specified by:
addToXmlElement in interface IImager
Parameters:
element - The parent element for this IImager
Returns:
Returns the element given as parameter with this IImager as child element.
* Might return null if parent was null.
See Also:
Element

addAsLinkToXmlElement

public org.w3c.dom.Element addAsLinkToXmlElement(org.w3c.dom.Element parent)
Adds the imager link to an given XML DOM Element The IImager element itself will be attached to given elements ownerDocument. If the ownerDocument has no IImager container, it will be created.
Example:
<parameterElement>
<imagerLink>123</imagerLink>
</parameterElement>
More stuff of the xml document goes here
<imagerContainer>
<imager id="123">
imager description goes here
</imager>
</imagerContainer>

Specified by:
addAsLinkToXmlElement in interface IImager
Parameters:
parent - The element under which the the imager link is created
Returns:
Returns the Element given as parameter with a additional imager link, and the imager element under the imager container of the ownerDocument Might return null if element was null.
See Also:
Element

getModel

public java.lang.String getModel()
Returns the model name of this imager.

Specified by:
getModel in interface IImager
Returns:
Returns the model name of this imager.

getVendor

public java.lang.String getVendor()
Returns the vendor name of this imager.

Specified by:
getVendor in interface IImager
Returns:
Returns the vendor name of this imager or NULL if vendor name was not set.
*

getType

public java.lang.String getType()
Returns the type of this imager.
Only two types are allowed:
- IImager.CCD
- IImager.Film

Specified by:
getType in interface IImager
Returns:
Returns the type imager or NULL if type was not set.
*

getRemarks

public java.lang.String getRemarks()
Returns the remarks to this imager.

Specified by:
getRemarks in interface IImager
Returns:
Returns the remarks to this imager or NULL if no remarks were set.
*

setModel

public void setModel(java.lang.String modelname)
              throws java.lang.IllegalArgumentException
Sets the model name for the imager.

Specified by:
setModel in interface IImager
Parameters:
modelname - The new model name to be set.
Throws:
java.lang.IllegalArgumentException - if new modelname is null or empty string

setVendor

public void setVendor(java.lang.String vendor)
Sets the vendor name for the imager.

Specified by:
setVendor in interface IImager
Parameters:
vendor - The new vendor name to be set.

setType

public void setType(java.lang.String type)
Sets the type for this imager.
Only two types are allowed:
- IImager.CCD
- IImager.Film
If some other type is given, no change will take place.

Specified by:
setType in interface IImager
Parameters:
type - The new image type.
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

setRemarks

public void setRemarks(java.lang.String remarks)
Sets the remarks for this imager.

Specified by:
setRemarks in interface IImager
Parameters:
remarks - The new remarks.

createXmlImagerElement

protected org.w3c.dom.Element createXmlImagerElement(org.w3c.dom.Element parent)
Creates an XML DOM Element for the Imager. The new Imager element will be added as child element to an given parent element. The given parent element should be the target container. All specialised subclasses may use this method to create a Imager element under which they may store their addition data.
Example:
<imagerContainer>
<imager>
More specialised stuff goes here
</imager>
</imagerContainer>

Parameters:
parent - The target container element
Returns:
Returns the new created target element (which is a child of the passed container element) Might return null if parent was null.
See Also:
Element