public class Variables
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Variables.Phase
Definition of all possible internal states of the handler execution.
|
Constructor and Description |
---|
Variables()
Creates and initializes a new instance of the variables container.
|
Modifier and Type | Method and Description |
---|---|
void |
addCachedTask(Intent nestedIntent,
Task nestedTask)
Adds a new task into the local cache of tasks for reached intents.
|
void |
addDelayedEdge(Edge delayedEdge)
Adds a new edge to the container of delayed edges.
|
void |
addDelayedEdges(java.util.Collection<Edge> delayedEdges)
Adds all provided edges to the container of delayed edges.
|
void |
addReachedVertex(Vertex reachedVertex)
Inserts the given vertex into the list of reached vertices.
|
void |
clearReachedVertices()
Deletes all items from the list of reached vertices.
|
void |
clearVariablesContainer()
Clears default and iterative components but preserves the core ones.
|
Task |
getCachedTask(Intent nestedIntent)
fetched the required task from the local cache if it exists.
|
Graph |
getCorrectionGraph()
Returns the associated correction multigraph.
|
java.util.List<Edge> |
getDelayedEdges()
Returns the internal container with delayed and not yet closed edges.
|
Variables.Phase |
getExecutionPhase()
Returns the current value of the internal execution phase.
|
java.lang.Integer |
getFixedCost()
Returns the current value of the correction final cost.
|
java.lang.Integer |
getReachedCost()
Returns the current value of the correction final cost.
|
Vertex |
getReachedVertex()
Returns the first (some) reached vertex.
|
java.util.Set<Vertex> |
getReachedVertices()
Returns all the stored reached vertices.
|
boolean |
hasDelayedEdges()
Detects whether there exists at least one delayed edge.
|
boolean |
hasExecutionPhase(Variables.Phase queriedPhase)
Detects whether the execution phase corresponds to the given value.
|
boolean |
hasReachedVertex(Vertex inspectedVertex)
Detects whether the given vertex is stored in the reached vertices.
|
boolean |
hasReachedVertices()
Detects whether at least one reached vertex exists.
|
void |
initIterativeComponents()
Initializes the iterative components of the variables container.
|
void |
removeCachedTask(Intent nestedIntent)
Removes the cached task for the specified correction intent.
|
void |
removeDelayedEdge(Edge delayedEdge)
Removes the selected edge from the container of delayed edges.
|
void |
removeDelayedEdges()
Removes all edges from the container of delayed edges.
|
void |
removeReachedVertex(Vertex reachedVertex)
Removes the given vertex from the list of reached vertices.
|
void |
setCorrectionGraph(Graph correctionGraph)
Registers the provided correction multigraph with the container.
|
void |
setExecutionPhase(Variables.Phase newPhase)
Sets a new value of the internal execution phase.
|
void |
setFixedCost(int fixedCost)
Sets the value of the final correction cost.
|
void |
setReachedCost(int reachedCost)
Sets the value of the reached correction cost.
|
public Variables()
public void initIterativeComponents()
public void clearVariablesContainer()
public Variables.Phase getExecutionPhase()
public boolean hasExecutionPhase(Variables.Phase queriedPhase)
queriedPhase
- Phase value to be tested.true
if the phase corresponds.public void setExecutionPhase(Variables.Phase newPhase)
newPhase
- New handler execution phase.public Graph getCorrectionGraph()
public void setCorrectionGraph(Graph correctionGraph)
correctionGraph
- Reference to the graph to be registered.public void addReachedVertex(Vertex reachedVertex)
reachedVertex
- Vertex to be added into the internal container.public boolean hasReachedVertices()
true
if reached vertices are not empty.public boolean hasReachedVertex(Vertex inspectedVertex)
inspectedVertex
- Vertex to be inspected.true
if the vertex is stored as reached.public Vertex getReachedVertex()
public java.util.Set<Vertex> getReachedVertices()
public void removeReachedVertex(Vertex reachedVertex)
reachedVertex
- Vertex to be removed from the internal container.public void clearReachedVertices()
public java.lang.Integer getReachedCost()
reachedCost
public void setReachedCost(int reachedCost)
reachedCost
- New value of the currently reached cost.public java.lang.Integer getFixedCost()
null
when not yet set.fixedCost
public void setFixedCost(int fixedCost)
fixedCost
- Final value of the multigraph correction.public Task getCachedTask(Intent nestedIntent)
nestedIntent
- Correction intent that defines the request.null
.public void addCachedTask(Intent nestedIntent, Task nestedTask)
nestedIntent
- Reference to the indexing intent.nestedTask
- Reference to the task to be inserted.public void removeCachedTask(Intent nestedIntent)
nestedIntent
- Reference to the indexing intent.public java.util.List<Edge> getDelayedEdges()
public void addDelayedEdge(Edge delayedEdge)
delayedEdge
- Edge to be added between delayed edges.public void addDelayedEdges(java.util.Collection<Edge> delayedEdges)
delayedEdges
- Edges to be added between delayed edges.public void removeDelayedEdges()
public void removeDelayedEdge(Edge delayedEdge)
delayedEdge
- Edge to be removed from delayed edges.public boolean hasDelayedEdges()
true
if there exist delayed edges.