code: public int compareTo(BaseSingleFieldPeriod other) {
          if (other.getClass() != getClass()) {
              throw new ClassCastException(getClass() + " cannot be compared to " + other.getClass());
          }
          int otherValue = other.getValue();
          int thisValue = getValue();
          if (thisValue > otherValue) {
              return 1;
          }
          if (thisValue < otherValue) {
              return -1;
          }
          return 0;
      }
docs: Compares this period to another object of the same class.
  
  @param other  the other period, must not be null
  @return zero if equal, positive if greater, negative if less
  @throws NullPointerException if the other period is null
  @throws ClassCastException if the other period is of a different type