public class OrContext extends AbstractContext implements java.lang.Iterable<Context>
OrContext
represents a context that consists of several (more than 1) contexts. This may for instance represent
the fact that an activity may be executed by more than one type of executor, or that an executor may run more than one type of
activity.Constructor and Description |
---|
OrContext(Context... contexts)
Constructs an OrContext consisting of a list of Contexts.
|
Modifier and Type | Method and Description |
---|---|
Context |
get(int index)
Returns the Context corresponding to the specified index.
|
java.util.Iterator<Context> |
iterator() |
int |
size()
Returns the number of contexts of which this OrContext exists.
|
java.lang.String |
toString() |
public OrContext(Context... contexts)
contexts
- the list of contexts.java.lang.IllegalArgumentException
- is thrown when the length of the list of contexts is smaller than 2, or any of them is null.public int size()
public Context get(int index)
index
- the indexjava.lang.IllegalArgumentException
- if the specified index is out of range.public java.lang.String toString()
toString
in class java.lang.Object