Overview | Package | Class | Tree | Deprecated | Index | Help
| Compoze Software, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.compoze.contact
Class DistributionLists

    java.lang.Object
      |
      +--com.compoze.contact.DistributionLists

All Implemented Interfaces:
  com.compoze.common.IPagination, java.io.Serializable

public class DistributionLists
extends java.lang.Object
implements com.compoze.common.IPagination, java.io.Serializable

This class represents a distribution list. A distribution list is a grouping of contacts. The distribution list collection may be used to iterate through lists and sub-lists and associated contacts.

The distribution list collection may also be used for searching. The following code segment shows how to reduce the distribution list that are returned in the collection to ones with a particular name and implies sorting:

     ContactSession s = ContactSession.getSession(user);
     DistributionLists	lists = s.getDistributionLists();

     DistributionListFilter filter = new DistributionListFilter();
     filter.setName("Friends");

     lists.setFilter(filter);
     lists.sort(SortOrder.ASCENDING, DistributionListProperty.NAME);

     Iterator	it = lists.lists().iterator();
     while(it.hasNext())
    	{
    	DistributionList	dl = (DistributionList) it.next();
    	...
      }

See Also:
  Serialized Form

Method Summary
`DistributionList` | `add()` Adds a distribution list to the collection.
`void` | `clearFilter()` Clears the distribution list filter for this collection of lists.
`void` | `clearSort()` Clears the sorting for this collection of lists.
`int` | `getCount()` Gets the number of lists in the collection.
`int` | `getCurrentPageNumber()` Gets the number of the current page.
`DistributionList` | `getDistributionList(long id)` Gets a distribution list with the given id.
`DistributionListFilter` | `getFilter()` Gets the distribution list filter.
`int` | `getNextPageNumber()` Gets the number of the next page.
`int` | `getPageCount()` Gets the total number of pages in the object for pagination.
`int` | `getPageSize()` Gets the number of lists to appear on a single page.
`int` | `getPreviousPageNumber()` Gets the number of the previous page.
`int` | `getShowingFrom()` Gets the from index.
`int` | `getShowingTo()` Gets the to index.
`SortOrder` | `getSort()` Gets the sort order.
`DistributionListProperty` | `getSortProperty()` Gets the sort property.
`boolean` | `isFirstPage()` Checks if current page is the first page.
`boolean` | `isLastPage()` Checks if current page is the last page.
`java.util.List` | `lists()` Gets the list of all lists the authenticated user has `READ` access to.
`java.util.List` | `lists(int iPageNumber)` Gets the sublist of lists on the specified page number.
`java.util.List` | `lists(int iFromIndex, int iToIndex)` Gets the sublist of lists between the specified `iFromIndex` and `iToIndex`.
`void` | `setFilter(DistributionListFilter filter)` Sets the distribution list filter.
`void` | `setPageSize(int iPageSize)` Sets the number of lists to appear on a single page.
`void` | `sort(SortOrder order, DistributionListProperty property)` Sorts the lists in the collection.
`java.lang.String` | `toString()` Returns the string representation of this object.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Method Detail

### add

    public DistributionList add()
                         throws java.security.AccessControlException

  Adds a distribution list to the collection.
  Returns:
    the new distribution list or `null` if create fails

### setFilter

    public void setFilter(DistributionListFilter filter)

  Sets the distribution list filter. The filter may be used to restrict the lists that are returned by the collection. To clear the filter, use `clearFilter()`.
  Returns:
    the distribution list filter (may not be `null`)

### getFilter

    public DistributionListFilter getFilter()

  Gets the distribution list filter. The filter may be used to restrict the lists that are returned by the collection.
  Returns:
    the distribution list filter or `null` if no filter is set

### clearFilter

    public void clearFilter()

  Clears the distribution list filter for this collection of lists.

### getPageSize

    public int getPageSize()

  Gets the number of lists to appear on a single page.
  Specified by:
    `getPageSize` in interface `com.compoze.common.IPagination`
  Returns:
    the number of lists

### setPageSize

    public void setPageSize(int iPageSize)

  Sets the number of lists to appear on a single page.
  Specified by:
    `setPageSize` in interface `com.compoze.common.IPagination`
  Parameters:
    `iPageSize` - the number of lists on a single page (must be greater than zero)

