se.kmr.scam.client.http.helper
Class ListResultBean

java.lang.Object
  extended byse.kmr.scam.client.http.helper.ListResultBean

public class ListResultBean
extends Object

Container for navigating a result set. Contains subjects as a list of all URIs matching the query. The subjects can be associated with labels and when the subjects are sorted, the sorting will performed regarding these labels. Depending the defined length this object provides the label for the first and last subject on a given page (getStartLabel(int) and getEndLabel(int).
getNavigateNext() and getNavigatePrevious() provides information for requesting next, or previous, subset of subjects.

Version:
$Revision: 1.21 $
Author:
jorans, jand
Created:
den 28 maj 2002

Field Summary
static String ASCENDING
          Description of the Field
static String DESCENDING
          Description of the Field
static String NAME
          Bean-name
static String UNORDERD
          Description of the Field
 
Constructor Summary
ListResultBean()
          Default constructor.
ListResultBean(Model model)
          Creates a ListResultBean from a set of subjects .
 
Method Summary
 Model getCurrentModel()
          Gets the currentModel attribute of the ListResultBean object
 int getCurrentPage()
          Gets the currentPage attribute of the ListResultBean object
 List getCurrentSubjects()
          Gets the current subset of subjects.
 String getEndLabel(int pageRef)
          Gets the last label of the requested page.
 double getFetchTime()
          Gets the fetchTime attribute of the ListResultBean object
 boolean getHasNext()
          Gets the hasNext attribute of the ListResultBean object
 boolean getHasPrev()
          Gets the hasPrev attribute of the ListResultBean object
 int getLength()
          The length of subset
 Model getModel()
          Gets the model attribute of the ListResultBean object
 String getNavigateNext()
          Gets the navigateNext attribute of the ListResultBean object
 String getNavigatePrevious()
          Gets the navigatePrevious attribute of the ListResultBean object
 String getPage(int pageRef)
          Gets the page attribute of the ListResultBean object
 double getSearchTime()
          Gets the searchTime attribute of the ListResultBean object
 String getSortCriteria()
          Gets the sortCriteria attribute of the ListResultBean object
 String getSortorder()
          Gets the sortorder attribute of the ListResultBean object
 int getStart()
          Start index of subjects
 String getStartLabel(int pageRef)
          Gets the first label of the requested page.
 List getSubjectLabels()
          Gets the subjectLabels attribute, sorting criteria, of the ListResultBean object
 List getSubjects()
          The list of all subject-URIs matching search.
 int getSubjectsLength()
          Number of matching subjects
 void removeSubject(Resource res)
          Remove component from search-result.
 void setCurrentPage(int pageRef)
          Sets the currentPage attribute of the ListResultBean object
 void setFetchTime(double time)
          Sets the fetchTime attribute of the ListResultBean object
 void setLength(int length)
          Sets the length of subset
 void setModel(Model m)
          Sets the model attribute of the ListResultBean object
 void setSearchTime(double time)
          Sets the searchTime attribute of the ListResultBean object
 void setSortCriteria(String criteria)
          Sets the sortCriteria attribute of the ListResultBean object
 void setSortorder(String order)
          Sets the sortOrder attribute of the ListResultBean object
 void setStart(int start)
          Sets the start index
 void setSubjectLabels(List labels)
          Sets the subjectLabels attribute, sorting criteria, of the ListResultBean object
 void setSubjects(List subjects)
          Sets the subjects attribute.
 boolean sort(Sorter sorter)
          Sorts subjects and subjectLabels according to the sorting function.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
Bean-name

See Also:
Constant Field Values

UNORDERD

public static final String UNORDERD
Description of the Field

See Also:
Constant Field Values

ASCENDING

public static final String ASCENDING
Description of the Field

See Also:
Constant Field Values

DESCENDING

public static final String DESCENDING
Description of the Field

See Also:
Constant Field Values
Constructor Detail

ListResultBean

public ListResultBean()
Default constructor.


ListResultBean

public ListResultBean(Model model)
               throws RDFException
Creates a ListResultBean from a set of subjects .

Parameters:
model - Description of the Parameter
Throws:
RDFException - Description of the Exception
RDFException - thrown in case of exception finding the subjects.
Method Detail

getSubjects

public List getSubjects()
The list of all subject-URIs matching search.

Returns:
Vector of Strings (URIs)

getSubjectsLength

public int getSubjectsLength()
Number of matching subjects

Returns:
Length

setSubjects

public void setSubjects(List subjects)
Sets the subjects attribute.

Parameters:
subjects - new subjects attribute value (URIs)

getCurrentSubjects

public List getCurrentSubjects()
Gets the current subset of subjects. The subset is defined by the current page.

Returns:
The current set of subjects

getModel

public Model getModel()
Gets the model attribute of the ListResultBean object

Returns:
The model value

setModel

public void setModel(Model m)
Sets the model attribute of the ListResultBean object

Parameters:
m - The new model value

getCurrentModel

public Model getCurrentModel()
                      throws RDFException
Gets the currentModel attribute of the ListResultBean object

Returns:
The currentModel value
Throws:
RDFException - Description of the Exception

removeSubject

public void removeSubject(Resource res)
                   throws RDFException
Remove component from search-result.

Throws:
RDFException

setSearchTime

public void setSearchTime(double time)
Sets the searchTime attribute of the ListResultBean object

Parameters:
time - The new searchTime value

getSearchTime

public double getSearchTime()
Gets the searchTime attribute of the ListResultBean object

Returns:
The searchTime value

setFetchTime

public void setFetchTime(double time)
Sets the fetchTime attribute of the ListResultBean object

Parameters:
time - The new fetchTime value

getFetchTime

public double getFetchTime()
Gets the fetchTime attribute of the ListResultBean object

Returns:
The fetchTime value

setSubjectLabels

public void setSubjectLabels(List labels)
Sets the subjectLabels attribute, sorting criteria, of the ListResultBean object

Parameters:
labels - The new subjectLabels value

getSubjectLabels

public List getSubjectLabels()
Gets the subjectLabels attribute, sorting criteria, of the ListResultBean object

Returns:
The subjectLabels value

sort

public boolean sort(Sorter sorter)
Sorts subjects and subjectLabels according to the sorting function.

Parameters:
sorter - Sorting function
Returns:
True if the sorting function was abel to sort the labels and subjects.

setSortCriteria

public void setSortCriteria(String criteria)
Sets the sortCriteria attribute of the ListResultBean object

Parameters:
criteria - The new sortCriteria value

getSortCriteria

public String getSortCriteria()
Gets the sortCriteria attribute of the ListResultBean object

Returns:
The sortCriteria value

setSortorder

public void setSortorder(String order)
Sets the sortOrder attribute of the ListResultBean object

Parameters:
order - The new sortOrder value

getSortorder

public String getSortorder()
Gets the sortorder attribute of the ListResultBean object

Returns:
The sortorder value

getStartLabel

public String getStartLabel(int pageRef)
Gets the first label of the requested page.

Parameters:
pageRef - A referense to the requested page
Returns:
The first value of the requested page, if such exists, otherwise empty value.

getEndLabel

public String getEndLabel(int pageRef)
Gets the last label of the requested page.

Parameters:
pageRef - A referense to the requested page
Returns:
The last value of the requested page, if such exists, otherwise empty value.

getPage

public String getPage(int pageRef)
Gets the page attribute of the ListResultBean object

Parameters:
pageRef - Description of the Parameter
Returns:
The page value

setCurrentPage

public void setCurrentPage(int pageRef)
Sets the currentPage attribute of the ListResultBean object

Parameters:
pageRef - The new currentPage value

getCurrentPage

public int getCurrentPage()
Gets the currentPage attribute of the ListResultBean object

Returns:
The currentPage value

getStart

public int getStart()
Start index of subjects

Returns:
The start value

setStart

public void setStart(int start)
Sets the start index

Parameters:
start - The new start value

getLength

public int getLength()
The length of subset

Returns:
The length value

setLength

public void setLength(int length)
Sets the length of subset

Parameters:
length - The new length value

getNavigatePrevious

public String getNavigatePrevious()
Gets the navigatePrevious attribute of the ListResultBean object

Returns:
The navigatePrevious value

getNavigateNext

public String getNavigateNext()
Gets the navigateNext attribute of the ListResultBean object

Returns:
The navigateNext value

getHasNext

public boolean getHasNext()
Gets the hasNext attribute of the ListResultBean object

Returns:
The hasNext value

getHasPrev

public boolean getHasPrev()
Gets the hasPrev attribute of the ListResultBean object

Returns:
The hasPrev value

toString

public String toString()


Copyright © 2003 SCAM. All Rights Reserved.