Package hydra.paths
Class SubtypeGraph
- java.lang.Object
-
- hydra.paths.SubtypeGraph
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<SubtypeGraph>
public class SubtypeGraph extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<SubtypeGraph>
A graph of subtype nodes and edges, representing type access patterns- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description java.util.List<SubtypeEdge>edgesAll edges in the graphstatic NameEDGESName of thehydra.paths.SubtypeGraph.edgesfield.java.util.List<SubtypeNode>nodesAll nodes in the graphstatic NameNODESName of thehydra.paths.SubtypeGraph.nodesfield.static NameTYPE_Name of thehydra.paths.SubtypeGraphtype.
-
Constructor Summary
Constructors Constructor Description SubtypeGraph(java.util.List<SubtypeNode> nodes, java.util.List<SubtypeEdge> edges)Constructs an immutableSubtypeGraph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(SubtypeGraph other)booleanequals(java.lang.Object other)inthashCode()SubtypeGraphwithEdges(java.util.List<SubtypeEdge> edges)Returns a copy of thisSubtypeGraphwithedgesreplaced.SubtypeGraphwithNodes(java.util.List<SubtypeNode> nodes)Returns a copy of thisSubtypeGraphwithnodesreplaced.
-
-
-
Field Detail
-
TYPE_
public static final Name TYPE_
Name of thehydra.paths.SubtypeGraphtype.
-
NODES
public static final Name NODES
Name of thehydra.paths.SubtypeGraph.nodesfield.
-
EDGES
public static final Name EDGES
Name of thehydra.paths.SubtypeGraph.edgesfield.
-
nodes
public final java.util.List<SubtypeNode> nodes
All nodes in the graph
-
edges
public final java.util.List<SubtypeEdge> edges
All edges in the graph
-
-
Constructor Detail
-
SubtypeGraph
public SubtypeGraph(java.util.List<SubtypeNode> nodes, java.util.List<SubtypeEdge> edges)
Constructs an immutableSubtypeGraph.- Parameters:
nodes- All nodes in the graphedges- All edges in the graph
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(SubtypeGraph other)
- Specified by:
compareToin interfacejava.lang.Comparable<SubtypeGraph>
-
withNodes
public SubtypeGraph withNodes(java.util.List<SubtypeNode> nodes)
Returns a copy of thisSubtypeGraphwithnodesreplaced.
-
withEdges
public SubtypeGraph withEdges(java.util.List<SubtypeEdge> edges)
Returns a copy of thisSubtypeGraphwithedgesreplaced.
-
-