Package tilda.utils

Class Graph<T>


  • public class Graph<T>
    extends java.lang.Object
    Author:
    ldh
    • Field Detail

      • LOG

        protected static final org.apache.logging.log4j.Logger LOG
    • Constructor Detail

      • Graph

        public Graph​(T v)
    • Method Detail

      • getLeaves

        public java.util.Set<T> getLeaves​(boolean Remove)
      • getLeaves

        protected void getLeaves​(boolean Remove,
                                 java.util.Set<T> Leaves,
                                 Graph.Node<T> N)
      • contains

        public boolean contains​(T t)
      • contains

        protected boolean contains​(T t,
                                   Graph.Node<T> N)
      • remove

        public boolean remove​(T t)
      • remove

        protected boolean remove​(T t,
                                 Graph.Node<T> N)
      • traverse

        protected static <T> void traverse​(Graph.Visitor<T> V,
                                           int Level,
                                           int FirstMiddleLast,
                                           Graph.Node<T> N,
                                           java.util.List<T> Path,
                                           boolean pre)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • traverse

        public void traverse​(Graph.Visitor<T> V,
                             boolean pre)
                      throws java.lang.Exception
        Given a visitor V, traverses the graph depth first
        Parameters:
        V -
        pre - Whether the visitor should be called on node entry (pre-processing), or node exit (post-processing).
        Throws:
        java.lang.Exception