|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.db.DBObjectIterator
public class DBObjectIterator
A class for iterating over owned object lists. This iterator implementation takes a parent iterator of DBObjects (could be a SchemaObjectIterator) and iterates over their owned objects finding objects of given type(s). For example:
final SchemaObjectIterator parentIter = new SchemaObjectIterator( pro ); parentIter.setTypes( Table.TYPE ); final DBObjectIterator iter = new DBObjectIterator( parentIter ); iter.setTypes( Column.TYPE ); while( iter.hasNext() ) { // iterate over every column in every table in the provider. }
This iterator is not synchronized, only use on one thread.
Constructor Summary | |
---|---|
DBObjectIterator(DBObject parent) Creates a new DBObjectIterator that will search for children of the given object. |
|
DBObjectIterator(java.util.Iterator<? extends DBObject> parentIter) Creates a new DBObjectIterator over all the objects in the parent Iterator. |
Method Summary | |
---|---|
static java.util.Iterator<? extends DBObject> |
createIterator(DBObjectProvider[] pros, java.lang.String[] schemaObjectTypes, java.lang.String[]... childTypeHeirachy) Creates an Iterator of DBObjects for a specific type heirachy of child objects. |
static java.util.Iterator<? extends DBObject> |
createIterator(DBObject parent, java.lang.String[]... childTypeHeirachy) Creates an iterator of the children of the given parent object using the childTypeHeirachy to restrict the objects returned. |
boolean |
hasNext() |
DBObject |
next() |
void |
remove() Not supported by this iterator. |
void |
setTypes(java.lang.String... types) Restricts the iterator to only the given object types. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DBObjectIterator(DBObject parent)
parent
- the parent object to iterate over the children of.public DBObjectIterator(java.util.Iterator<? extends DBObject> parentIter)
parentIter
- the iterator of objects this iterator will search the children ofMethod Detail |
---|
public void setTypes(java.lang.String... types)
public boolean hasNext()
hasNext
in interface java.util.Iterator<DBObject>
public DBObject next()
next
in interface java.util.Iterator<DBObject>
public void remove()
remove
in interface java.util.Iterator<DBObject>
java.lang.UnsupportedOperationException
public static final java.util.Iterator<? extends DBObject> createIterator(DBObjectProvider[] pros, java.lang.String[] schemaObjectTypes, java.lang.String[]... childTypeHeirachy)
new String[]{ Column.TYPE }
in which case a normal DBObjectIterator could be created using the appropriate SchemaObjectIterator
as a parent. For more complicated heirachies of depth > 1 this method will create the appropriate SchemaObjectIterator and DBObjectIterator classes and return a wrapping Iterator.
For example, the following call will return an iterator over all of the IndexObjects owned by all the Indexes in all the Tables or Materialized Views available in all the given providers:
DBObjectIterator.createIterator( providers, new String[]{ Table.TYPE, MaterializedView.TYPE }, new String[]{ Index.TYPE, IndexObject.TYPE } );
pros
- all the providers to search inschemaObjectTypes
- all the top level (schema objects) in the providers to search (null for all)childTypeHeirachy
- the heirachy of child types to iterate through. The final element in the array is the type of object ultimately returned by the iterator.public static final java.util.Iterator<? extends DBObject> createIterator(DBObject parent, java.lang.String[]... childTypeHeirachy)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |