sequence mappings and DbRef mapping objects unified and source binding for castor...
[vamsas.git] / src / uk / ac / vamsas / objects / core / Entry.java
index 8cdd864..3415765 100644 (file)
@@ -221,61 +221,183 @@ implements java.io.Serializable
         if (obj instanceof Entry) {
         
             Entry temp = (Entry)obj;
+            boolean thcycle;
+            boolean tmcycle;
             if (this._id != null) {
                 if (temp._id == null) return false;
-                else if (!(this._id.equals(temp._id))) 
-                    return false;
-            }
-            else if (temp._id != null)
+                if (this._id != temp._id) {
+                    thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
+                    tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
+                    if (thcycle!=tmcycle) {
+                        if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
+                        if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
+                        return false;
+                    }
+                    if (!thcycle) {
+                        if (!this._id.equals(temp._id)) {
+                            org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+                            org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+                            return false;
+                        }
+                        org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
+                        org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
+                    }
+                }
+            } else if (temp._id != null)
                 return false;
             if (this._user != null) {
                 if (temp._user == null) return false;
-                else if (!(this._user.equals(temp._user))) 
-                    return false;
-            }
-            else if (temp._user != null)
+                if (this._user != temp._user) {
+                    thcycle=org.castor.util.CycleBreaker.startingToCycle(this._user);
+                    tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._user);
+                    if (thcycle!=tmcycle) {
+                        if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._user); };
+                        if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._user); };
+                        return false;
+                    }
+                    if (!thcycle) {
+                        if (!this._user.equals(temp._user)) {
+                            org.castor.util.CycleBreaker.releaseCycleHandle(this._user);
+                            org.castor.util.CycleBreaker.releaseCycleHandle(temp._user);
+                            return false;
+                        }
+                        org.castor.util.CycleBreaker.releaseCycleHandle(this._user);
+                        org.castor.util.CycleBreaker.releaseCycleHandle(temp._user);
+                    }
+                }
+            } else if (temp._user != null)
                 return false;
             if (this._app != null) {
                 if (temp._app == null) return false;
-                else if (!(this._app.equals(temp._app))) 
-                    return false;
-            }
-            else if (temp._app != null)
+                if (this._app != temp._app) {
+                    thcycle=org.castor.util.CycleBreaker.startingToCycle(this._app);
+                    tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._app);
+                    if (thcycle!=tmcycle) {
+                        if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._app); };
+                        if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._app); };
+                        return false;
+                    }
+                    if (!thcycle) {
+                        if (!this._app.equals(temp._app)) {
+                            org.castor.util.CycleBreaker.releaseCycleHandle(this._app);
+                            org.castor.util.CycleBreaker.releaseCycleHandle(temp._app);
+                            return false;
+                        }
+                        org.castor.util.CycleBreaker.releaseCycleHandle(this._app);
+                        org.castor.util.CycleBreaker.releaseCycleHandle(temp._app);
+                    }
+                }
+            } else if (temp._app != null)
                 return false;
             if (this._action != null) {
                 if (temp._action == null) return false;
-                else if (!(this._action.equals(temp._action))) 
-                    return false;
-            }
-            else if (temp._action != null)
+                if (this._action != temp._action) {
+                    thcycle=org.castor.util.CycleBreaker.startingToCycle(this._action);
+                    tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._action);
+                    if (thcycle!=tmcycle) {
+                        if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._action); };
+                        if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._action); };
+                        return false;
+                    }
+                    if (!thcycle) {
+                        if (!this._action.equals(temp._action)) {
+                            org.castor.util.CycleBreaker.releaseCycleHandle(this._action);
+                            org.castor.util.CycleBreaker.releaseCycleHandle(temp._action);
+                            return false;
+                        }
+                        org.castor.util.CycleBreaker.releaseCycleHandle(this._action);
+                        org.castor.util.CycleBreaker.releaseCycleHandle(temp._action);
+                    }
+                }
+            } else if (temp._action != null)
                 return false;
             if (this._date != null) {
                 if (temp._date == null) return false;
-                else if (!(this._date.equals(temp._date))) 
-                    return false;
-            }
-            else if (temp._date != null)
+                if (this._date != temp._date) {
+                    thcycle=org.castor.util.CycleBreaker.startingToCycle(this._date);
+                    tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._date);
+                    if (thcycle!=tmcycle) {
+                        if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._date); };
+                        if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._date); };
+                        return false;
+                    }
+                    if (!thcycle) {
+                        if (!this._date.equals(temp._date)) {
+                            org.castor.util.CycleBreaker.releaseCycleHandle(this._date);
+                            org.castor.util.CycleBreaker.releaseCycleHandle(temp._date);
+                            return false;
+                        }
+                        org.castor.util.CycleBreaker.releaseCycleHandle(this._date);
+                        org.castor.util.CycleBreaker.releaseCycleHandle(temp._date);
+                    }
+                }
+            } else if (temp._date != null)
                 return false;
             if (this._propertyList != null) {
                 if (temp._propertyList == null) return false;
-                else if (!(this._propertyList.equals(temp._propertyList))) 
-                    return false;
-            }
-            else if (temp._propertyList != null)
+                if (this._propertyList != temp._propertyList) {
+                    thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList);
+                    tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList);
+                    if (thcycle!=tmcycle) {
+                        if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); };
+                        if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); };
+                        return false;
+                    }
+                    if (!thcycle) {
+                        if (!this._propertyList.equals(temp._propertyList)) {
+                            org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
+                            org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
+                            return false;
+                        }
+                        org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
+                        org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
+                    }
+                }
+            } else if (temp._propertyList != null)
                 return false;
             if (this._paramList != null) {
                 if (temp._paramList == null) return false;
-                else if (!(this._paramList.equals(temp._paramList))) 
-                    return false;
-            }
-            else if (temp._paramList != null)
+                if (this._paramList != temp._paramList) {
+                    thcycle=org.castor.util.CycleBreaker.startingToCycle(this._paramList);
+                    tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._paramList);
+                    if (thcycle!=tmcycle) {
+                        if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._paramList); };
+                        if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._paramList); };
+                        return false;
+                    }
+                    if (!thcycle) {
+                        if (!this._paramList.equals(temp._paramList)) {
+                            org.castor.util.CycleBreaker.releaseCycleHandle(this._paramList);
+                            org.castor.util.CycleBreaker.releaseCycleHandle(temp._paramList);
+                            return false;
+                        }
+                        org.castor.util.CycleBreaker.releaseCycleHandle(this._paramList);
+                        org.castor.util.CycleBreaker.releaseCycleHandle(temp._paramList);
+                    }
+                }
+            } else if (temp._paramList != null)
                 return false;
             if (this._inputList != null) {
                 if (temp._inputList == null) return false;
-                else if (!(this._inputList.equals(temp._inputList))) 
-                    return false;
-            }
-            else if (temp._inputList != null)
+                if (this._inputList != temp._inputList) {
+                    thcycle=org.castor.util.CycleBreaker.startingToCycle(this._inputList);
+                    tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._inputList);
+                    if (thcycle!=tmcycle) {
+                        if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._inputList); };
+                        if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._inputList); };
+                        return false;
+                    }
+                    if (!thcycle) {
+                        if (!this._inputList.equals(temp._inputList)) {
+                            org.castor.util.CycleBreaker.releaseCycleHandle(this._inputList);
+                            org.castor.util.CycleBreaker.releaseCycleHandle(temp._inputList);
+                            return false;
+                        }
+                        org.castor.util.CycleBreaker.releaseCycleHandle(this._inputList);
+                        org.castor.util.CycleBreaker.releaseCycleHandle(temp._inputList);
+                    }
+                }
+            } else if (temp._inputList != null)
                 return false;
             return true;
         }
