package binaryTree; /** * Represents all extrinsic algorithms on a BiTree as a visitor to the * BiTree host structure. The BiTree host will make the appropriate * call on this IAlgo's methods. * * @author Alan L. Cox * @author Dung X. Nguyen - Copyright 1999 - All rights reserved. * @since 4/5/01 */ public interface IAlgo { /** * Called by the host when the host is empty. * * @param host * @param input the input needed by the visiting algorithm. * @return the output produced by the visiting algorithm. */ public Object emptyCase(BiTree host, Object input); /** * Called by the host when the host is not empty. * * @param host * @param input the input needed by the visiting algorithm. * @return the output produced by the visiting algorithm. */ public Object nonEmptyCase(BiTree host, Object input); }