KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SOFA > SOFAnet > Admin > RMI > OutputTriggerDesc


1 /*
2  * OutputTriggerDesc.java
3  *
4  * Created on 18. květen 2004, 14:29
5  */

6
7 package SOFA.SOFAnet.Admin.RMI;
8
9 import SOFA.SOFAnet.Repository.OutputTrigger;
10 import java.io.Serializable JavaDoc;
11
12 /**
13  *
14  * @author Ladislav Sobr
15  */

16 public class OutputTriggerDesc implements Comparable JavaDoc, Serializable JavaDoc
17 {
18   public String JavaDoc name;
19   public String JavaDoc description;
20   
21   /** Creates a new instance of OutputTriggerDesc */
22   public OutputTriggerDesc(OutputTrigger outputTrigger)
23   {
24     this.name = outputTrigger.getName();
25     this.description = outputTrigger.getDescription();
26   }
27     
28   OutputTriggerDesc(String JavaDoc name, String JavaDoc description)
29   {
30     this.name = name;
31     this.description = description;
32   }
33
34   public boolean equals(Object JavaDoc o)
35   {
36     if (this == o) return true;
37     if (o instanceof OutputTriggerDesc)
38     {
39       OutputTriggerDesc outputTriggerDesc = (OutputTriggerDesc)o;
40       return toString().compareTo(outputTriggerDesc.toString()) == 0;
41     }
42     else return false;
43   }
44
45   public int compareTo(Object JavaDoc o)
46   {
47     OutputTriggerDesc outputTriggerDesc = (OutputTriggerDesc)o;
48     return toString().compareTo(outputTriggerDesc.toString());
49   }
50
51   public String JavaDoc toString()
52   {
53     if (description.length() == 0) return name;
54     else return name + " (" + description + ")";
55   }
56 }
Popular Tags