iaik.xkms
Class NCName

Object
  extended by NCName

public final class NCName
extends Object

Represents an NCName according to the XML namespace declaration.


Constructor Summary
NCName(NCName src)
          Constructs a new NCName which represents the same String.
NCName(String ncname)
          Constructs a new NCName from the given String.
 
Method Summary
 boolean equals(NCName comp)
          Returns true if the given NCName is equal to this one.
 int length()
          Returns the length of this NCName.
 String toString()
          Returns the String representation of this NCName.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NCName

public NCName(String ncname)
Constructs a new NCName from the given String.

If the String does not conform to the NCName restrictions then the characters which are not allowed will be removed. If the first char is not valid it will be replaced by '_'. If the given String is empty or null then the "_" character will be used to build a valid NCName.

Parameters:
ncname - String from which to construct this NCName.

NCName

public NCName(NCName src)
Constructs a new NCName which represents the same String.

Parameters:
src - source NCName.
Method Detail

toString

public String toString()
Returns the String representation of this NCName.

The returned String will conform to the restrictions of an NCName.

Overrides:
toString in class Object
Returns:
String which conforms to the constraints of an NCName.

length

public int length()
Returns the length of this NCName.

Returns:
length of this NCName

equals

public boolean equals(NCName comp)
Returns true if the given NCName is equal to this one.

Parameters:
comp - the object to compare to
Returns:
true if the parameter and this object are equal, false otherwise