com.novell.service.nds
Class NdsPrintableString

java.lang.Object
  |
  +--com.novell.service.nds.NdsString
        |
        +--com.novell.service.nds.NdsPrintableString

public class NdsPrintableString
extends NdsString
implements NdsAttributeValue, java.lang.Cloneable, java.io.Serializable

Provides access to values of the Printable String attribute. It is used for attributes whose values are printable strings. Printable strings are defined in CCITT X.208.

Two printable strings match for equality when they are the same length and their corresponding characters are identical. Case (upper or lower) is significant when comparing printable strings. In matching attributes that conform to this syntax, NDS omits those spaces that are not significant (leading spaces, trailing spaces, and multiple consecutive internal spaces). NDS stores insignificant spaces with the attribute value.

Matching Rules: Equality and Substrings

See Also:
NdsSyntaxId

Constructor Summary
NdsPrintableString(java.lang.String value)
          Constructs an NdsPrintableString object based on the specified value parameter.
 
Method Summary
 boolean approximate(java.lang.Object anObject)
          Compares two Objects using the approximate matching rule.
 java.lang.Object clone()
          Creates a new object of the same class as this object.
 int compareTo(java.lang.Object anObject)
          Compares two objects for ordering, or compares two strings lexicographically.
 boolean equals(java.lang.Object anObject)
          Compares two Objects for equality.
 int getNdsSyntaxId()
          Returns the int that represents this NDS syntax ID.
 java.lang.String getPrintableString()
          Returns the String value of a printable string stored in the NDS attribute.
 boolean supportsMatchingRules(int matchingRules)
          Checks to see if this object supports the specified matching rules.
 
Methods inherited from class com.novell.service.nds.NdsString
getName, stringValue, toString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NdsPrintableString

public NdsPrintableString(java.lang.String value)
Constructs an NdsPrintableString object based on the specified value parameter.
Parameters:
value - The printable string to be stored as a String value.
Method Detail

compareTo

public int compareTo(java.lang.Object anObject)
              throws java.lang.Exception
Compares two objects for ordering, or compares two strings lexicographically. For the Printable String syntax, the compareTo method compares this NDS Object (string) with a reference NDS Object (string) contained in the anObject parameter. The comparison is done according to the substrings matching rule for this syntax.
Parameters:
anObject - The reference NDS Object (string) with which to compare.
Returns:
An int set to 0 if the reference Object (string) is equal to this Object (string); an int <0 if the reference Object (string) is less than this Object (string); an int >0 if the reference Object (string) is greater than this Object (string).
Throws:
java.lang.IllegalArgumentException - The passed-in object is of a different type than this NDS Object.
Overrides:
compareTo in class NdsString

equals

public boolean equals(java.lang.Object anObject)
Compares two Objects for equality. The equals method compares this object value with the value of the reference object in the anObject parameter.

The equals method implements the most discriminating possible equivalence relation on objects; that is, for any reference values X and Y, this method returns TRUE if and only if X and Y refer to the same object (X==Y has the value TRUE).

Parameters:
anObject - The reference object with which to compare.
Returns:
A boolean set to TRUE if and only if the argument is not NULL and is an NDS integer object that contains the same value as this object, otherwise set to FALSE.
Overrides:
equals in class NdsString

approximate

public boolean approximate(java.lang.Object anObject)
                    throws java.lang.Exception
Compares two Objects using the approximate matching rule. The approximate method does not apply to the Printable String syntax because this syntax does not support the approximate equals matching rule.
Specified by:
approximate in interface NdsAttributeValue

getNdsSyntaxId

public int getNdsSyntaxId()
Returns the int that represents this NDS syntax ID.
Specified by:
getNdsSyntaxId in interface NdsAttributeValue
Returns:
The syntax ID as an int.

supportsMatchingRules

public boolean supportsMatchingRules(int matchingRules)
Checks to see if this object supports the specified matching rules. The Printable String syntax supports both the equality and substrings matching rules.
Specified by:
supportsMatchingRules in interface NdsAttributeValue
Parameters:
matchingRules - The set of matching rules to check.
Returns:
A Boolean set to TRUE if the matching rules for this object are equal to the matchingRules parameter.

clone

public java.lang.Object clone()
Creates a new object of the same class as this object. It then initializes each of the new object's fields by assigning Them the same value as the corresponding fields in this object. No constructor is called.
Returns:
A clone of this object instance containing the cloned syntax.
Overrides:
clone in class NdsString

getPrintableString

public java.lang.String getPrintableString()
Returns the String value of a printable string stored in the NDS attribute.
Returns:
The String value of a printable string.