edgegraph.structure.link.Link#
- class edgegraph.structure.link.Link(*, vertices=None, uid=None, attributes=None, _force_creation=False)#
Bases:
BaseObjectRepresents an edge in the edge-vertex graph.
Warning
This object is the base class for edge types, and should not be used on its own. Its meaning and semantics are undefined (it is neither a directed edge nor an undirected edge).
See also
UnDirectedEdge, a subclass representing an undirected edge between two verticesDirectedEdge, a subclass representing a directed edge between two vertices
- __init__(*, vertices=None, uid=None, attributes=None, _force_creation=False)#
Instantiate a new link (“edge”).
Warning
Generally, creating objects of this type is a bad idea, as their meaning is undefined. Instead, see the subclass types that implement directed or undirected edges.
- Parameters:
See also
edgegraph.structure.base.BaseObject.__init__(), the superclass constructor
Methods
__init__(*[, vertices, uid, attributes, ...])Instantiate a new link ("edge").
add_to_universe(universe)Adds this object to a new universe.
add_vertex(new)Adds a vertex to this link.
remove_from_universe(universe)Remove this object from the specified universe.
unlink_from(kill)Remove the link association from the given vertex.
Attributes
Get the UID of this object.
Get the universes this object belongs to.
Return a tuple of vertices this edge connects.
- add_to_universe(universe)#
Adds this object to a new universe. If it is already there, no action is taken.
- Parameters:
universe (Universe) – the new universe to add this object to
- add_vertex(new)#
Adds a vertex to this link.
- Parameters:
new (Vertex) – the vertex to add to the link
- remove_from_universe(universe)#
Remove this object from the specified universe.
- property universes: frozenset[Universe]#
Get the universes this object belongs to.
Note that this gives you a
frozenset; you cannot add or remove universes from this attribute.See also
add_to_universe(),remove_from_universe()to add or remove this object from a given universe