Class Vertex

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class Vertex
    extends java.lang.Object
    implements java.lang.Cloneable, java.io.Serializable
    Version:
    $Id$
    Author:
    Michal Maczka
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Vertex​(java.lang.String label)  
    • Constructor Detail

      • Vertex

        public Vertex​(java.lang.String label)
    • Method Detail

      • getLabel

        public java.lang.String getLabel()
        Returns:
      • addEdgeTo

        public void addEdgeTo​(Vertex vertex)
        Parameters:
        vertex -
      • removeEdgeTo

        public void removeEdgeTo​(Vertex vertex)
        Parameters:
        vertex -
      • addEdgeFrom

        public void addEdgeFrom​(Vertex vertex)
        Parameters:
        vertex -
      • removeEdgeFrom

        public void removeEdgeFrom​(Vertex vertex)
      • getChildren

        public java.util.List<Vertex> getChildren()
      • getChildLabels

        public java.util.List<java.lang.String> getChildLabels()
        Get the labels used by the most direct children.
        Returns:
        the labels used by the most direct children.
      • getParents

        public java.util.List<Vertex> getParents()
        Get the list the most direct ancestors (parents).
        Returns:
        list of parents
      • getParentLabels

        public java.util.List<java.lang.String> getParentLabels()
        Get the labels used by the most direct ancestors (parents).
        Returns:
        the labels used parents
      • isLeaf

        public boolean isLeaf()
        Indicates if given vertex has no child
        Returns:
        true if this vertex has no child, false otherwise
      • isRoot

        public boolean isRoot()
        Indicates if given vertex has no parent
        Returns:
        true if this vertex has no parent, false otherwise
      • isConnected

        public boolean isConnected()
        Indicates if there is at least one edee leading to or from given vertex
        Returns:
        true if this vertex is connected with other vertex,false otherwise
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Overrides:
        clone in class java.lang.Object
        Throws:
        java.lang.CloneNotSupportedException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object