Compoze Software, Inc.

com.compoze.domino
Class Recipient

java.lang.Object
  extended bycom.compoze.domino.Recipient
All Implemented Interfaces:
java.io.Serializable

public class Recipient
extends java.lang.Object
implements java.io.Serializable

This class represents a recipient of a memo. Recipients are either constructed with a display name and address, or with an address entry.

See Also:
Serialized Form

Constructor Summary
Recipient(RecipientType type, java.lang.String sAddress)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 java.lang.String getAddress()
          Gets the recipient address.
static Recipient[] getRecipients(Recipient[] recipients, RecipientType type)
          Gets the recipients from the array by the specified type.
 RecipientType getRecipientType()
          Gets the recipient type.
static Recipient[] parse(java.lang.String sRecipients, RecipientType type)
          Parses semicolon (";") delimited string of recipients into an array of Recipient objects.
static Recipient[] parse(java.lang.String sRecipients, RecipientType type, java.lang.String sDelimiter)
          Parses string of recipients into an array of Recipient objects.
 java.lang.String toString()
          Returns the string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Recipient

public Recipient(RecipientType type,
                 java.lang.String sAddress)
Constructor.

Parameters:
type - the recipient type (must not be null)
sAddress - the recipient address (must not be null)
Method Detail

getRecipientType

public RecipientType getRecipientType()
Gets the recipient type.

Returns:
the recipient type

getAddress

public java.lang.String getAddress()
Gets the recipient address.

Returns:
the address

getRecipients

public static Recipient[] getRecipients(Recipient[] recipients,
                                        RecipientType type)
Gets the recipients from the array by the specified type.

Parameters:
recipients - the recipients to read
type - the type of recipients to return
Returns:
an array of recipients of the specified type or an empty array for none

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. Recipients are considered equal if the types match and the addresses are the same ignoring case.

Parameters:
obj - the reference object with which to compare
Returns:
true if this object is the same as the obj argument; false otherwise

toString

public java.lang.String toString()
Returns the string representation of this object.

Returns:
the string representation of this object

parse

public static Recipient[] parse(java.lang.String sRecipients,
                                RecipientType type)
                         throws javax.mail.internet.AddressException
Parses semicolon (";") delimited string of recipients into an array of Recipient objects.

Parameters:
sRecipients - string of recipients to parse
type - the type of recipients (may not be null)
Returns:
an array of Recipient objects or an empty array
Throws:
javax.mail.internet.AddressException - if parse fails

parse

public static Recipient[] parse(java.lang.String sRecipients,
                                RecipientType type,
                                java.lang.String sDelimiter)
                         throws javax.mail.internet.AddressException
Parses string of recipients into an array of Recipient objects.

Parameters:
sRecipients - string of recipients to parse
type - the type of recipients (may not be null)
sDelimiter - the delimiter (may not be null)
Returns:
an array of Recipient objects or an empty array
Throws:
javax.mail.internet.AddressException - if parse fails

Compoze Software, Inc.

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.