Top Description Fields Constructors Methods
org.apache.tools.ant.types.resources

pack-priv Class FailFast

extends Object
implements Iterator<Resource>
Class Inheritance
All Implemented Interfaces
java.util.Iterator
Imports
java.util.ConcurrentModificationException, .HashSet, .Iterator, .NoSuchElementException, .Set, .WeakHashMap, org.apache.tools.ant.types.Resource

Helper class for ResourceCollections to return Iterators that fail on changes to the object.
Since
Ant 1.7

Field Summary

Modifier and TypeField and Description
private static final WeakHashMap<Object, Set<FailFast>>
private final Object
private Iterator<Resource>

Constructor Summary

AccessConstructor and Description
pack-priv
FailFast(Object
the parent Object.
o
,
Iterator<Resource>
the wrapped Iterator.
i
)

Construct a new FailFast Iterator wrapping the specified Iterator and dependent upon the specified parent Object.

Method Summary

Modifier and TypeMethod and Description
private static synchronized void
private static synchronized void
public boolean

Returns:

true if there are more elements.
hasNext
()

Implements java.util.Iterator.hasNext.

Fulfill the Iterator contract.
pack-priv static synchronized void
invalidate(Object
the parent Object.
o
)

Invalidate any in-use Iterators from the specified Object.

public Resource

Returns:

the next element.
next
()

Implements java.util.Iterator.next.

Fulfill the Iterator contract.
private static synchronized void
public void
remove()

Overrides default java.util.Iterator.remove.

Fulfill the Iterator contract.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MAPback to summary
private static final WeakHashMap<Object, Set<FailFast>> MAP
parentback to summary
private final Object parent
wrappedback to summary
private Iterator<Resource> wrapped

Constructor Detail

FailFastback to summary
pack-priv FailFast(Object o, Iterator<Resource> i)

Construct a new FailFast Iterator wrapping the specified Iterator and dependent upon the specified parent Object.

Parameters
o:Object

the parent Object.

i:Iterator<Resource>

the wrapped Iterator.

Method Detail

addback to summary
private static synchronized void add(FailFast f)
failFastback to summary
private static synchronized void failFast(FailFast f)
hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Fulfill the Iterator contract.

Returns:boolean

true if there are more elements.

Annotations
@Override
invalidateback to summary
pack-priv static synchronized void invalidate(Object o)

Invalidate any in-use Iterators from the specified Object.

Parameters
o:Object

the parent Object.

nextback to summary
public Resource next()

Implements java.util.Iterator.next.

Fulfill the Iterator contract.

Returns:Resource

the next element.

Annotations
@Override
Exceptions
NoSuchElementException:
if no more elements.
removeback to summary
private static synchronized void remove(FailFast f)
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Fulfill the Iterator contract.

Annotations
@Override
Exceptions
UnsupportedOperationException:
always.