S
- The States class for the states in this set.public class StatesSet<S extends State> extends java.lang.Object implements States<S>
reachable
.DTMDP.reachable(State, Action)
,
CTMDP.reachable(State, Action)
Constructor and Description |
---|
StatesSet()
Creates an empty set of States;
|
StatesSet(java.lang.Iterable<S> states)
Creates a set of objects S from the given States
|
StatesSet(S s)
Creates set of States with only this State;
|
StatesSet(S[] states)
Creates a set of objects S from a given set of States
|
StatesSet(States<S> states)
Creates a set of objects S from the given States
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.lang.Iterable<S> states)
Adds the States in the iterator to the set.
|
boolean |
add(S s)
Adds the State s to the set.
|
boolean |
add(States<S> states)
Adds the States in the iterator to the set.
|
boolean |
contains(S s)
Returns true if the set contains this State.
|
S |
get(S state)
Returns the element that is equal (according to equals() ) to
the given element.
|
boolean |
isClosed()
The set is closed if all elements have been added.
|
java.util.Iterator<S> |
iterator()
This method returns a safe way to walk through the states in a
particular set.
|
int |
numerateStates()
This method numerates all states and returns the number of
states found.
|
boolean |
remove(S s)
Removes an object from the set.
|
int |
size()
Returns the number of elements.
|
S[] |
toStateArray()
Returns an array with the States in the set.
|
java.lang.String |
toString() |
public StatesSet()
public StatesSet(S s)
s
- The state to include in the set.public StatesSet(java.lang.Iterable<S> states)
states
- a set of States of type States.public StatesSet(S[] states)
states
- a set of States of type States.public final java.util.Iterator<S> iterator()
public boolean add(S s)
s
- The State to be added.public boolean add(java.lang.Iterable<S> states)
states
- a set of States of type States.public boolean add(States<S> states)
states
- a set of States of type States.public S get(S state)
state
- The given statepublic boolean remove(S s)
s
- The element to remove.public boolean contains(S s)
s
- A Statepublic int numerateStates()
numerateStates
in interface States<S extends State>
public S[] toStateArray()
public int size()
States
public java.lang.String toString()
toString
in class java.lang.Object