### getPageCount

    public int getPageCount()

  Gets the total number of pages in the object for pagination.
  Specified by:
    `getPageCount` in interface `com.compoze.common.IPagination`
  Returns:
    the total number of pages (0 for none)

### getShowingFrom

    public int getShowingFrom()

  Gets the from index. Based on the last call to any of the `lists() methods, the from index is returned.`
  Specified by:
    `getShowingFrom` in interface `com.compoze.common.IPagination`
  Returns:
    the from index or -1 if all lists were returned
  See Also:
    `lists()`, `lists(int)`, `lists(int, int)`

### getShowingTo

    public int getShowingTo()

  Gets the to index. Based on the last call to any of the `lists() methods, the to index is returned.`
  Specified by:
    `getShowingTo` in interface `com.compoze.common.IPagination`
  Returns:
    the from index or -1 if all lists were returned
  See Also:
    `lists()`, `lists(int)`, `lists(int, int)`

### getCurrentPageNumber

    public int getCurrentPageNumber()

  Gets the number of the current page.
  Specified by:
    `getCurrentPageNumber` in interface `com.compoze.common.IPagination`
  Returns:
    the current page number

### getNextPageNumber

    public int getNextPageNumber()

  Gets the number of the next page.
  Specified by:
    `getNextPageNumber` in interface `com.compoze.common.IPagination`
  Returns:
    the next page number

### getPreviousPageNumber

    public int getPreviousPageNumber()

  Gets the number of the previous page.
  Specified by:
    `getPreviousPageNumber` in interface `com.compoze.common.IPagination`
  Returns:
    the previous page

### isFirstPage

    public boolean isFirstPage()

  Checks if current page is the first page.
  Specified by:
    `isFirstPage` in interface `com.compoze.common.IPagination`
  Returns:
    `true` if this is the first page; `false` otherwise

### isLastPage

    public boolean isLastPage()

  Checks if current page is the last page.
  Specified by:
    `isLastPage` in interface `com.compoze.common.IPagination`
  Returns:
    `true` if this is the last page; `false` otherwise

### lists

    public java.util.List lists(int iPageNumber)

  Gets the sublist of lists on the specified page number. The number of lists returned will be equaled to the page size (see `getPageSize()`.
  Parameters:
    `iPageNumber` - the page number (must be greater than zero and less than the total page count)
  Returns:
    the un-modifiable list of `DistributionList` objects
  See Also:
    `getPageCount()`

### lists

    public java.util.List lists()

  Gets the list of all lists the authenticated user has `READ` access to.
  Returns:
    the un-modifiable list of `DistributionList` objects

### lists

    public java.util.List lists(int iFromIndex,
                                int iToIndex)

  Gets the sublist of lists between the specified `iFromIndex` and `iToIndex`.
  Parameters:
    `iFromIndex` - the from index endpoint (inclusive) of the list
    `iToIndex` - the to index highpoint (exclusive) of the list
  Returns:
    the un-modifiable list of `DistributionList` objects

### getCount

    public int getCount()

  Gets the number of lists in the collection. The filter for this collection is applied if one exists; therefore, the number represents the number of lists satisfying the filter, not the total number of lists.
  Returns:
    the number of lists or -1 if a count is not available

### getDistributionList

    public DistributionList getDistributionList(long id)
                                         throws java.security.AccessControlException

  Gets a distribution list with the given id.
  Parameters:
    `id` - the distribution list id
  Returns:
    the distribution list or `null` if not found

### sort

    public void sort(SortOrder order,
                     DistributionListProperty property)

  Sorts the lists in the collection.
  Parameters:
    `sortOrder` - the sort order
    `property` - the property to sort by

### clearSort

    public void clearSort()

  Clears the sorting for this collection of lists.

### getSort

    public SortOrder getSort()

  Gets the sort order.
  Returns:
    the sort order or `null` if not sorting is imposed

### getSortProperty

    public DistributionListProperty getSortProperty()

  Gets the sort property.
  Returns:
    the property to sort by or `null` if no property set

### toString

    public java.lang.String toString()

  Returns the string representation of this object.
  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    the string representation of this object

Overview | Package | Class | Tree | Deprecated | Index | Help
| Compoze Software, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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