org.apache.oodt.xmlquery
Class Header

java.lang.Object
  extended by org.apache.oodt.xmlquery.Header
All Implemented Interfaces:
Serializable, Cloneable, Documentable

public class Header
extends Object
implements Serializable, Cloneable, Documentable

A single header. An object of this class is a header element of a query.

Author:
Kelly
See Also:
Serialized Form

Constructor Summary
Header()
          Create a new, blank header.
Header(Node node)
          Create a header from a DOM node.
Header(String name)
          Create a header.
Header(String name, String type, String unit)
          Create a fully specified header.
 
Method Summary
 Object clone()
           
static List createHeaders(Node root)
          Create a list of headers from an XML document.
 boolean equals(Object rhs)
           
 String getName()
          Get the name.
 String getType()
          Get the type of this result.
 String getUnit()
          Get the unit.
 int hashCode()
           
 void setName(String name)
          Set the name.
 void setType(String type)
          Set the type of this result.
 void setUnit(String unit)
          Set the unit.
 String toString()
           
 Node toXML(Document doc)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Header

public Header()
Create a new, blank header. This initializes the result with default values for various properties.


Header

public Header(String name)
Create a header. Here, you specify the header's name only.

Parameters:
name - Name of this header.

Header

public Header(String name,
              String type,
              String unit)
Create a fully specified header.

Parameters:
name - Name of this header.
type - Data type.
unit - Units.

Header

public Header(Node node)
Create a header from a DOM node.

Parameters:
node - The DOM node, which must be a <headerElement> element.
Method Detail

createHeaders

public static List createHeaders(Node root)
Create a list of headers from an XML document.

Parameters:
root - A <resultHeader> element.
Returns:
A list of Headers.

getName

public String getName()
Get the name.

Returns:
The name of the header, suitable for printing in a column heading.

getType

public String getType()
Get the type of this result.

Returns:
The type, as in data type.

getUnit

public String getUnit()
Get the unit.

Returns:
The units in which the header is presented.

setName

public void setName(String name)
Set the name.

Parameters:
name - The name of the header, suitable for printing in a column heading.

setType

public void setType(String type)
Set the type of this result.

Parameters:
type - The type, as in data type.

setUnit

public void setUnit(String unit)
Set the unit.

Parameters:
unit - The units in which the header is presented.

toXML

public Node toXML(Document doc)
           throws DOMException
Specified by:
toXML in interface Documentable
Throws:
DOMException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object rhs)
Overrides:
equals in class Object

clone

public Object clone()
Overrides:
clone in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 1999-2012 Apache OODT. All Rights Reserved.