Class ListUtils.LcsVisitor<E>

  • All Implemented Interfaces:
    CommandVisitor<E>
    Enclosing class:
    ListUtils

    private static final class ListUtils.LcsVisitor<E>
    extends java.lang.Object
    implements CommandVisitor<E>
    A helper class used to construct the longest common subsequence.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.ArrayList<E> sequence  
    • Constructor Summary

      Constructors 
      Constructor Description
      LcsVisitor()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<E> getSubSequence()  
      void visitDeleteCommand​(E object)
      Method called when a delete command is encountered.
      void visitInsertCommand​(E object)
      Method called when an insert command is encountered.
      void visitKeepCommand​(E object)
      Method called when a keep command is encountered.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sequence

        private final java.util.ArrayList<E> sequence
    • Constructor Detail

      • LcsVisitor

        public LcsVisitor()
    • Method Detail

      • visitInsertCommand

        public void visitInsertCommand​(E object)
        Description copied from interface: CommandVisitor
        Method called when an insert command is encountered.
        Specified by:
        visitInsertCommand in interface CommandVisitor<E>
        Parameters:
        object - object to insert (this object comes from the second sequence)
      • visitDeleteCommand

        public void visitDeleteCommand​(E object)
        Description copied from interface: CommandVisitor
        Method called when a delete command is encountered.
        Specified by:
        visitDeleteCommand in interface CommandVisitor<E>
        Parameters:
        object - object to delete (this object comes from the first sequence)
      • visitKeepCommand

        public void visitKeepCommand​(E object)
        Description copied from interface: CommandVisitor
        Method called when a keep command is encountered.
        Specified by:
        visitKeepCommand in interface CommandVisitor<E>
        Parameters:
        object - object to keep (this object comes from the first sequence)
      • getSubSequence

        public java.util.List<E> getSubSequence()