// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/exception/QCAnalysisException.java
// public class QCAnalysisException extends Exception {
//   public QCAnalysisException(String s) {
//     super(s);
//   }
// 
//   public QCAnalysisException(String s, Throwable cause) {
//     super(s);
//     if (cause != null) {
//         initCause(cause);
//     }
//   }
// }


import uk.ac.tgac.statsdb.exception.QCAnalysisException;
import java.util.AbstractMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
package uk.ac.tgac.statsdb.util;



/**
 * Helper class containing any StatsDB general handy constants and functions
 *
 * @author Rob Davey
 * @date 04/07/13
 * @since 1.0-SNAPSHOT
 */
public class StatsDBUtils {
  /**
   * Regular expression representing a valid range string
   */
  private static final Pattern rangeSpan = Pattern.compile("([0-9]+)-([0-9]+)");

  /**
   * Regular expression representing a valid point number
   */
  private static final Pattern rangePoint = Pattern.compile("([0-9]+)");

  /**
   * Convert a string object representing a range of numbers separated by a hyphen into two numbers
   *
   * @param range
   * @return A pair (Map.Entry) representing the min and max bounds of a given range string, e.g. 32-142
   * results in min=32, max=142
   *
   * @throws uk.ac.tgac.statsdb.exception.QCAnalysisException when a null range is passed to this method, or when the input string is an invalid range string
   */
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/exception/QCAnalysisException.java
// public class QCAnalysisException extends Exception {
//   public QCAnalysisException(String s) {
//     super(s);
//   }
// 
//   public QCAnalysisException(String s, Throwable cause) {
//     super(s);
//     if (cause != null) {
//         initCause(cause);
//     }
//   }
// }


// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/util/StatsDBUtils.java
import uk.ac.tgac.statsdb.exception.QCAnalysisException;
import java.util.AbstractMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

package uk.ac.tgac.statsdb.util;



/**
 * Helper class containing any StatsDB general handy constants and functions
 *
 * @author Rob Davey
 * @date 04/07/13
 * @since 1.0-SNAPSHOT
 */
public class StatsDBUtils {
  /**
   * Regular expression representing a valid range string
   */
  private static final Pattern rangeSpan = Pattern.compile("([0-9]+)-([0-9]+)");

  /**
   * Regular expression representing a valid point number
   */
  private static final Pattern rangePoint = Pattern.compile("([0-9]+)");

  /**
   * Convert a string object representing a range of numbers separated by a hyphen into two numbers
   *
   * @param range
   * @return A pair (Map.Entry) representing the min and max bounds of a given range string, e.g. 32-142
   * results in min=32, max=142
   *
   * @throws uk.ac.tgac.statsdb.exception.QCAnalysisException when a null range is passed to this method, or when the input string is an invalid range string
   */
  public static Map.Entry<Long, Long> parseRange(String range) throws QCAnalysisException {