FileDocCategorySizeDatePackage
CustomBuilderExample.javaAPI DocExample2884Wed May 18 09:39:00 BST 2005com.discursive.jccook.lang

CustomBuilderExample

public class CustomBuilderExample extends Object

Fields Summary
private static Logger
logger
private TaxReturn
return1
private TaxReturn
return2
private TaxReturn
return3
Constructors Summary
Methods Summary
protected voidinitialize()

        return1 =
            new TaxReturn(
                "012-68-3242",
                1998,
                "O'Brien",
                new BigDecimal(43000.00));
        return2 =
            new TaxReturn(
                "012-68-3242",
                1999,
                "O'Brien",
                new BigDecimal(45000.00));
        return3 =
            new TaxReturn(
                "012-68-3242",
                1999,
                "O'Brien",
                new BigDecimal(53222.00));

    
public static voidmain(java.lang.String[] pArgs)

        CustomBuilderExample example = new CustomBuilderExample();
        example.initialize();
        example.testToString();
        example.testHashCode();
        example.testEquals();
        example.testCompare();
    
public voidtestCompare()

        logger.info("return1 compareTo return2: " + return1.compareTo(return2));
        logger.info("return1 compareTo return3: " + return1.compareTo(return3));
    
public voidtestEquals()

        logger.info("return1 equals return2: " + return1.equals(return2));
        logger.info("return2 equals return3: " + return2.equals(return3));
    
public voidtestHashCode()

        logger.info("HashCodeBuilder: " + return2.hashCode());
        Set set = new HashSet();
        set.add(return1);
        set.add(return2);
        set.add(return3);
    
public voidtestToString()

        logger.info("ToStringBuilder: " + return1.toString());