Class FastDirectedWeightedMultiEdges
java.lang.Object
es.uam.eps.ir.relison.graph.multigraph.edges.fast.FastMultiEdges
es.uam.eps.ir.relison.graph.multigraph.edges.fast.FastDirectedWeightedMultiEdges
- All Implemented Interfaces:
- DirectedMultiEdges,- MultiEdges,- WeightedMultiEdges
public class FastDirectedWeightedMultiEdges extends FastMultiEdges implements DirectedMultiEdges, WeightedMultiEdges
Fast implementation of directed weighted edges for multigraphs.
- 
Field SummaryFields inherited from class es.uam.eps.ir.relison.graph.multigraph.edges.fast.FastMultiEdgesnumEdges, types, weights
- 
Constructor SummaryConstructors Constructor Description FastDirectedWeightedMultiEdges()Constructor.
- 
Method SummaryModifier and Type Method Description booleanaddEdge(int orig, int dest, double weight, int type)Adds an edge to the set.java.util.stream.Stream<java.lang.Integer>getAdjacentNodes(int node)Gets the outgoing neighbourhood of a node.java.util.stream.Stream<MultiEdgeTypes>getAdjacentTypes(int node)Gets the types of the adjacent edges of a node.java.util.stream.Stream<MultiEdgeWeights>getAdjacentWeights(int node)Gets the weights of the adjacent edges of a node.java.util.stream.Stream<java.lang.Integer>getIncidentNodes(int node)Gets the incoming neighbourhood of a node.java.util.stream.Stream<MultiEdgeTypes>getIncidentTypes(int node)Gets the types of the incident edges of a node.java.util.stream.Stream<MultiEdgeWeights>getIncidentWeights(int node)Gets the weights of the incident edges of a node.java.util.stream.IntStreamgetNodesWithAdjacentEdges()Obtains the set of nodes which have adjacent edges.java.util.stream.IntStreamgetNodesWithEdges()Obtains the set of nodes which have edges.java.util.stream.IntStreamgetNodesWithIncidentEdges()Obtains the set of nodes which have incident edges.java.util.stream.IntStreamgetNodesWithMutualEdges()Obtains the set of nodes which have, at least, a reciprocal edge.booleanremoveEdge(int orig, int dest, int idx)Removes an edge.booleanremoveEdges(int orig, int dest)Removes all the edges between a pair of nodes.booleanremoveNode(int idx)Removes a node from the edge list.booleanupdateEdgeType(int orig, int dest, int type, int idx)Modifies the weight of an edge.booleanupdateEdgeWeight(int orig, int dest, double weight, int idx)Modifies the weight of an edge.Methods inherited from class es.uam.eps.ir.relison.graph.multigraph.edges.fast.FastMultiEdgesaddUser, containsEdge, getAdjacentCount, getEdgeTypes, getEdgeWeights, getIncidentCount, getIsolatedNodes, getNumEdges, getNumEdges, hasAdjacentEdges, hasEdges, hasIncidentEdges, hasMutualEdgesMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface es.uam.eps.ir.relison.graph.multigraph.edges.DirectedMultiEdgesgetMutualNodes, getMutualTypes, getNeighbourCount, getNeighbourNodes, getNeighbourTypesMethods inherited from interface es.uam.eps.ir.relison.graph.multigraph.edges.MultiEdgesaddUser, containsEdge, getAdjacentCount, getEdgeTypes, getEdgeWeights, getIncidentCount, getIsolatedNodes, getNumEdges, getNumEdges, hasAdjacentEdges, hasEdges, hasIncidentEdges, hasMutualEdgesMethods inherited from interface es.uam.eps.ir.relison.graph.multigraph.edges.WeightedMultiEdgesgetMutualWeights, getNeighbourWeights
- 
Constructor Details- 
FastDirectedWeightedMultiEdgespublic FastDirectedWeightedMultiEdges()Constructor.
 
- 
- 
Method Details- 
getIncidentNodespublic java.util.stream.Stream<java.lang.Integer> getIncidentNodes(int node)Description copied from interface:MultiEdgesGets the incoming neighbourhood of a node.- Specified by:
- getIncidentNodesin interface- MultiEdges
- Parameters:
- node- The node.
- Returns:
- a stream of all the ids of nodes.
 
- 
getAdjacentNodespublic java.util.stream.Stream<java.lang.Integer> getAdjacentNodes(int node)Description copied from interface:MultiEdgesGets the outgoing neighbourhood of a node.- Specified by:
- getAdjacentNodesin interface- MultiEdges
- Parameters:
- node- The node.
- Returns:
- a stream containing all the ids of the nodes.
 
