Example #1
0
  @Override
  public boolean equals(Object obj) {
    // Since this can not be null
    if (obj == null) {
      return false;
    }

    // Check that that is the same as this
    // Don't use instanceOf since that breaks inheritance
    if (!obj.getClass().equals(this.getClass())) {
      return false;
    }

    VerseRange vr = (VerseRange) obj;

    // The real tests
    if (!vr.getStart().equals(getStart())) {
      return false;
    }

    if (vr.getCardinality() != getCardinality()) {
      return false;
    }

    // We don't really need to check this one too.
    // if (!vr.getEnd().equals(getEnd())) return false;

    return true;
  }
Example #2
0
 /** Ctor */
 protected VerseIterator(VerseRange range) {
   v11n = range.getVersification();
   nextVerse = range.getStart();
   total = range.getCardinality();
   count = 0;
 }