Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r3916 - trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription

Subject: perfsonar development work

List archive

perfsonar: r3916 - trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r3916 - trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription
  • Date: Thu, 29 May 2008 09:16:46 -0400

Author: michael.bischoff
Date: 2008-05-29 09:16:45 -0400 (Thu, 29 May 2008)
New Revision: 3916

Modified:

trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/Subscription.java
Log:
implemented compairable on Subscription

Modified:
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/Subscription.java
===================================================================
---
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/Subscription.java
2008-05-29 13:11:52 UTC (rev 3915)
+++
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/Subscription.java
2008-05-29 13:16:45 UTC (rev 3916)
@@ -13,7 +13,7 @@
*
* @author michael.bischoff
*/
-public class Subscription {
+public class Subscription implements Comparable<Subscription> {
private final Integer id;
private final String anonimisingKey;
private final String filter;
@@ -114,4 +114,23 @@
public List<String> getRouters() {
return Collections.unmodifiableList(routers);
}
+
+ public int compareTo(Subscription subscription) {
+ return id.intValue() - subscription.id.intValue();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(obj == null) return false;
+ if (obj instanceof Subscription) {
+ Subscription subscription = (Subscription) obj;
+ return id.intValue() == subscription.id.intValue();
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return id.hashCode();
+ }
}



  • perfsonar: r3916 - trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription, svnlog, 05/29/2008

Archive powered by MHonArc 2.6.16.

Top of Page