KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > displaytag > test > NumberedItem


1 package org.displaytag.test;
2
3 import org.apache.commons.lang.builder.ToStringBuilder;
4 import org.apache.commons.lang.builder.ToStringStyle;
5
6
7 /**
8  * Simple test objects which wraps an int value.
9  * @author Fabrizio Giustina
10  * @version $Revision: 983 $ ($Author: fgiust $)
11  */

12 public class NumberedItem
13 {
14
15     /**
16      * Wrapped int.
17      */

18     private int number;
19
20     /**
21      * Instantiates a new numbered item.
22      * @param num integer that will be returned by getNumber()
23      */

24     public NumberedItem(int num)
25     {
26         this.number = num;
27     }
28
29     /**
30      * Getter for the wrapped int.
31      * @return Returns the number.
32      */

33     public int getNumber()
34     {
35         return this.number;
36     }
37
38     /**
39      * @see java.lang.Object#toString()
40      */

41     public String JavaDoc toString()
42     {
43         return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("number", this.number).toString();
44     }
45 }
Popular Tags