- 
getIncidentTypesDescription copied from interface:MultiEdgesGets the types of the incident edges of a node.- Specified by:
- getIncidentTypesin interface- MultiEdges
- Parameters:
- node- The node.
- Returns:
- a stream containing all the edge types.
 
- 
getAdjacentTypesDescription copied from interface:MultiEdgesGets the types of the adjacent edges of a node.- Specified by:
- getAdjacentTypesin interface- MultiEdges
- Parameters:
- node- The node.
- Returns:
- a stream containing all the edge types.
 
- 
getIncidentWeightsDescription copied from interface:MultiEdgesGets the weights of the incident edges of a node.- Specified by:
- getIncidentWeightsin interface- MultiEdges
- Specified by:
- getIncidentWeightsin interface- WeightedMultiEdges
- Parameters:
- node- The node.
- Returns:
- a stream containing all the edge types.
 
- 
getAdjacentWeightsDescription copied from interface:MultiEdgesGets the weights of the adjacent edges of a node.- Specified by:
- getAdjacentWeightsin interface- MultiEdges
- Specified by:
- getAdjacentWeightsin interface- WeightedMultiEdges
- Parameters:
- node- The node.
- Returns:
- a stream containing all the edge types.
 
- 
addEdgepublic boolean addEdge(int orig, int dest, double weight, int type)Description copied from interface:MultiEdgesAdds an edge to the set.- Specified by:
- addEdgein interface- MultiEdges
- Parameters:
- orig- Origin node
- dest- Destiny node
- weight- Weight of the edge
- type- Type of the edge
- Returns:
- true if everything went OK, false if not.
 
- 
getNodesWithIncidentEdgespublic java.util.stream.IntStream getNodesWithIncidentEdges()Description copied from interface:MultiEdgesObtains the set of nodes which have incident edges.- Specified by:
- getNodesWithIncidentEdgesin interface- MultiEdges
- Returns:
- a stream containing the ids of nodes with incident edges
 
- 
getNodesWithAdjacentEdgespublic java.util.stream.IntStream getNodesWithAdjacentEdges()Description copied from interface:MultiEdgesObtains the set of nodes which have adjacent edges.- Specified by:
- getNodesWithAdjacentEdgesin interface- MultiEdges
- Returns:
- a stream containing the ids of nodes with incident edges
 
- 
getNodesWithEdgespublic java.util.stream.IntStream getNodesWithEdges()Description copied from interface:MultiEdgesObtains the set of nodes which have edges.- Specified by:
- getNodesWithEdgesin interface- MultiEdges
- Returns:
- a stream containing the ids of nodes with incident edges
 
- 
getNodesWithMutualEdgespublic java.util.stream.IntStream getNodesWithMutualEdges()Description copied from interface:MultiEdgesObtains the set of nodes which have, at least, a reciprocal edge.- Specified by:
- getNodesWithMutualEdgesin interface- MultiEdges
- Returns:
- a stream containing the ids of nodes with reciprocal edges.
 
- 
removeEdgepublic boolean removeEdge(int orig, int dest, int idx)Description copied from interface:MultiEdgesRemoves an edge.- Specified by:
- removeEdgein interface- MultiEdges
- Parameters:
- orig- source node.
- dest- incoming node.
- idx- the number of the edge
- Returns:
- true if everything went OK, false if not.
 
- 
removeNodepublic boolean removeNode(int idx)Description copied from interface:MultiEdgesRemoves a node from the edge list.- Specified by:
- removeNodein interface- MultiEdges
- Parameters:
- idx- the identifier of the node.
- Returns:
- true if everything went OK, false otherwise.
 
- 
removeEdgespublic boolean removeEdges(int orig, int dest)Description copied from interface:MultiEdgesRemoves all the edges between a pair of nodes.- Specified by:
- removeEdgesin interface- MultiEdges
- Parameters:
- orig- source node.
- dest- incoming node.
- Returns:
- true if everything went OK, false otherwise.
 
- 
updateEdgeWeightpublic boolean updateEdgeWeight(int orig, int dest, double weight, int idx)Description copied from interface:MultiEdgesModifies the weight of an edge.- Specified by:
- updateEdgeWeightin interface- MultiEdges
- Parameters:
- orig- source node.
- dest- incoming node.
- weight- the new weight of the edge.
- idx- the number of the edge.
- Returns:
- true if everything went OK, false if not, or the edge does not exist.
 
- 
updateEdgeTypepublic boolean updateEdgeType(int orig, int dest, int type, int idx)Description copied from interface:MultiEdgesModifies the weight of an edge.- Specified by:
- updateEdgeTypein interface- MultiEdges
- Parameters:
- orig- source node.
- dest- incoming node.
- type- the new type of the edge.
- idx- the number of the edge.
- Returns:
- true if everything went OK, false if not, or the edge does not exist.
 
 
-