KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > legacy > Sortable


1 package org.hibernate.test.legacy;
2
3 public class Sortable implements Comparable JavaDoc {
4     
5     private int id;
6     private String JavaDoc name;
7     
8     private Sortable() {}
9     Sortable(String JavaDoc name) {
10         this.name = name;
11     }
12     
13     public int compareTo(Object JavaDoc o) {
14         return name.compareTo( ( (Sortable) o).name );
15     }
16
17     public int getId() {
18         return id;
19     }
20
21     public String JavaDoc getName() {
22         return name;
23     }
24
25     public void setId(int i) {
26         id = i;
27     }
28
29     public void setName(String JavaDoc string) {
30         name = string;
31     }
32
33 }
34
Popular Tags