Class PartialCollection

java.lang.Object
org.nervousync.database.query.PartialCollection
All Implemented Interfaces:
Serializable

public final class PartialCollection extends Object implements Serializable
Partial collection
Version:
$Revision : 1.0 $ $Date: Jan 13, 2010 4:07:14 PM $
Author:
Steven Wee wmkm0113@Hotmail.com
See Also:
  • Constructor Details

    • PartialCollection

      public PartialCollection(List<ResultMap> resultList, long totalCount)
      Creates new instance of PartialCollection with specified collection and total
      Parameters:
      resultList - Result list
      totalCount - Total size of collection, which part is contained in this instance
  • Method Details

    • asList

      public List<ResultMap> asList()
      As list.
      Returns:
      the list
    • asList

      public <T> List<T> asList(Class<T> clazz)
      As list.
      Type Parameters:
      T - the type parameter
      Parameters:
      clazz - the clazz
      Returns:
      the list
    • asList

      public <T> List<T> asList(Class<T> clazz, boolean forUpdate, long transactionalCode) throws DataModifiedException, EntityStatusException
      As list.
      Type Parameters:
      T - the type parameter
      Parameters:
      clazz - the clazz
      forUpdate - the for update
      transactionalCode - the transactional code
      Returns:
      the list
      Throws:
      DataModifiedException - the data modified exception
      EntityStatusException - the entity status exception
    • size

      public int size()
      Gets the size of part of initial collection that is contained here
      Returns:
      number of elements in partial collection
    • isEmpty

      public boolean isEmpty()
      Figures out is partial collection empty
      Returns:
      true if this collection is empty
    • add

      public boolean add(ResultMap resultMap)
      Add boolean.
      Parameters:
      resultMap - the result map
      Returns:
      the boolean
    • iterator

      public Iterator<ResultMap> iterator()
      Iterator.
      Returns:
      the iterator
    • iterator

      public <T> Iterator<T> iterator(Class<T> clazz, boolean forUpdate, long transactionalCode)
      Iterator.
      Type Parameters:
      T - the type parameter
      Parameters:
      clazz - the clazz
      forUpdate - the for update
      transactionalCode - the transactional code
      Returns:
      the iterator
    • getTotalCount

      public long getTotalCount()
      Gets total number of elements in initial collection
      Returns:
      total number of elements
    • parse

      public static PartialCollection parse(String cacheData)
      Parse partial collection.
      Parameters:
      cacheData - the cache data
      Returns:
      the partial collection
    • cacheData

      public String cacheData()
      Cache data string.
      Returns:
      the string