package list.dl.algo; import list.dl.DLList; /** * Prints the left side of the host from the left end to where the host is. */ public class PrintLeft implements IAlgoLeft { public final static PrintLeft Singleton = new PrintLeft (); private PrintLeft() { } /** * @param host * @param input * @return */ public Object leftEndCase(DLList host, Object input) { return null; } /** * @param host * @param input * @return */ public Object dataNodeCase(DLList host, Object input) { host.getLeftRest ().executeLeft (this, null); System.out.print (" " + host.getLeftFirst ()); return null; } }