|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.compoze.discussion.Forums
This class represents a collection of forums. The forums collection may be used to iterate through all of the forums.
The forums collection may also be used for searching. The following code segment shows how to reduce the forums that are returned in the collection to ones with a particular name:
DiscussionSession s = DiscussionSession.getSession(user); Forums forums = s.getForums(); ForumFilter filter = new ForumFilter(); filter.setName("java"); forums.setFilter(filter); forums.sort(SortOrder.ASCENDING, ForumProperty.NAME); Iterator it = forums.forums().iterator(); while(it.hasNext()) { Forum f = (Forum) it.next(); ... }
Method Summary | |
Forum |
add(java.lang.String sName)
Adds a forum to the collection. |
void |
clearFilter()
Clears the forum filter for this collection of forums. |
void |
clearSort()
Clears the forum sorting for this collection of forums. |
java.util.List |
forums()
Gets the list of all forums the authenticated user has READ access to. |
java.util.List |
forums(int iPageNumber)
Gets the sublist of forums on the specified page number. |
java.util.List |
forums(int iFromIndex,
int iToIndex)
Gets the sublist of forums between the specified iFromIndex and iToIndex . |
int |
getCount()
Gets the number of forums in the collection. |
int |
getCurrentPageNumber()
Gets the number of the current page. |
ForumFilter |
getFilter()
Gets the forum filter. |
Forum |
getForum(long id)
Gets a forum with the given forum id. |
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 forums 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. |
ForumProperty |
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. |
void |
setFilter(ForumFilter filter)
Sets the forum filter. |
void |
setPageSize(int iPageSize)
Sets the number of forums to appear on a single page. |
void |
sort(SortOrder order,
ForumProperty property)
Sorts the forums 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 |
public Forum add(java.lang.String sName)
sName
- the name of the forumnull
if create failspublic void setFilter(ForumFilter filter)
clearFilter()
.null
)public ForumFilter getFilter()
null
if no filter is setpublic void clearFilter()
public int getPageSize()
getPageSize
in interface com.compoze.common.IPagination
public void setPageSize(int iPageSize)
setPageSize
in interface com.compoze.common.IPagination
iPageSize
- the number of forums on a single page or 0 for all forumspublic int getPageCount()
getPageCount
in interface com.compoze.common.IPagination
public int getCurrentPageNumber()
getCurrentPageNumber
in interface com.compoze.common.IPagination
public int getNextPageNumber()
getNextPageNumber
in interface com.compoze.common.IPagination
public int getPreviousPageNumber()
getPreviousPageNumber
in interface com.compoze.common.IPagination
public boolean isFirstPage()
isFirstPage
in interface com.compoze.common.IPagination
true
if this is the first page; false
otherwisepublic boolean isLastPage()
isLastPage
in interface com.compoze.common.IPagination
true
if this is the last page; false
otherwisepublic int getShowingFrom()
forums() methods, the from index is returned.
- Specified by:
getShowingFrom
in interface com.compoze.common.IPagination
- Returns:
- the from index or -1 if all forums were returned
- See Also:
forums()
,
forums(int)
,
forums(int, int)
public int getShowingTo()
forums() methods, the to index is returned.
- Specified by:
getShowingTo
in interface com.compoze.common.IPagination
- Returns:
- the from index or -1 if all forums were returned
- See Also:
forums()
,
forums(int)
,
forums(int, int)
public java.util.List forums(int iPageNumber)
getPageSize()
.iPageNumber
- the page number (must be greater than zero and less than the total page count)Forum
objectsgetPageCount()
public java.util.List forums()
READ
access to.Forum
objectspublic java.util.List forums(int iFromIndex, int iToIndex)
iFromIndex
and iToIndex
.iFromIndex
- the from index endpoint (inclusive) of the forum listiToIndex
- the to index highpoint (exclusive) of the forum listForum
objectspublic int getCount()
public Forum getForum(long id) throws java.security.AccessControlException
id
- the forum idnull
if not foundpublic void sort(SortOrder order, ForumProperty property)
sortOrder
- the sort orderproperty
- the property to sort bypublic void clearSort()
public SortOrder getSort()
null
if not sorting is imposedpublic ForumProperty getSortProperty()
null
if no property setpublic java.lang.String toString()
toString
in class java.lang.Object
|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |