Class DenseTCGraph.UnmodifiableDenseTCGraph<K extends Edge>
java.lang.Object
it.univr.di.cstnu.graph.DenseTCGraph<K>
it.univr.di.cstnu.graph.DenseTCGraph.UnmodifiableDenseTCGraph<K>
- Type Parameters:
K- the type of edges
- All Implemented Interfaces:
TemporalConstraintGraph<K>, PropertyChangeListener, Serializable, EventListener
- Enclosing class:
DenseTCGraph<E extends Edge>
Unmodifiable version of this graph.
- Version:
- $Rev: 1168 $
- Author:
- posenato
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class DenseTCGraph
DenseTCGraph.UnmodifiableDenseTCGraph<K>Modifier and TypeClassDescriptionstatic classDenseTCGraph.UnmodifiableDenseTCGraph<K extends Edge>Unmodifiable version of this graph.Nested classes/interfaces inherited from interface TemporalConstraintGraph
TemporalConstraintGraph.EdgeAndNode<E>Modifier and TypeInterfaceDescriptionstatic final recordTemporalConstraintGraph.EdgeAndNode<E extends Edge>An edge paired with the canonical vertex at the opposite end of a traversal. -
Field Summary
Fields inherited from class DenseTCGraph
growFactor, INITIAL_DIMENSIONModifier and TypeFieldDescription(package private) static final floatAdjacency grow factor: This represents the multiplication factor used to increase the dimension of the adjacency matrix.(package private) static final intInitial graph dimension -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildToObserverNode(LabeledNode obs, char child) Unsupported.booleanaddEdge(K e, LabeledNode v1, LabeledNode v2) Unsupported.voidUnsupported.booleanaddVertex(LabeledNode vertex) Unsupported.final voidclear()Makes this graph empty.voidclear(int initialAdjSize) UnsupportedvoidUnsupported.voidcopy(DenseTCGraph<K> g) Unsupported.newInstance(TemporalConstraintGraph<K> source) Unsupported.final <F extends Edge, I extends F>
DenseTCGraph<F> newInstance(String inputName, Class<I> edgeImplClass, int initialCapacity) Unsupported.final voidbooleanremoveEdge(String edgeName) Unsupported.booleanremoveEdge(K edge) Unsupported.booleanUnsupported.final booleanremoveVertex(LabeledNode removingNode) Unsupported.voidrenameEdge(K edge, String newName) Unsupported.voidrenameNode(LabeledNode node, String newName) Unsupported.voidUnsupported.voidreverse()Unsupported.voidsetInputFile(File file) Unsupported.voidUnsupported.voidsetZ(LabeledNode z) Unsupported.voidtakeFrom(DenseTCGraph<? extends K> g) Unsupported.voidUnsupported.Methods inherited from class DenseTCGraph
addAnnotation, addEdgeWithoutCheck, addVertexWithoutCheck, clearAnnotations, containsEdge, containsVertex, differentEdgesOf, findEdge, getALabelAlphabet, getAnnotations, getCheckOutcome, getChildrenOf, getContingentNodeCount, getDest, getDest, getDispatchabilityOutcome, getEdge, getEdgeCount, getEdgeFactory, getEdgeImplClass, getEdges, getEdgesAndNodes, getEdgesOrdered, getFileName, getIncidentEdges, getInEdges, getInEdgesAndNodes, getInEdgesAndSources, getInputFile, getLowerLabeledEdges, getName, getNode, getNodeFactory, getNodesOrdered, getObservedAndObserver, getObserver, getObserver2ZEdges, getObserverCount, getObservers, getOutEdges, getOutEdgesAndDestinations, getOutEdgesAndNodes, getPropositions, getSource, getSource, getType, getUpperLabeledEdges, getVertexCount, getVertices, getZ, hasSameVerticesOf, inDegree, newEdgeInstance, newInstance, newPredecessorInstance, outDegree, removeAnnotation, setCheckOutcome, setDispatchabilityOutcome, setType, toString, unmodifiableModifier and TypeMethodDescriptionfinal voidaddAnnotation(GraphAnnotation annotation) Adds a presentation-only plain-text annotation to this graph.final voidaddEdgeWithoutCheck(K e, String v1Name, String v2Name) Optimized method for adding an edge without any security check and listener modification for edges.final voidaddVertexWithoutCheck(LabeledNode vertex) Adds the given vertex to the graph without checking its previous presence and without adding any listeners to it.voidRemoves every presentation-only annotation from this graph.booleancontainsEdge(K edge) Tests whether this graph contains an edge whose name matches the name of the supplied edge.booleancontainsVertex(LabeledNode vertex) final it.unimi.dsi.fastutil.objects.ObjectList<it.unimi.dsi.fastutil.objects.ObjectObjectImmutablePair<K, K>> Returns the list of different edges of this graph from g1.final KFind the edge given the names of the source node and the destination node.final ALabelAlphabetfinal List<GraphAnnotation> Returns the annotations in their drawing order.final CheckOutcomefinal LabelgetChildrenOf(LabeledNode obs) Given an observation nodeobsthat observes the proposition 'p', its 'children' are all observation nodes, Q, for which 'p' appears in the label of node Q.final intfinal LabeledNodeReturns the destination endpoint of the edge identified by the supplied edge's name.final LabeledNodeWrapperDenseTCGraph.getDest(Edge)final DispatchabilityOutcomefinal KReturns the edge associated with the name.final intfinal EdgeSupplier<K> Getter for the fieldedgeFactory.Returns the concrete class that this graph uses to instantiate its edges.final Collection<K> getEdges()Returns an independent collection of the edges of this graph.final it.unimi.dsi.fastutil.objects.ObjectList<org.apache.commons.lang3.tuple.Triple<LabeledNode, K, LabeledNode>> final Collection<K> final Filefinal it.unimi.dsi.fastutil.objects.ObjectList<K> getIncidentEdges(LabeledNode vertex) Returns all edges incident tovertex(its outgoing edges plus its incoming edges, without double-counting a self-loop).final it.unimi.dsi.fastutil.objects.ObjectList<K> getInEdges(LabeledNode vertex) final it.unimi.dsi.fastutil.objects.ObjectList<it.unimi.dsi.fastutil.objects.ObjectObjectImmutablePair<K, LabeledNode>> getInEdgesAndNodes(LabeledNode vertex) It is an optimization ofDenseTCGraph.getInEdges(LabeledNode)that also returns the source node of the incoming edge.getInEdgesAndSources(LabeledNode vertex) Returns an unmodifiable snapshot of pairs(edge, canonical source)for all incoming edges ofvertex.it.unimi.dsi.fastutil.objects.ObjectList<BasicCSTNUEdge> final StringgetName()final LabeledNodeReturns the node associated with the name.final Collection<LabeledNode> final it.unimi.dsi.fastutil.chars.Char2ObjectMap<LabeledNode> final LabeledNodegetObserver(char c) final it.unimi.dsi.fastutil.objects.ObjectList<K> Be careful!final intfinal it.unimi.dsi.fastutil.objects.ObjectList<K> getOutEdges(LabeledNode vertex) Returns an unmodifiable snapshot of pairs(edge, canonical destination)for all outgoing edges ofvertex.final it.unimi.dsi.fastutil.objects.ObjectList<it.unimi.dsi.fastutil.objects.ObjectObjectImmutablePair<K, LabeledNode>> getOutEdgesAndNodes(LabeledNode vertex) It is an optimization ofDenseTCGraph.getOutEdges(LabeledNode)that also returns the destination node of the outgoing edge.it.unimi.dsi.fastutil.chars.CharSetgetPropositions.final LabeledNodeReturns the source endpoint of the edge identified by the supplied edge's name.final LabeledNodeWrapper ofDenseTCGraph.getSource(Edge)getType()final intfinal Collection<LabeledNode> final LabeledNodegetZ()booleanfinal intinDegree(LabeledNode vertex) final KnewEdgeInstance(String edgeName, Edge.ConstraintType edgeType) Creates an edge instance without reserving or normalizing its name against this graph.final DenseTCGraph<K> newInstance(String inputName, int initialCapacity) Creates a new, empty temporal-constraint graph with the same concrete backend and the same concrete edge implementation as this graph.Creates an empty predecessor-relation container suitable for algorithms running on this graph.final intoutDegree(LabeledNode vertex) voidremoveAnnotation(GraphAnnotation annotation) Removes a presentation-only annotation from this graph.final voidsetCheckOutcome(CheckOutcome outcome) Sets or clears the persisted check result.final voidSets or clears the persisted dispatchability representation.final voidsetType(TemporalConstraintNetworkType inputType) Declares the temporal-network kind represented by this graph.final StringtoString()static <K extends Edge>
DenseTCGraph.UnmodifiableDenseTCGraph<K> unmodifiable(DenseTCGraph<K> g) Returns an unmodifiable DenseTCGraph backed by the given DenseTCGraph.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface TemporalConstraintGraph
clearOutcomes, copyCleaningRedundantLabels, findEdge, getPredecessors, getSuccessors, getUniqueEdgeName, getVerticesArray, hasSameEdgesOf, makeNewEdge, ownsEdge, ownsNode, promoteToPCSTNUIfParameter, recordCheckOutcome, recordDispatchabilityOutcome, rewriteALetterReferencesModifier and TypeMethodDescriptiondefault voidClears both the persisted check result and the persisted dispatchability representation.default voidPopulates this (initially empty) graph as a copy ofsource, dropping labeled values whose label contains the unknown literal or whose value isConstants.INT_NEG_INFINITE, and dropping edges left empty by this filtering.default KfindEdge(LabeledNode source, LabeledNode destination) Finds the directed edge fromsourcetodestination, ornull.default Collection<LabeledNode> getPredecessors(LabeledNode vertex) default Collection<LabeledNode> getSuccessors(LabeledNode vertex) default StringgetUniqueEdgeName(String edgeName) ReturnsedgeNamewhen available; otherwise appends the first available suffix among_0,_1, and so on.default LabeledNode[]default booleanhasSameEdgesOf(TemporalConstraintGraph<K> other) Returnstrueif this graph contains the same set of edges asother.default KmakeNewEdge(String edgeName, Edge.ConstraintType edgeType) Creates a new edge suitable for this graph, with a non-conflicting name and the requested constraint type.default booleantrueif and only if the supplied edge object is the same object stored in this graph (compared by identity, not by name).default booleanownsNode(LabeledNode node) trueif and only if the supplied node object is the same object stored in this graph (compared by identity, not by name).default voidMakes this graph a PCSTNU whennodeis a parameter one and the graph still calls itself a CSTNU.default voidrecordCheckOutcome(CheckOutcome.Kind kind, boolean successful, String algorithm) Builds and stores aCheckOutcome, stamped withCheckOutcome.currentToolVersion().default voidrecordDispatchabilityOutcome(DispatchabilityOutcome.Status status, String algorithm) Builds and stores aDispatchabilityOutcome.default voidrewriteALetterReferences(ALabelAlphabet.ALetter oldLetter, ALabelAlphabet.ALetter newLetter) Rewrites every A-Label-based semantic reference tooldLetter, throughout this graph, intonewLetter.
-
Constructor Details
-
UnmodifiableDenseTCGraph
Default constructor- Parameters:
network- to make unmodifiable
-
-
Method Details
-
addChildToObserverNode
Unsupported.- Overrides:
addChildToObserverNodein classDenseTCGraph<K extends Edge>- Parameters:
obs- aLabeledNodeobject.child- a char.
-
addEdge
Unsupported.- Specified by:
addEdgein interfaceTemporalConstraintGraph<K extends Edge>- Overrides:
addEdgein classDenseTCGraph<K extends Edge>- Parameters:
e- edge to addv1- source endpointv2- destination endpoint- Returns:
trueif the graph changed- See Also:
-
addEdge
-
addVertex
Unsupported.- Specified by:
addVertexin interfaceTemporalConstraintGraph<K extends Edge>- Overrides:
addVertexin classDenseTCGraph<K extends Edge>- Parameters:
vertex- time-point to add- Returns:
trueif the graph changed
-
clear
public final void clear()Makes this graph empty.- Specified by:
clearin interfaceTemporalConstraintGraph<K extends Edge>- Overrides:
clearin classDenseTCGraph<K extends Edge>
-
clear
public void clear(int initialAdjSize) Unsupported- Overrides:
clearin classDenseTCGraph<K extends Edge>- Parameters:
initialAdjSize- expected number of vertices.
-
clearCache
public void clearCache()Unsupported.- Specified by:
clearCachein interfaceTemporalConstraintGraph<K extends Edge>- Overrides:
clearCachein classDenseTCGraph<K extends Edge>
-
copy
Unsupported.- Overrides:
copyin classDenseTCGraph<K extends Edge>- Parameters:
g- the graph to copy.
-
newInstance
@NonNull public final <F extends Edge, I extends F> DenseTCGraph<F> newInstance(@Nonnull String inputName, @Nonnull Class<I> edgeImplClass, int initialCapacity) Unsupported.- Specified by:
newInstancein interfaceTemporalConstraintGraph<K extends Edge>- Overrides:
newInstancein classDenseTCGraph<K extends Edge>- Type Parameters:
F- the new graph's API-level edge type (e.g.,CSTNEdge)I- the concrete edge implementation, a subtype ofF(e.g.,CSTNEdgePluggable); kept distinct fromFso that callers can assign the result to aTemporalConstraintGraph<F>variable without an unchecked cast, whileedgeImplClassstays the concrete, instantiable class- Parameters:
inputName- new graph's name, for diagnosticsedgeImplClass- concrete edge implementation for the new graphinitialCapacity- expected vertex count, used as a pre-sizing hint by implementations whose internal storage benefits from it (e.g.,DenseTCGraph's adjacency matrix); implementations without a capacity-aware constructor may ignore it- Returns:
- a new, empty graph of the same concrete backend as this graph and of the requested edge type
-
newInstance
Unsupported.- Parameters:
source- the graph to copy; may use a different backend than the receiver- Returns:
- a new graph, of the receiver's concrete backend and edge implementation, that is a
faithful copy of
source
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classDenseTCGraph<K extends Edge>
-
removeEdge
Unsupported.- Parameters:
edge- edge to remove- Returns:
trueif the graph changed
-
removeEdge
Unsupported.- Specified by:
removeEdgein interfaceTemporalConstraintGraph<K extends Edge>- Overrides:
removeEdgein classDenseTCGraph<K extends Edge>- Parameters:
edgeName- aStringobject.- Returns:
- true if the edge was removed, false if the edge is not present.
-
removeEmptyEdges
public boolean removeEmptyEdges()Unsupported.- Returns:
- true if at least one edge has been removed.
-
removeVertex
Unsupported.- Specified by:
removeVertexin interfaceTemporalConstraintGraph<K extends Edge>- Overrides:
removeVertexin classDenseTCGraph<K extends Edge>- Parameters:
removingNode- time-point to remove- Returns:
- true if the node was removed, false if the node was not present and, therefore, not removed.
-
renameEdge
Unsupported.- Specified by:
renameEdgein interfaceTemporalConstraintGraph<K extends Edge>- Overrides:
renameEdgein classDenseTCGraph<K extends Edge>- Parameters:
edge- an edge already contained in this graphnewName- the new, non-empty, not-already-used name
-
renameNode
Unsupported.- Specified by:
renameNodein interfaceTemporalConstraintGraph<K extends Edge>- Overrides:
renameNodein classDenseTCGraph<K extends Edge>- Parameters:
node- a node already contained in this graphnewName- the new, non-empty, not-already-used name
-
replaceContentsFrom
Unsupported.- Specified by:
replaceContentsFromin interfaceTemporalConstraintGraph<K extends Edge>- Overrides:
replaceContentsFromin classDenseTCGraph<K extends Edge>- Parameters:
g- same-backend graph whose contents become this graph's contents
-
reverse
-
setInputFile
Unsupported.- Specified by:
setInputFilein interfaceTemporalConstraintGraph<K extends Edge>- Overrides:
setInputFilein classDenseTCGraph<K extends Edge>- Parameters:
file- aFileobject.
-
setName
Unsupported.- Specified by:
setNamein interfaceTemporalConstraintGraph<K extends Edge>- Overrides:
setNamein classDenseTCGraph<K extends Edge>- Parameters:
graphName- the name to set
-
setZ
Unsupported.- Specified by:
setZin interfaceTemporalConstraintGraph<K extends Edge>- Overrides:
setZin classDenseTCGraph<K extends Edge>- Parameters:
z- the node to be set as the Z node of the network. If z is null, then the Z information is nullified.
-
takeFrom
Unsupported.- Overrides:
takeFromin classDenseTCGraph<K extends Edge>- Parameters:
g- the graph to cannibalize.
-
transpose
public void transpose()Unsupported.- Specified by:
transposein interfaceTemporalConstraintGraph<K extends Edge>- Overrides:
transposein classDenseTCGraph<K extends Edge>
-