Top Inners Constructors Methods
org.aspectj.weaver

public final Class Iterators

extends Object
Class Inheritance
Imports
java.util.HashSet, .Iterator, .List, .NoSuchElementException, .Set

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
Iterators.Filter<T>

A filter represents a mapping function from Iterator to Iterator

public static interface
Iterators.Getter<A, B>

A getter represents a mapping function from Object to Iterator

public static class

Constructor Summary

AccessConstructor and Description
private
Iterators()

Private constructor, nobody should ever make one of these

Method Summary

Modifier and TypeMethod and Description
public static <T> Iterator<T>
append(final Iterator<T> a, final Iterator<T> b)

creates an iterator I based on base iterators A and B.

public static <T> Iterator<T>
append1(final Iterator<T> a, final Iterator<T> b)

creates an iterator I based on base iterators A and B.

public static <T> Iterator<T>
array(final T[] o)

Creates an iterator that will return the elements of a specified array, in order.

public static Iterator<ResolvedType>
array(final ResolvedType[] o, final boolean genericsAware)

public static <T> Iterators.Filter<T>
dupFilter()

Create a new filter F that, when wrapped around another iterator I, creates a new iterator I' that will return only those values of I that have not yet been returned by I', discarding duplicates.

public static <A, B> Iterator<B>
mapOver(final Iterator<A> a, final Iterators.Getter<A, B> g)

creates an iterator I based on a base iterator A and a getter G.

public static <T> Iterator<T>
one(final T it)

creates an iterator I based on an object O.

public static <A> Iterator<A>
recur(final A a, final Iterators.Getter<A, A> g)

creates an iterator I based on a base iterator A and a getter G.

public static <T> Iterator<T>
snoc(final Iterator<T> first, final T last)

creates an iterator I based on a base iterator A and an object O.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Iteratorsback to summary
private Iterators()

Private constructor, nobody should ever make one of these

Method Detail

appendback to summary
public static <T> Iterator<T> append(final Iterator<T> a, final Iterator<T> b)

creates an iterator I based on base iterators A and B. Returns the elements returned by A followed by those returned by B. If B is empty, simply returns A, and if A is empty, simply returns B. Do NOT USE if b.hasNext() is not idempotent.

append1back to summary
public static <T> Iterator<T> append1(final Iterator<T> a, final Iterator<T> b)

creates an iterator I based on base iterators A and B. Returns the elements returned by A followed by those returned by B. If A is empty, simply returns B. Guaranteed not to call B.hasNext() until A is empty.

arrayback to summary
public static <T> Iterator<T> array(final T[] o)

Creates an iterator that will return the elements of a specified array, in order. Like Arrays.asList(o).iterator(), without all that pesky safety.

arrayback to summary
public static Iterator<ResolvedType> array(final ResolvedType[] o, final boolean genericsAware)
dupFilterback to summary
public static <T> Iterators.Filter<T> dupFilter()

Create a new filter F that, when wrapped around another iterator I, creates a new iterator I' that will return only those values of I that have not yet been returned by I', discarding duplicates.

mapOverback to summary
public static <A, B> Iterator<B> mapOver(final Iterator<A> a, final Iterators.Getter<A, B> g)

creates an iterator I based on a base iterator A and a getter G. I returns, in order, forall (i in A), G(i).

oneback to summary
public static <T> Iterator<T> one(final T it)

creates an iterator I based on an object O. Returns O, once.

recurback to summary
public static <A> Iterator<A> recur(final A a, final Iterators.Getter<A, A> g)

creates an iterator I based on a base iterator A and a getter G. I returns, in order, forall (i in I) i :: forall (i' in g(i)) recur(i', g)

snocback to summary
public static <T> Iterator<T> snoc(final Iterator<T> first, final T last)

creates an iterator I based on a base iterator A and an object O. Returns the elements returned by A, followed by O.

org.aspectj.weaver back to summary

public Interface Iterators.Filter<T>


A filter represents a mapping function from Iterator to Iterator

Method Summary

Modifier and TypeMethod and Description
public Iterator<T>

Method Detail

filterback to summary
public Iterator<T> filter(Iterator<T> in)
org.aspectj.weaver back to summary

public Interface Iterators.Getter<A, B>

Known Direct Implementers
org.aspectj.weaver.ResolvedType.MethodGetter, org.aspectj.weaver.ResolvedType.PointcutGetter, org.aspectj.weaver.ResolvedType.MethodGetterIncludingItds, org.aspectj.weaver.ResolvedType.FieldGetter

A getter represents a mapping function from Object to Iterator

Method Summary

Modifier and TypeMethod and Description
public Iterator<B>
get(A target)

Method Detail

getback to summary
public Iterator<B> get(A target)
org.aspectj.weaver back to summary

public Class Iterators.ResolvedTypeArrayIterator

extends Object
implements Iterator<ResolvedType>
Class Inheritance
All Implemented Interfaces
java.util.Iterator

Field Summary

Modifier and TypeField and Description
private List<String>
private ResolvedType[]
private int
private int
private boolean

Constructor Summary

AccessConstructor and Description
public
ResolvedTypeArrayIterator(ResolvedType[] array, List<String> alreadySeen, boolean wantGenerics)

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.
private void
public ResolvedType
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.
public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

alreadySeenback to summary
private List<String> alreadySeen
arrayback to summary
private ResolvedType[] array
indexback to summary
private int index
lenback to summary
private int len
wantGenericsback to summary
private boolean wantGenerics

Constructor Detail

ResolvedTypeArrayIteratorback to summary
public ResolvedTypeArrayIterator(ResolvedType[] array, List<String> alreadySeen, boolean wantGenerics)

Method Detail

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.)

Returns:boolean

true if the iteration has more elements

moveToNextNewOneback to summary
private void moveToNextNewOne()
nextback to summary
public ResolvedType next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:ResolvedType

the next element in the iteration

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.