E - the type being iteratedpublic class DataIterator<E>
extends java.lang.Object
implements java.util.Iterator<E>
Warning : elements will not be sorted accross sources, JStore objects are iterated first, then JcmsDB object are iterated !
This iterator does not support remove operation.
Example to iterate all Publication object :
    DataIterator<Publication> iterator = new DataIterator<Publication>();
    
    // JStore
    TreeSet<Publication> jStorePubSet = new TreeSet<Publication>(channel.getDataSet(Publication.class));
    iterator.addCollection(jStorePubSet);
     
    // JcmsDB
    for(Class<? extends Publication> clazz : channel.getDBPublicationClassList()) {
      ScrollableResults sr = HibernateUtil.getSession().createCriteria(clazz).scroll();
      int dbcount = HibernateUtil.queryCountExact(clazz, null);
      iterator.addScrollableResults(sr, dbcount);
    }
 | Constructor and Description | 
|---|
DataIterator()
Creates a new empty DataIterator. 
 | 
DataIterator(java.util.Collection<? extends E> coll)
Creates a new DataIterator to iterate the
 specified Collection of objects. 
 | 
DataIterator(java.util.Collection<? extends E> coll,
            org.hibernate.ScrollableResults sr,
            int dbcount)
Creates a new DataIterator to iterate both the specified Collection the JcmsDB results. 
 | 
DataIterator(org.hibernate.ScrollableResults sr,
            int dbcount)
Creates a new DataIterator to iterate the specified JcmsDB results. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addCollection(java.util.Collection<? extends E> coll)
Add the specified Collection to the element to iterate. 
 | 
void | 
addDBClass(java.lang.Class<?> clazz)
Add the specified DB Class to the element to iterate. 
 | 
void | 
addScrollableResults(org.hibernate.ScrollableResults sr,
                    int dbcount)
Add the specified ScrollableResults to the element to iterate. 
 | 
boolean | 
hasNext()
Returns true if the iteration has more elements. 
 | 
E | 
next()
Returns the next element in the iteration. 
 | 
void | 
remove()
Unsupported Operation 
 | 
int | 
size()
Return the total number of object available in the iteration. 
 | 
public DataIterator()
public DataIterator(java.util.Collection<? extends E> coll)
coll - a collection to iteratepublic DataIterator(org.hibernate.ScrollableResults sr,
                    int dbcount)
sr - the JcmsDB ScrollableResults.dbcount - the number or result returned in the ScrollableResults.public DataIterator(java.util.Collection<? extends E> coll, org.hibernate.ScrollableResults sr, int dbcount)
coll - the collection to iterate (can be null, in which case iterate on collection is skipped).sr - the JcmsDB ScrollableResults.dbcount - the number or result returned in the ScrollableResults.public void addCollection(java.util.Collection<? extends E> coll)
coll - the Collection to iterate (can be null, in which case iterate on collection is skipped).java.lang.IllegalStateException - if the iteration has already begunpublic void addScrollableResults(org.hibernate.ScrollableResults sr,
                                 int dbcount)
sr - the JcmsDB ScrollableResults.dbcount - the number or result returned in the ScrollableResults.java.lang.IllegalStateException - if the iteration has already begunpublic void addDBClass(java.lang.Class<?> clazz)
clazz - a class of data inside the databasejava.lang.IllegalStateException - if the iteration has already begunpublic boolean hasNext()
hasNext in interface java.util.Iterator<E>public E next()
hasNext() method returns false will
 return each element in the underlying collection exactly once.next in interface java.util.Iterator<E>java.util.NoSuchElementException - iteration has no more elements.public int size()
Warning : When used with JcmsDB results, the correctness of this number depends on the parameters specified at construction time !
public void remove()
remove in interface java.util.Iterator<E>java.lang.UnsupportedOperationExceptionCopyright © 2001-2018 Jalios SA. All Rights Reserved.