APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.tools.example.debug.tty

pack-priv Class ThreadGroupIterator

extends Object
implements Iterator<ThreadGroupReference>
Class Inheritance
All Implemented Interfaces
java.util.Iterator
Imports
com.sun.jdi.ThreadGroupReference, java.util.List, .Stack, .ArrayList, .Iterator

Descend the tree of thread groups.
Author
Robert G. Field

Field Summary

Modifier and TypeField and Description
private final Stack<Iterator<ThreadGroupReference>>

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static ThreadGroupReference
find(String name)

public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public ThreadGroupReference
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

public ThreadGroupReference
private void
push(List<ThreadGroupReference> tgl)

The invariant in this class is that the top iterator on the stack has more elements.

public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).

private Iterator<ThreadGroupReference>
top()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

stackback to summary
private final Stack<Iterator<ThreadGroupReference>> stack

Constructor Detail

ThreadGroupIteratorback to summary
pack-priv ThreadGroupIterator(List<ThreadGroupReference> tgl)
ThreadGroupIteratorback to summary
pack-priv ThreadGroupIterator(ThreadGroupReference tg)
ThreadGroupIteratorback to summary
pack-priv ThreadGroupIterator()

Method Detail

findback to summary
pack-priv static ThreadGroupReference find(String name)
hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Annotations
@Override
nextback to summary
public ThreadGroupReference next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Annotations
@Override
nextThreadGroupback to summary
public ThreadGroupReference nextThreadGroup()
pushback to summary
private void push(List<ThreadGroupReference> tgl)

The invariant in this class is that the top iterator on the stack has more elements. If the stack is empty, there is no top. This method assures this invariant.

removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.

Annotations
@Override
topback to summary
private Iterator<ThreadGroupReference> top()