code: @Override
    protected boolean compareWithBoundary(Long value, Long boundary)
        throws IOException {
      if (segmentRegistration.equals(SEGMENT_SORT_ASC)
          || segmentRegistration.equals(SEGMENT_BOUNDARY_ASC)) {
        return value <= boundary;
      } else if (segmentRegistration.equals(SEGMENT_SORT_DESC)
          || segmentRegistration.equals(SEGMENT_BOUNDARY_DESC)) {
        return value >= boundary;
      } else {
        throw new IOException(
            "can't compare for segmentRegistration " + segmentRegistration);
      }
    }
docs: /*
  (non-Javadoc)
  
  @see
  mtas.codec.util.DataCollector.MtasDataCollector#compareForComputingSegment(
  java.lang.Number, java.lang.Number)