/** * AntiQuark is a simple JavaBean and the opposite of a Quark. * * @author Thornton Rose */ public class AntiQuark implements IQuark { private String flavor; // AntiQuark(): /** * Create a new AntiQuark. */ public AntiQuark() { setFlavor("vanilla"); } // getFlavor(): /** * Return the flavor. */ public String getFlavor() { return flavor; } // setFlavor(String): /** * Set the flavor to newFlavor. */ public void setFlavor(String newFlavor) { flavor = (new StringBuffer(newFlavor)).reverse().toString(); } // setFlavor(Object): /** * Set the flavor to newFlavor. */ public void setFlavor(Object newFlavor) { setFlavor((String) newFlavor); } // spin(): /** * Spin the AntiQuark (which, of course, spins in the opposite direction of * a Quark). */ public void spin() { System.out.print(".enod "); for (int i = 0; i < 5; i ++) { System.out.print("."); try { Thread.sleep(250); } catch(InterruptedException ex) { System.out.print(" !depurretni "); } } System.out.println(" gninnipS"); } /* public static void main(String[] args) { Quark q = new Quark(); q.spin(); } */ }