Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.jcorporate.expresso.kernel.util
Class DataContextIterator  view DataContextIterator download DataContextIterator.java

java.lang.Object
  extended bycom.jcorporate.expresso.kernel.util.DataContextIterator
All Implemented Interfaces:
java.util.Iterator

public class DataContextIterator
extends java.lang.Object
implements java.util.Iterator

This class is useful for iterating through all data contexts that are installed at the root level of the Expresso Runtime hierarchy. Use it like a normal iterator except that it is explictly constructed.

Example Usage:
  for (DataContextIterator it = new DataContextIterator(); it.hasNext();) {
     DataContext oneContext = (DataContext)it.next();
     System.out.println("Context Name: " + oneContext.getMetaData().getName());
  }

Since:
Expresso 5.1
Version:
$Revision: 1.6 $ on $Date: 2004/11/17 20:48:17 $

Field Summary
(package private)  java.util.Iterator currentChild
           
(package private)  com.jcorporate.expresso.kernel.DataContext next
           
(package private)  com.jcorporate.expresso.kernel.RootContainerInterface runtime
           
 
Constructor Summary
DataContextIterator()
          Default constructor.
DataContextIterator(com.jcorporate.expresso.kernel.RootContainerInterface iteratingRuntime)
          Constructor that uses the RootContainerInterface given to it.
DataContextIterator(java.lang.String runtimeName)
          Constructor that finds a runtime by name.
 
Method Summary
private  void findNext()
          Find and load the next values
 boolean hasNext()
          Checks if another object exists.
 java.lang.Object next()
          Retrieve the Next Data Context in the sequence.
 com.jcorporate.expresso.kernel.DataContext nextContext()
          Retrieve the Next Data Context in the sequence.
 void remove()
          Not implemented.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

runtime

com.jcorporate.expresso.kernel.RootContainerInterface runtime

currentChild

java.util.Iterator currentChild

next

com.jcorporate.expresso.kernel.DataContext next
Constructor Detail

DataContextIterator

public DataContextIterator()
Default constructor. Searches for and gets the default runtime map.


DataContextIterator

public DataContextIterator(java.lang.String runtimeName)
Constructor that finds a runtime by name.


DataContextIterator

public DataContextIterator(com.jcorporate.expresso.kernel.RootContainerInterface iteratingRuntime)
Constructor that uses the RootContainerInterface given to it.

Method Detail

hasNext

public boolean hasNext()
Checks if another object exists.

Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Retrieve the Next Data Context in the sequence.

Specified by:
next in interface java.util.Iterator

nextContext

public com.jcorporate.expresso.kernel.DataContext nextContext()
Retrieve the Next Data Context in the sequence. The only difference between this and next() is that this function doesn't require a downcast.


remove

public void remove()
Not implemented. Way too dangerous of a capability

Specified by:
remove in interface java.util.Iterator

findNext

private void findNext()
Find and load the next values