se.kb.oai.pmh
Class ListBase<T>

java.lang.Object
  extended by se.kb.oai.pmh.ResponseBase
      extended by se.kb.oai.pmh.ListBase<T>
Direct Known Subclasses:
IdentifiersList, MetadataFormatsList, RecordsList, SetsList

public abstract class ListBase<T>
extends ResponseBase

Abstract base class that holds common functionality for the responses that return lists. Can be used to get the size of the list and the actual list of objects. For responses that don't return all of their results in one response, the ResumptionToken to get the next set of data can also be retrieved.

Author:
Oskar Grenholm, National Library of Sweden

Field Summary
protected  List<T> list
           
 
Fields inherited from class se.kb.oai.pmh.ResponseBase
OAI_NS_PREFIX, OAI_NS_URI, response, responseDate, resumptionToken, xpath
 
Constructor Summary
ListBase(Document document)
          Constructor.
 
Method Summary
 List<T> asList()
          Get the content of the response as a list with objects of type T.
 ResumptionToken getResumptionToken()
          Get the ResumptionToken, if any, for this response.
 int size()
          Get the size of the list.
 
Methods inherited from class se.kb.oai.pmh.ResponseBase
getResponse, getResponseDate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

protected List<T> list
Constructor Detail

ListBase

public ListBase(Document document)
         throws ErrorResponseException
Constructor.

Parameters:
document - the response
Throws:
ErrorResponseException
Method Detail

size

public int size()
Get the size of the list.

Returns:
the size

asList

public List<T> asList()
Get the content of the response as a list with objects of type T.

Returns:
the list

getResumptionToken

public ResumptionToken getResumptionToken()
Get the ResumptionToken, if any, for this response.

Returns:
the ResumptionToken, or null if none available


Copyright © 2008. All Rights Reserved.