com.bea.ales.management
Class MetaObjectQueryResult

java.lang.Object
  |
  +--com.bea.ales.management.MetaObjectQueryResult

public class MetaObjectQueryResult
extends java.lang.Object
implements QueryResult

This class represents the result of executing a query on meta objects. It provides methods to iterate over the result and find an meta object.


Method Summary
 void close()
          Close the query result.
 void enablePaging(boolean enablePaging)
          Enable or disable paging.
 java.lang.Object getNextItem()
          Return the next available object in the result.
 int getNumberofPages()
          Return the number of pages for the result on the count/page-size.
 java.lang.Object getPreviousItem()
          Return the previous available object in the result.
 java.lang.String getQueryString()
          Return the query string associated with the query result.
 boolean hasNext()
          Dectect whether there is next object availible in the result.
 boolean hasPrevious()
          Dectect whether there is previous object availible in the result.
 boolean isPagingEnabled()
          Detect whether paging is enabled.
 void loadAllResults()
          Load all the result for the query.
 MetaObject next()
          Get the next object in the result.
 MetaObject previous()
          Get the previous object in the result.
 void refresh()
          Refresh the query result.
 void setHoldSize(int holdSize)
          Set the hold size of this query result.
 void setPageSize(int size)
          Set the page size for this query result.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

close

public void close()
           throws ManagementException
Close the query result. The query result will no longer be accessible.
Specified by:
close in interface QueryResult

Throws:
ManagementException - if operation fails.

enablePaging

public void enablePaging(boolean enablePaging)
                  throws ManagementException
Enable or disable paging. By default paging is enabled
Specified by:
enablePaging in interface QueryResult

Parameters:
enablePaging - true to enable paging, false to disable it
Throws:
ManagementException - if operation fails.

getNextItem

public java.lang.Object getNextItem()
                             throws ManagementException
Return the next available object in the result.
Specified by:
getNextItem in interface QueryResult

Returns:
the next object in the result
Throws:
ManagementException - if operation fails.

getNumberofPages

public int getNumberofPages()
                     throws ManagementException
Return the number of pages for the result on the count/page-size.
Specified by:
getNumberofPages in interface QueryResult

Returns:
the number of pages in the result set. -1 is returned if no page size is set. If count/page-size is a fraction then the return value is rounded up.
Throws:
ManagementException - if operation fails.

getPreviousItem

public java.lang.Object getPreviousItem()
                                 throws ManagementException
Return the previous available object in the result.
Specified by:
getPreviousItem in interface QueryResult

Returns:
the next object in the result.
Throws:
ManagementException - if operation fails.

getQueryString

public java.lang.String getQueryString()
                                throws ManagementException
Return the query string associated with the query result. An example return value would be "*" or "Admin*"
Specified by:
getQueryString in interface QueryResult

Returns:
the query string associated with the query result.
Throws:
ManagementException - if the operation fails.

hasNext

public boolean hasNext()
                throws ManagementException
Dectect whether there is next object availible in the result.
Specified by:
hasNext in interface QueryResult

Returns:
true if next object is availible, false if no object is availible
Throws:
ManagementException - if operation fails.

hasPrevious

public boolean hasPrevious()
                    throws ManagementException
Dectect whether there is previous object availible in the result.
Specified by:
hasPrevious in interface QueryResult

Returns:
true if previous object is availible, false if no object is availible
Throws:
ManagementException - if operation fails.

isPagingEnabled

public boolean isPagingEnabled()
                        throws ManagementException
Detect whether paging is enabled.
Specified by:
isPagingEnabled in interface QueryResult

Returns:
true if paging is enabled, false if it is disabled.
Throws:
ManagementException - if operation fails.

loadAllResults

public void loadAllResults()
                    throws ManagementException
Load all the result for the query. All result items of the query executed are populated to internal cache.
Specified by:
loadAllResults in interface QueryResult

Throws:
ManagementException - if operation fails.

refresh

public void refresh()
             throws ManagementException
Refresh the query result. The internal cached data will be cleared.
Specified by:
refresh in interface QueryResult

Throws:
ManagementException - if operation fails.

setHoldSize

public void setHoldSize(int holdSize)
Set the hold size of this query result. The hold size is the number of elements for internal cache.
Specified by:
setHoldSize in interface QueryResult

Parameters:
holdSize - the number of element.

setPageSize

public void setPageSize(int size)
Set the page size for this query result. This is the number of elements that constitute one page.
Specified by:
setPageSize in interface QueryResult

Parameters:
size - size of the page.

next

public MetaObject next()
                throws ManagementException
Get the next object in the result.

Returns:
the next object, or null if there is no next one.
Throws:
ManagementException - if the operation fails.

previous

public MetaObject previous()
                    throws ManagementException
Get the previous object in the result.

Returns:
the previous object, or null if there is no previous one.
Throws:
ManagementException - if the operation fails.


Copyright © 2004-2008, Oracle and/or its affiliates. All rights reserved.