Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r4654 - branches/perfsonarui/src/org/perfsonar/perfsonarui/ma

Subject: perfsonar development work

List archive

perfsonar: r4654 - branches/perfsonarui/src/org/perfsonar/perfsonarui/ma


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r4654 - branches/perfsonarui/src/org/perfsonar/perfsonarui/ma
  • Date: Wed, 22 Oct 2008 13:00:01 -0400

Author: michael.bischoff
Date: 2008-10-22 13:00:00 -0400 (Wed, 22 Oct 2008)
New Revision: 4654

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java
Log:
Improved equals to improve speed.

Modified: branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java
2008-10-22 13:42:45 UTC (rev 4653)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/ma/UserData.java
2008-10-22 17:00:00 UTC (rev 4654)
@@ -23,11 +23,8 @@
import java.util.Date;
import java.util.TimeZone;

-import org.omg.CORBA.UNKNOWN;
import org.perfsonar.perfsonarui.AbstractUserData;
-import org.perfsonar.perfsonarui.IPerfsonarSchema;
import org.perfsonar.perfsonarui.plugins.IUserData;
-import org.perfsonar.perfsonarui.plugins.MAEndpoint;
import org.perfsonar.perfsonarui.ui.PerfsonarModel;

/**
@@ -461,21 +458,26 @@
return INDEX_RESOLUTION+1;
}
@Override
- public boolean equals(Object arg0) {
- if (arg0 instanceof UserData) {
- UserData o = (UserData) arg0;
- return
getHostname(AbstractUserData.ID_RESPONSE).equals(o.getHostname(AbstractUserData.ID_RESPONSE))
&&
-
getifAddress(AbstractUserData.ID_RESPONSE).equals(o.getifAddress(AbstractUserData.ID_RESPONSE))
&&
-
getIfName(AbstractUserData.ID_RESPONSE).equals(o.getIfName(AbstractUserData.ID_RESPONSE))
&&
-
getIfDescr(AbstractUserData.ID_RESPONSE).equals(o.getIfDescr(AbstractUserData.ID_RESPONSE))
;
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof UserData))
+ return false;

+ UserData o = (UserData) obj;
+ return
getHostname(AbstractUserData.ID_RESPONSE).equals(o.getHostname(AbstractUserData.ID_RESPONSE))
&&
+
getifAddress(AbstractUserData.ID_RESPONSE).equals(o.getifAddress(AbstractUserData.ID_RESPONSE))
&&
+
getIfName(AbstractUserData.ID_RESPONSE).equals(o.getIfName(AbstractUserData.ID_RESPONSE))
&&
+
getIfDescr(AbstractUserData.ID_RESPONSE).equals(o.getIfDescr(AbstractUserData.ID_RESPONSE))
;
+
/*
String[][] o = ((UserData) arg0).getData();
for (int i=0; i<INDEX_IFDESCR;i++)
if
(!data[i][ID_QUERY].equals(o[i][ID_QUERY])) return false;
return true;
*/
- } else return false;
}
@Override
public int compareTo(IUserData arg0) {



  • perfsonar: r4654 - branches/perfsonarui/src/org/perfsonar/perfsonarui/ma, svnlog, 10/22/2008

Archive powered by MHonArc 2.6.16.

Top of Page