KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > tck > testmodels > fruit > FruitLover


1 /*
2  * $Id: FruitLover.java 3167 2006-09-22 15:47:04Z holger $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.tck.testmodels.fruit;
12
13 import java.util.ArrayList JavaDoc;
14 import java.util.List JavaDoc;
15
16 public class FruitLover
17 {
18     private List JavaDoc eatList = new ArrayList JavaDoc();
19     private String JavaDoc catchphrase;
20
21     public FruitLover(String JavaDoc catchphrase)
22     {
23         this.catchphrase = catchphrase;
24     }
25
26     public void eatFruit(Fruit fruit)
27     {
28         fruit.bite();
29         eatList.add(fruit.getClass());
30     }
31
32     public List JavaDoc getEatList()
33     {
34         return eatList;
35     }
36
37     public String JavaDoc speak()
38     {
39         return catchphrase;
40     }
41 }
42
Popular Tags