class RangerTimeOfDayMatcher extends RangerAbstractConditionEvaluator {

	int[] extractDuration(String value) {
		if(LOG.isDebugEnabled()) {
			LOG.debug("==> RangerTimeOfDayMatcher.extractDuration(" + value + ")");
		}
		
		int[] result = null;
		if (value == null) {
			LOG.warn("extractDuration: null input value!");
		} else {
			Matcher m = _Pattern.matcher(value);
			if (!m.matches()) {
				LOG.warn("extractDuration: input[" + value + "] did not match pattern!");
			} else {
				int startHour = Integer.parseInt(m.group(1));
				int startMin = 0;
				if (m.group(3) != null) {
					startMin = Integer.parseInt(m.group(3));
				}
				String startType = m.group(4).toUpperCase();
				
				int endHour = Integer.parseInt(m.group(5));
				int endMinute = 0;
				if (m.group(7) != null) {
					endMinute = Integer.parseInt(m.group(7));
				}
				String endType = m.group(8).toUpperCase();
				if(startHour == 12) {
					if(startType.equals("A")) {
						startHour = 0;
					}
				} else if (startType.equals("P")) {
					startHour += 12;
				}

				if(endHour == 12) {
					if(endType.equals("A")) {
						endHour = 0;
					}
				} else if (endType.equals("P")) {
					endHour += 12;
				}

				result = new int[] { (startHour*60)+startMin, (endHour*60)+endMinute };
			}
		}

		if(LOG.isDebugEnabled()) {
			LOG.debug("<== RangerTimeOfDayMatcher.extractDuration(" + value + "): duration[" + result + "]");
		}
		return result;
	}

}