com.novell.service.nds
Class NdsPostalAddress

java.lang.Object
  |
  +--com.novell.service.nds.NdsPostalAddress

public class NdsPostalAddress
extends java.lang.Object
implements NdsAttributeValue, , java.lang.Cloneable, java.io.Serializable

Provides access to values of the Postal Address attribute. It is used for attributes whose values are postal addresses. An attribute value for Postal Address is typically composed of selected attributes from the MHS Unformatted Postal O/R Address version 1 according to Recommendation F.401. The value is limited to 6 lines of 30 characters each, including a Postal Country Name. Normally the information contained in such an address could include a name, street address, city, state or province, postal code and possibly a postal office box number, depending on the specific requirements of the named object. A blank line is a zero-length Unicode string.

Two postal addresses match for equality if, and only if, the number of strings in each is the same and all corresponding strings match. For two corresponding strings in the list to match, they must be the same length and their corresponding characters must be identical. 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

See Also:
NdsSyntaxId

Constructor Summary
NdsPostalAddress(java.lang.String[] value)
          Constructs an NdsPostalAddress object based on the specified value variable.
 
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.
 int count()
          Returns the number of elements in this sequence.
 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[] getPostalAddress()
          Returns the String array of Postal Address values stored in the NDS attribute.
 java.util.Enumeration getValues()
          Returns an enumeration of this sequence's values.
 boolean supportsMatchingRules(int matchingRules)
          Checks to see if this object supports the specified matching rules.
 java.lang.String toString()
          Generates a string representation of the object.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NdsPostalAddress

public NdsPostalAddress(java.lang.String[] value)
Constructs an NdsPostalAddress object based on the specified value variable.
Parameters:
value - The value of the postal address to be stored as a String array. The elements of the address depend on the specific requirements of the named object.
Method Detail

compareTo

public int compareTo(java.lang.Object anObject)
              throws java.lang.Exception
Compares two objects for ordering, or compares two strings lexicographically. The compareTo method does not apply to the Postal Address syntax because this syntax does not support the ordering and substrings matching rules.

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 java.lang.Object

count

public int count()
Returns the number of elements in this sequence.
Specified by:
count in interface
Returns:
The number of elements in this sequence as an int.

getValues

public java.util.Enumeration getValues()
Returns an enumeration of this sequence's values.
Specified by:
getValues in interface
Returns:
An enumeration of this sequence's values.

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 Postal Address 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 Postal Address syntax supports only the equality matching rule.
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.

toString

public java.lang.String toString()
Generates a string representation of the object. It returns a string that textually represents the object. The result should be a concise but informative representation that is easy to read.
Returns:
The String representation of the object.
Overrides:
toString in class java.lang.Object

getPostalAddress

public java.lang.String[] getPostalAddress()
Returns the String array of Postal Address values stored in the NDS attribute.
Returns:
The String array of Postal Address values.