|
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.Messages
This class represents a collection of messages. The messages collection may be used to iterate through all of the messages.
The messages collection may also be used for searching. The following code segment shows how to reduce the messages that are returned in the collection to ones with a particular name:
DiscussionSession s = DiscussionSession.getSession(user); Messages msgs = s.getMessages(); MessageFilter filter = new MessageFilter(); filter.setSubject("java"); msgs.setFilter(filter); msgs.sort(SortOrder.ASCENDING, MessageProperty.SUBJECT); Iterator it = msgs.messages().iterator(); while(it.hasNext()) { Message m = (Message) it.next(); ... }
Method Summary | |
Message |
add(java.lang.String sSubject)
Adds a message to the messages collection. |
Message |
add(java.lang.String sSubject,
java.lang.String sBody,
java.lang.String sKeywords)
Adds a message to the messages collection. |
Message |
add(java.lang.String sSubject,
java.lang.String sBody,
java.lang.String sContentType,
java.lang.String sKeywords)
Adds a message to the messages collection. |
void |
clearFilter()
Clears the message filter for this collection of messages. |
void |
clearSort()
Clears the message sorting for this collection of messages. |
int |
getCount()
Gets the number of messages in the collection. |
int |
getCurrentPageNumber()
Gets the number of the current page. |
MessageFilter |
getFilter()
Gets the message 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 messages 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. |
boolean |
isFirstPage()
Checks if current page is the first page. |
boolean |
isLastPage()
Checks if current page is the last page. |
java.util.List |
messages()
Gets the list of all messages the authenticated user has READ access to. |
java.util.List |
messages(int iPageNumber)
Gets the sublist of messages on the specified page number. |
java.util.List |
messages(int iFromIndex,
int iToIndex)
Gets a list of messages between the specified iFromIndex and iToIndex . |
void |
setFilter(MessageFilter filter)
Sets the message filter. |
void |
setPageSize(int iPageSize)
Sets the number of messages to appear on a single page. |
void |
sort(SortOrder order,
MessageProperty property)
Sorts the messages 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 Message add(java.lang.String sSubject) throws TopicExpirationException
sSubject
- the subject of the messagenull if the create fails- See Also:
the forum has expired and is not accepting new topics
public Message add(java.lang.String sSubject, java.lang.String sBody, java.lang.String sKeywords) throws TopicExpirationException
sSubject
- the subject of the messagesBody
- the body of the message (defaults to text/plain
content type)sKeywords
- the keywords of the messagenull
if the create failsthe forum has expired and is not accepting new topics
public Message add(java.lang.String sSubject, java.lang.String sBody, java.lang.String sContentType, java.lang.String sKeywords) throws TopicExpirationException
sSubject
- the subject of the messagesBody
- the body of the messagesContentType
- the content typesKeywords
- the keywords of the messagenull
if the create failsthe forum has expired and is not accepting new topics
public void setFilter(MessageFilter filter)
clearFilter()
.null
)public MessageFilter getFilter()
null
if no filter is setmessages()
public void clearFilter()
public int getPageSize()
public void setPageSize(int iPageSize)
iPageSize
- the number of messages on a single page or 0 for all messagespublic int getPageCount()
public int getCurrentPageNumber()
public int getNextPageNumber()
public int getPreviousPageNumber()
public boolean isFirstPage()
true
if this is the first page; false
otherwisepublic boolean isLastPage()
true
if this is the last page; false
otherwisepublic int getShowingFrom()
messages() methods, the from index is returned.
- Returns:
- the from index or -1 if all messages were returned
- See Also:
messages()
,
messages(int)
,
messages(int, int)
public int getShowingTo()
messages() methods, the to index is returned.
- Returns:
- the from index or -1 if all messages were returned
- See Also:
messages()
,
messages(int)
,
messages(int, int)
public java.util.List messages(int iPageNumber)
getPageSize()
.iPageNumber
- the page number (must be greater than zero and less than the total page count)Message
objectgetPageCount()
public java.util.List messages()
READ
access to.Message
objectpublic java.util.List messages(int iFromIndex, int iToIndex)
iFromIndex
and iToIndex
.iFromIndex
- the from index endpoint (inclusive) of the message collectioniToIndex
- the to index highpoint (exclusive) of the message collectionMessage
objectpublic int getCount()
public void sort(SortOrder order, MessageProperty property)
sortOrder
- the sort orderproperty
- the property to sort bypublic void clearSort()
public SortOrder getSort()
null
if not sorting is imposedpublic 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 |