boolean sameInterval(IntervalI i1, IntervalI i2)
{
// avoiding equals() for JavaScript performance
- return ((SequenceFeature) i1).equals((SequenceFeature) i2, false);
+ return ((SequenceFeature) i1).equalsWithParent((SequenceFeature) i2);
}
}
protected boolean sameInterval(IntervalI i1, IntervalI i2)
{
// avoiding equals() for JavaScript performance
- return ((SequenceFeature) i1).equals((SequenceFeature) i2, false);
+ // could be CrossRef with ignoreParent==true
+ return ((SequenceFeature) i1).equalsWithParent((SequenceFeature) i2);
}
}
import java.util.Iterator;
import java.util.List;
-import intervalstore.api.IntervalI;
-
/**
* Functions for cross-referencing sequence databases.
*
// equals, because that is part of the IntervalI interface,
// and IntervalStore may need that for proper, faster
// processing.
- // @Override
- // public boolean equals(Object o)
- // {
- // return super.equals(o, true);
- // }
- //
+ // But SequenceFeature changes were reverted...
@Override
- public boolean equalsInterval(IntervalI sf)
+ public boolean equals(Object o)
{
- return sf != null
- && equals((SequenceFeature) sf, true);
+ return o instanceof SequenceFeature
+ && equalsWithParent((SequenceFeature) o);
}
- };
+ @Override
+ public boolean equalsWithParent(SequenceFeature sf)
+ {
+ return sf != null && equals(sf, true);
+ }
+ };
matched.addSequenceFeature(newFeature);
}
}
@Override
public boolean equals(Object o)
{
- return (o != null && (o instanceof SequenceFeature)
- && equals(((SequenceFeature) o), false));
+ return (o instanceof SequenceFeature
+ && equalsWithParent((SequenceFeature) o));
+ }
+
+ /**
+ * BH 2019.09.22 required due to subclassing by CrossRef and used by
+ * intervalstore.nonc.IntervalStoreImpl
+ *
+ * @param sf
+ * @return
+ */
+ public boolean equalsWithParent(SequenceFeature sf)
+ {
+ return equals(sf, false);
}
/**