net.wimpi.pim.contact.model
Interface Organization

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
OrganizationImpl

public interface Organization
extends java.io.Serializable

An interface modeling an organization based on the types and information defined by the vCard Mime directory profile standard.

For reference see RFC 2426:
3.5 Organizational Types
3.5.5 ORG Type Definition
3.5.3 LOGO Type Definition

Note that the ORG type from the specification has been split into name and units (with their respective accessor and mutator methods).
Also note that an URL field has been added to the organization for convenience.
Units are used to specify a certain part of an organization.

Version:
0.1 (22/07/2003)
Author:
Dieter Wimberger
See Also:
Image

Method Summary
 void addUnit(java.lang.String unit)
          Adds a given unit to this Organization.
 Image getLogo()
          Returns the logo associated with this Organization.
 java.lang.String getName()
          Returns the name of this Organization.
 java.lang.String getUnit(int index)
          Returns the unit at the given index.
 int getUnitCount()
          Returns the number of set units.
 java.lang.String getURL()
          Returns the URL associated with this Organization.
 boolean hasLogo()
          Tests if this Organization has a logo associated.
 java.lang.String[] listUnits()
          Returns all units of this Organization.
 java.lang.String removeUnit(int index)
          Removes the unit at the given index.
 void setLogo(Image logo)
          Sets the logo associated with this Organization.
 void setName(java.lang.String name)
          Sets the name of this Organization.
 java.lang.String setUnit(int index, java.lang.String unit)
          Sets the unit at the given index, returning the replaced one.
 void setURL(java.lang.String url)
          Sets the URL associated with this Organization.
 

Method Detail

getName

public java.lang.String getName()
Returns the name of this Organization.

Returns:
the name as String.

setName

public void setName(java.lang.String name)
Sets the name of this Organization.

Parameters:
name - the name as String.

listUnits

public java.lang.String[] listUnits()
Returns all units of this Organization.

Returns:
the units as String[].

getUnit

public java.lang.String getUnit(int index)
                         throws java.lang.IndexOutOfBoundsException
Returns the unit at the given index.

Parameters:
index - the index as int.
Returns:
the unit as String.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

setUnit

public java.lang.String setUnit(int index,
                                java.lang.String unit)
                         throws java.lang.IndexOutOfBoundsException
Sets the unit at the given index, returning the replaced one.

Parameters:
index - the index as int.
unit - the unit to be set as String.
Returns:
the former unit at the index as String.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

addUnit

public void addUnit(java.lang.String unit)
Adds a given unit to this Organization.

Parameters:
unit - the unit as String.

removeUnit

public java.lang.String removeUnit(int index)
                            throws java.lang.IndexOutOfBoundsException
Removes the unit at the given index.

Parameters:
index - the index as int.
Returns:
the removed unit as String.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds.

getUnitCount

public int getUnitCount()
Returns the number of set units.

Returns:
the number of units as int.

getURL

public java.lang.String getURL()
Returns the URL associated with this Organization.

Returns:
the URL as String.

setURL

public void setURL(java.lang.String url)
Sets the URL associated with this Organization.

Parameters:
url - the URL as String.

getLogo

public Image getLogo()
Returns the logo associated with this Organization.

Returns:
the logo as Image.

setLogo

public void setLogo(Image logo)
Sets the logo associated with this Organization.

Parameters:
logo - the logo as Image.

hasLogo

public boolean hasLogo()
Tests if this Organization has a logo associated.

Returns:
true if it has a logo, false otherwise.


Copyright © 2001-2003 jpim team.