public class LabeledIntGraph extends edu.uci.ics.jung.graph.AbstractTypedGraph<LabeledNode,LabeledIntEdge> implements edu.uci.ics.jung.graph.DirectedGraph<LabeledNode,LabeledIntEdge>, Observer
LabeledNode
and edges are LabeledIntEdge
implementing the interface
DirectedGraph
in order to allow the representation of graph by Jung library.Constructor and Description |
---|
LabeledIntGraph(Class<C> internalMapImplementationClass) |
LabeledIntGraph(Class<C> internalMapImplementationClass,
ALabelAlphabet alphabet) |
LabeledIntGraph(LabeledIntGraph g,
Class<C> internalMapImplementationClass)
A constructor that copy a given graph g using copy constructor even for internal structures.
|
LabeledIntGraph(String name,
Class<C> internalMapImplementationClass)
Constructor for LabeledIntGraph.
|
LabeledIntGraph(String name,
Class<C> internalMapImplementationClass,
ALabelAlphabet alphabet)
Constructor for LabeledIntGraph.
|
Modifier and Type | Method and Description |
---|---|
void |
addChildToObserverNode(LabeledNode obs,
char child)
Add child to obs.
|
boolean |
addEdge(AbstractLabeledIntEdge e,
String v1Name,
String v2Name)
Optimized method for adding edge.
|
boolean |
addEdge(LabeledIntEdge e,
LabeledNode v1,
LabeledNode v2) |
boolean |
addEdge(LabeledIntEdge e,
LabeledNode v1,
LabeledNode v2,
edu.uci.ics.jung.graph.util.EdgeType edge_type1) |
boolean |
addEdge(LabeledIntEdge edge,
edu.uci.ics.jung.graph.util.Pair<? extends LabeledNode> endpoints,
edu.uci.ics.jung.graph.util.EdgeType edgeType) |
boolean |
addVertex(LabeledNode vertex) |
void |
clear()
clear all internal structures.
|
void |
clear(int initialAdjSize)
Clear all internal structures.
|
void |
clearCache()
Clear all internal caches.
|
boolean |
containsEdge(LabeledIntEdge edge) |
boolean |
containsVertex(LabeledNode vertex) |
void |
copy(LabeledIntGraph g)
Defensive copy of all internal structures of g into this.
This method is useful to copy a graph into the current without modifying the reference to the current. |
void |
copyCleaningRedundantLabels(LabeledIntGraph g)
Makes a copy as
copy(LabeledIntGraph) removing all possible redundant labeled values in the given graph. |
boolean |
equals(Object o)
Equals based on equals of edges and vertices.
|
LabeledIntEdge |
findEdge(LabeledNode s,
LabeledNode d) |
LabeledIntEdge |
findEdge(String s,
String d)
Find the edge given the name of source node and destination one.
|
ALabelAlphabet |
getALabelAlphabet() |
Label |
getChildrenOf(LabeledNode obs)
Given a observation node
obs that observes the proposition 'p', its 'children' are all observation nodes, Q, for which 'p' appears in the
label of node Q. |
int |
getContingentCount() |
LabeledNode |
getDest(LabeledIntEdge directedEdge) |
LabeledIntEdge |
getEdge(String s)
Returns the edge associated to the name.
|
int |
getEdgeCount() |
LabeledIntEdgeSupplier<? extends LabeledIntMap> |
getEdgeFactory() |
Collection<LabeledIntEdge> |
getEdges() |
LabeledIntEdge[] |
getEdgesArray()
getEdgesArray.
|
edu.uci.ics.jung.graph.util.Pair<LabeledNode> |
getEndpoints(LabeledIntEdge edge)
getEdgesArray.
|
File |
getFileName() |
Collection<LabeledIntEdge> |
getIncidentEdges(LabeledNode vertex) |
Collection<LabeledIntEdge> |
getInEdges(LabeledNode vertex) |
Class<? extends LabeledIntMap> |
getInternalLabeledValueMapImplementationClass() |
it.unimi.dsi.fastutil.objects.ObjectList<LabeledIntEdge> |
getLowerLabeledEdges()
getLowerLabeledEdges.
|
String |
getName()
Getter for the field
name . |
Collection<LabeledNode> |
getNeighbors(LabeledNode vertex) |
LabeledNode |
getNode(String s)
Returns the node associated to the name.
|
Collection<LabeledNode> |
getNodes()
getNodes.
|
it.unimi.dsi.fastutil.chars.Char2ObjectMap<LabeledNode> |
getObservedAndObserver() |
LabeledNode |
getObserver(char c) |
it.unimi.dsi.fastutil.objects.ObjectList<LabeledIntEdge> |
getObserver2ZEdges()
Be careful! The returned value is not a copy as the edges contained!
|
int |
getObserverCount() |
Collection<LabeledNode> |
getObservers() |
Collection<LabeledIntEdge> |
getOutEdges(LabeledNode vertex) |
Collection<LabeledNode> |
getPredecessors(LabeledNode vertex) |
it.unimi.dsi.fastutil.chars.CharSet |
getPropositions()
getPropositions.
|
LabeledNode |
getSource(LabeledIntEdge edge) |
Collection<LabeledNode> |
getSuccessors(LabeledNode vertex) |
Set<LabeledIntEdge> |
getUpperLabeledEdges() |
int |
getVertexCount() |
Collection<LabeledNode> |
getVertices() |
LabeledNode[] |
getVerticesArray()
getVerticesArray.
|
LabeledNode |
getZ() |
int |
hashCode()
Since equals has been specialized, hashCode too.
|
boolean |
hasSameEdgesOf(LabeledIntGraph g1)
hasSameEdgesOf.
|
boolean |
isDest(LabeledNode vertex,
LabeledIntEdge edge) |
boolean |
isSource(LabeledNode vertex,
LabeledIntEdge edge) |
boolean |
removeEdge(LabeledIntEdge edge) |
boolean |
removeVertex(LabeledNode removingNode) |
boolean |
reverse()
Reverse (transpose) the current graph.
|
void |
setFileName(File fileName) |
void |
setName(String name)
Setter for the field
name . |
void |
setZ(LabeledNode z) |
void |
takeIn(LabeledIntGraph g)
Takes in all internal structures of g.
This method is useful to copy the references of internal data structure of the given graph 'g' into the current. |
String |
toString() |
void |
update(Observable o,
Object arg) |
getDefaultEdgeType, getEdgeCount, getEdges, getEdgeType
addEdge, addEdge, addEdge, degree, findEdgeSet, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree
public LabeledIntGraph(Class<C> internalMapImplementationClass)
internalMapImplementationClass
- it is necessary for creating the right factory (reflection doesn't work due to reification!).public LabeledIntGraph(Class<C> internalMapImplementationClass, ALabelAlphabet alphabet)
internalMapImplementationClass
- it is necessary for creating the right factory (reflection doesn't work due to reification!).alphabet
- Alphabet to use for naming Upper Case labelpublic LabeledIntGraph(LabeledIntGraph g, Class<C> internalMapImplementationClass)
g
- the graph to be clonedinternalMapImplementationClass
- it is necessary for creating the right factory (reflection doesn't work due to reification!).public LabeledIntGraph(String name, Class<C> internalMapImplementationClass)
name
- a name for the graphinternalMapImplementationClass
- it is necessary for creating the right factory (reflection doesn't work due to reification!) A general and safe
value is LabeledIntTreeMap. See LabeledIntMap and its implementing classes.public LabeledIntGraph(String name, Class<C> internalMapImplementationClass, ALabelAlphabet alphabet)
name
- a name for the graphinternalMapImplementationClass
- it is necessary for creating the right factory (reflection doesn't work due to reification!) A general and safe
value is LabeledIntTreeMap. See LabeledIntMap and its implementing classes.alphabet
- alfabet for upper case letter used to label values in the edges.public void addChildToObserverNode(LabeledNode obs, char child)
obs
- child
- public boolean addEdge(AbstractLabeledIntEdge e, String v1Name, String v2Name)
e
- v1Name
- v2Name
- public boolean addEdge(LabeledIntEdge e, LabeledNode v1, LabeledNode v2)
addEdge
in interface edu.uci.ics.jung.graph.Graph<LabeledNode,LabeledIntEdge>
addEdge
in class edu.uci.ics.jung.graph.AbstractGraph<LabeledNode,LabeledIntEdge>
public boolean addEdge(LabeledIntEdge e, LabeledNode v1, LabeledNode v2, edu.uci.ics.jung.graph.util.EdgeType edge_type1)
addEdge
in interface edu.uci.ics.jung.graph.Graph<LabeledNode,LabeledIntEdge>
addEdge
in class edu.uci.ics.jung.graph.AbstractGraph<LabeledNode,LabeledIntEdge>
public boolean addEdge(LabeledIntEdge edge, edu.uci.ics.jung.graph.util.Pair<? extends LabeledNode> endpoints, edu.uci.ics.jung.graph.util.EdgeType edgeType)
addEdge
in class edu.uci.ics.jung.graph.AbstractGraph<LabeledNode,LabeledIntEdge>
public boolean addVertex(LabeledNode vertex)
addVertex
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public void clear()
public void clear(int initialAdjSize)
initialAdjSize
- initial number of vertices.public void clearCache()
Caches are automatically created during any modification or query about the graph structure.
public boolean containsEdge(LabeledIntEdge edge)
containsEdge
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public boolean containsVertex(LabeledNode vertex)
containsVertex
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public void copy(LabeledIntGraph g)
g
- the graph to copy.public void copyCleaningRedundantLabels(LabeledIntGraph g)
copy(LabeledIntGraph)
removing all possible redundant labeled values in the given graph.g
- a LabeledIntGraph
object.public boolean equals(Object o)
public LabeledIntEdge findEdge(LabeledNode s, LabeledNode d)
findEdge
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
findEdge
in class edu.uci.ics.jung.graph.AbstractGraph<LabeledNode,LabeledIntEdge>
public LabeledIntEdge findEdge(String s, String d)
s
- d
- public ALabelAlphabet getALabelAlphabet()
public Label getChildrenOf(LabeledNode obs)
obs
that observes the proposition 'p', its 'children' are all observation nodes, Q, for which 'p' appears in the
label of node Q.
This method returns the set of children of a given node as a label of straight propositions associated to the children instead of a set of children nodes.
obs
- a LabeledNode
object.obs
, null if there is no children.public int getContingentCount()
public LabeledNode getDest(LabeledIntEdge directedEdge)
getDest
in interface edu.uci.ics.jung.graph.Graph<LabeledNode,LabeledIntEdge>
getDest
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public LabeledIntEdge getEdge(String s)
s
- a String
object.public int getEdgeCount()
getEdgeCount
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public LabeledIntEdgeSupplier<? extends LabeledIntMap> getEdgeFactory()
public Collection<LabeledIntEdge> getEdges()
getEdges
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public LabeledIntEdge[] getEdgesArray()
public edu.uci.ics.jung.graph.util.Pair<LabeledNode> getEndpoints(LabeledIntEdge edge)
getEndpoints
in interface edu.uci.ics.jung.graph.Graph<LabeledNode,LabeledIntEdge>
public File getFileName()
public Collection<LabeledIntEdge> getIncidentEdges(LabeledNode vertex)
getIncidentEdges
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public Collection<LabeledIntEdge> getInEdges(LabeledNode vertex)
getInEdges
in interface edu.uci.ics.jung.graph.Graph<LabeledNode,LabeledIntEdge>
getInEdges
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public Class<? extends LabeledIntMap> getInternalLabeledValueMapImplementationClass()
public it.unimi.dsi.fastutil.objects.ObjectList<LabeledIntEdge> getLowerLabeledEdges()
public String getName()
name
.public Collection<LabeledNode> getNeighbors(LabeledNode vertex)
getNeighbors
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public LabeledNode getNode(String s)
s
- a String
object.public Collection<LabeledNode> getNodes()
public it.unimi.dsi.fastutil.chars.Char2ObjectMap<LabeledNode> getObservedAndObserver()
public LabeledNode getObserver(char c)
c
- the request propositionpublic it.unimi.dsi.fastutil.objects.ObjectList<LabeledIntEdge> getObserver2ZEdges()
public int getObserverCount()
public Collection<LabeledNode> getObservers()
public Collection<LabeledIntEdge> getOutEdges(LabeledNode vertex)
getOutEdges
in interface edu.uci.ics.jung.graph.Graph<LabeledNode,LabeledIntEdge>
getOutEdges
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public Collection<LabeledNode> getPredecessors(LabeledNode vertex)
getPredecessors
in interface edu.uci.ics.jung.graph.Graph<LabeledNode,LabeledIntEdge>
getPredecessors
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public it.unimi.dsi.fastutil.chars.CharSet getPropositions()
public LabeledNode getSource(LabeledIntEdge edge)
getSource
in interface edu.uci.ics.jung.graph.Graph<LabeledNode,LabeledIntEdge>
getSource
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public Collection<LabeledNode> getSuccessors(LabeledNode vertex)
getSuccessors
in interface edu.uci.ics.jung.graph.Graph<LabeledNode,LabeledIntEdge>
getSuccessors
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public Set<LabeledIntEdge> getUpperLabeledEdges()
public int getVertexCount()
getVertexCount
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public Collection<LabeledNode> getVertices()
getVertices
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public LabeledNode[] getVerticesArray()
public LabeledNode getZ()
public int hashCode()
public boolean hasSameEdgesOf(LabeledIntGraph g1)
g1
- a LabeledIntGraph
object.equals(Object)
. False otherwise.public boolean isDest(LabeledNode vertex, LabeledIntEdge edge)
isDest
in interface edu.uci.ics.jung.graph.Graph<LabeledNode,LabeledIntEdge>
public boolean isSource(LabeledNode vertex, LabeledIntEdge edge)
isSource
in interface edu.uci.ics.jung.graph.Graph<LabeledNode,LabeledIntEdge>
public boolean removeEdge(LabeledIntEdge edge)
removeEdge
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public boolean reverse()
public boolean removeVertex(LabeledNode removingNode)
removeVertex
in interface edu.uci.ics.jung.graph.Hypergraph<LabeledNode,LabeledIntEdge>
public void setFileName(File fileName)
fileName
- public void setName(String name)
name
.name
- the name to setpublic void setZ(LabeledNode z)
z
- the node to be set as Z node of the graph.public void takeIn(LabeledIntGraph g)
g
- the graph to copy.public String toString()
toString
in class edu.uci.ics.jung.graph.AbstractGraph<LabeledNode,LabeledIntEdge>
public void update(Observable o, Object arg)
Copyright © 2019 Computer Science Department - University of Verona - Italy. All rights reserved.