propertyHolder-class {graph}R Documentation

Class "propertyHolder"

Description

This is a virtual class used as a base class for graph edge and node classes. This is used to hold named properties associated with objects from its super classes.

Objects from the Class

A virtual Class: No objects may be created from it.

Slots

property:
Object of class "list", a named list of properties.

Methods

property
signature(x = "propertyHolder", prop = "character"): A method for accessing the property named in prop.
property<-
signature(x = "propertyHolder", prop = "character"): A method for setting the property named in prop.

Author(s)

Saikat DebRoy

See Also

gNode-class and gEdge-class are super classes of "propertyHolder". The later always holds a numeric property named "weight".

Examples

nodeA <- new("gNode", label="A")
nodeB <- new("gNode", label="A")
edgeAB <- new("gEdge", bNode=nodeA, eNode=nodeB)
property(edgeAB, "weight") # default weight is 1.0
property(edgeAB, "weight") <- 2.0
property(edgeAB, "weight")

[Package graph version 1.8.0 Index]