Class AbstractGraph.SimpleVertex

    • Constructor Detail

    • Method Detail

      • getId

        public ID getId()
        Description copied from interface: Graph.Vertex
        returns identifier of vertex.
        Specified by:
        getId in interface Graph.Vertex<ID>
        Returns:
        identifier of vertex
      • setId

        public void setId​(ID id)
        Description copied from interface: Graph.Vertex
        sets identifier of vertex.
        Specified by:
        setId in interface Graph.Vertex<ID>
        Parameters:
        id - identifier of vertex
      • id

        public Graph.Vertex<ID> id​(ID id)
        Description copied from interface: Graph.Vertex
        sets identifier of this vertex. This vertex is returned.
        Specified by:
        id in interface Graph.Vertex<ID>
        Parameters:
        id - identifier of vertex.
        Returns:
        this vertex
      • setProperty

        public void setProperty​(String name,
                                Object value)
        Adds a local property to this element.
        Specified by:
        setProperty in interface Graph.Vertex<ID>
        Parameters:
        name - of property
        value - of property
      • connectsTo

        public Graph.Vertex<ID> connectsTo​(ID to)
        Description copied from interface: Graph.Vertex
        Ensures this vertex connects to the vertex with an 'id' property equal to the 'to' parameter. The edge or vertex is created if needed. This vertex is returned.

        If a vertex is created its 'id' property will be set to the 'to' parameter. If an edge is created the 'from' property is set to the 'id' of this vertex and the 'to' property is set to the 'id' of the 'to' vertex.

        If this graph is undirected and contains an edge connecting this vertex with 'to' the edge will not be created. Undirected graphs ignore 'from'/'to' order in edges.

        Specified by:
        connectsTo in interface Graph.Vertex<ID>
        Parameters:
        to - vertex id
        Returns:
        this vertex
      • connectsFrom

        public Graph.Vertex<ID> connectsFrom​(ID s)
        Description copied from interface: Graph.Vertex
        Ensures this vertex connects to the vertex with an 'id' property equal to the 'from' parameter. The edge or vertex is created if needed. This vertex is returned.

        If a vertex is created its 'id' property will be set to the 'from' parameter. If an edge is created the 'from' property is set to the 'id' of the 'from' vertex and the 'to' property is set to the 'id' of this vertex.

        If this graph is undirected and contains an edge connecting this vertex with 'from' the edge will not be created. Undirected graphs ignore 'from'/'to' order in edges.

        Specified by:
        connectsFrom in interface Graph.Vertex<ID>
        Parameters:
        s - vertex id
        Returns:
        this vertex
      • inEdges

        public Set<Graph.Edge<ID>> inEdges()
        Description copied from interface: Graph.Vertex
        Returns the set of edges connecting to this vertex where 'to' is the 'id' of this vertex
        Specified by:
        inEdges in interface Graph.Vertex<ID>
        Returns:
        incoming edges
      • outEdges

        public Set<Graph.Edge<ID>> outEdges()
        Description copied from interface: Graph.Vertex
        Returns the set of edges connecting to this vertex where 'from' is the 'id' of this vertex
        Specified by:
        outEdges in interface Graph.Vertex<ID>
        Returns:
        outgoing edges
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • inherited

        public final Map<String,​Object> inherited()
        Returns inherited properties as an unmodifiableMap.
        Returns:
        inherited properties
      • local

        public final Map<String,​Object> local()
        Returns an unmodifiable Map of all properties set on this Element.
        Returns:
        all properties set on this element
      • getProperty

        public final Optional<Object> getProperty​(String name)
        Returns the value of a property. If the property is local its value is returned before checking for an inherited property.
        Parameters:
        name - of property to return
        Returns:
        value mapped to name
        Throws:
        NullPointerException - if name is null
      • property

        public final SELF property​(String name,
                                   Object value)
        Adds a local property to this element returning it.
        Parameters:
        name - of property
        value - of property
        Returns:
        this element