@@ -523,29 +645,45 @@ implements java.io.Serializable
         int result = super.hashCode();
         
         long tmp;
-        if (_id != null) {
+        if (_id != null
+            && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
            result = 37 * result + _id.hashCode();
+           org.castor.util.CycleBreaker.releaseCycleHandle(_id);
         }
-        if (_user != null) {
+        if (_user != null
+            && !org.castor.util.CycleBreaker.startingToCycle(_user)) {
            result = 37 * result + _user.hashCode();
+           org.castor.util.CycleBreaker.releaseCycleHandle(_user);
         }
-        if (_app != null) {
+        if (_app != null
+            && !org.castor.util.CycleBreaker.startingToCycle(_app)) {
            result = 37 * result + _app.hashCode();
+           org.castor.util.CycleBreaker.releaseCycleHandle(_app);
         }
-        if (_action != null) {
+        if (_action != null
+            && !org.castor.util.CycleBreaker.startingToCycle(_action)) {
            result = 37 * result + _action.hashCode();
+           org.castor.util.CycleBreaker.releaseCycleHandle(_action);
         }
-        if (_date != null) {
+        if (_date != null
+            && !org.castor.util.CycleBreaker.startingToCycle(_date)) {
            result = 37 * result + _date.hashCode();
+           org.castor.util.CycleBreaker.releaseCycleHandle(_date);
         }
-        if (_propertyList != null) {
+        if (_propertyList != null
+            && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
            result = 37 * result + _propertyList.hashCode();
+           org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
         }
-        if (_paramList != null) {
+        if (_paramList != null
+            && !org.castor.util.CycleBreaker.startingToCycle(_paramList)) {
            result = 37 * result + _paramList.hashCode();
+           org.castor.util.CycleBreaker.releaseCycleHandle(_paramList);
         }
-        if (_inputList != null) {
+        if (_inputList != null
+            && !org.castor.util.CycleBreaker.startingToCycle(_inputList)) {
            result = 37 * result + _inputList.hashCode();
+           org.castor.util.CycleBreaker.releaseCycleHandle(_inputList);
         }
         
         return result;