org.ucl.xpath.types
Class QName

java.lang.Object
  extended byorg.ucl.xpath.types.AnyType
      extended byorg.ucl.xpath.types.AnySimpleType
          extended byorg.ucl.xpath.types.AnyAtomicType
              extended byorg.ucl.xpath.types.CtrType
                  extended byorg.ucl.xpath.types.QName
All Implemented Interfaces:
CmpEq

public class QName
extends CtrType
implements CmpEq

A representation of a QName datatype (name of a node)


Constructor Summary
QName()
          Initialises with a null prefix and null node name
QName(java.lang.String local_part)
          Initialises using only the node name (no prefix)
QName(java.lang.String prefix, java.lang.String local_part)
          Initialises using the supplied parameters
QName(java.lang.String prefix, java.lang.String local_part, java.lang.String ns)
          Initialises using the supplied parameters
 
Method Summary
 ResultSequence constructor(ResultSequence arg)
          Creates a new ResultSequence consisting of the extractable QName in the supplied ResultSequence
 boolean eq(AnyType arg)
          Equality comparison between this QName and the supplied QName
 boolean equals(java.lang.Object obj)
          Equality comparison between this QName and a supplied QName
 java.lang.String expanded_name()
          Retrieves the full pathname including the namespace.
 boolean expanded()
          Check for whether a namespace has been defined for this node
 int hashCode()
          Calculates the hashcode for the full pathname
 java.lang.String local()
          Retrieves the node's name
 java.lang.String namespace()
          Retrieves the namespace that this node belongs in.
static QName parse_QName(java.lang.String str)
          Creates a new QName by parsing a String representation of the node name
 java.lang.String prefix()
          Retrieves the prefix of the node's pathname
 void set_namespace(java.lang.String n)
          Sets the namespace for this node
 java.lang.String string_type()
          Retrieves the datatype's full pathname
 java.lang.String string_value()
          Retrieves a String representation of the node name.
 java.lang.String string()
          Retrieves a String representation of the node name.
 java.lang.String type_name()
          Retrieves the datatype's name
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QName

public QName(java.lang.String prefix,
             java.lang.String local_part,
             java.lang.String ns)
Initialises using the supplied parameters

Parameters:
prefix - Prefix of the node name
local_part - The node name itself
ns - The namespace this nodename belongs to

QName

public QName(java.lang.String prefix,
             java.lang.String local_part)
Initialises using the supplied parameters

Parameters:
prefix - Prefix of the node name
local_part - The node name itself

QName

public QName(java.lang.String local_part)
Initialises using only the node name (no prefix)

Parameters:
local_part - The node name

QName

public QName()
Initialises with a null prefix and null node name

Method Detail

parse_QName

public static QName parse_QName(java.lang.String str)
Creates a new QName by parsing a String representation of the node name

Parameters:
str - String representation of the name
Returns:
null

constructor

public ResultSequence constructor(ResultSequence arg)
                           throws DynamicError
Creates a new ResultSequence consisting of the extractable QName in the supplied ResultSequence

Specified by:
constructor in class CtrType
Parameters:
arg - The ResultSequence to extract from
Returns:
New ResultSequence consisting of the QName supplied
Throws:
DynamicError

string_value

public java.lang.String string_value()
Retrieves a String representation of the node name. This method is functionally identical to string()

Specified by:
string_value in class AnyType
Returns:
String representation of the node name

string_type

public java.lang.String string_type()
Retrieves the datatype's full pathname

Specified by:
string_type in class AnyType
Returns:
"xs:QName" which is the datatype's full pathname

type_name

public java.lang.String type_name()
Retrieves the datatype's name

Specified by:
type_name in class CtrType
Returns:
"QName" which is the datatype's name

string

public java.lang.String string()
Retrieves a String representation of the node name. This method is functionally identical to string_value()

Returns:
String representation of the node name

expanded_name

public java.lang.String expanded_name()
Retrieves the full pathname including the namespace. This method must not be called if a namespace does exist for this node

Returns:
Full pathname including namespace

prefix

public java.lang.String prefix()
Retrieves the prefix of the node's pathname

Returns:
Prefix of the node's pathname

set_namespace

public void set_namespace(java.lang.String n)
Sets the namespace for this node

Parameters:
n - Namespace this node belongs in

namespace

public java.lang.String namespace()
Retrieves the namespace that this node belongs in. This method must not be called if the node does not belong in a namespace

Returns:
Namespace that this node belongs in

local

public java.lang.String local()
Retrieves the node's name

Returns:
Node's name

expanded

public boolean expanded()
Check for whether a namespace has been defined for this node

Returns:
True if a namespace has been defined for node. False otherwise

equals

public boolean equals(java.lang.Object obj)
Equality comparison between this QName and a supplied QName

Parameters:
obj - The object to compare with. Should be of type QName
Returns:
True if the two represent the same node. False otherwise

hashCode

public int hashCode()
Calculates the hashcode for the full pathname

Returns:
The hashcode for the full pathname

eq

public boolean eq(AnyType arg)
           throws DynamicError
Equality comparison between this QName and the supplied QName

Specified by:
eq in interface CmpEq
Parameters:
arg - The QName to compare with
Returns:
True if the two represent the same node. False otherwise
Throws:
DynamicError