try { if (one.value.contains("$") && two.value.contains("$") && one.value.substring(0, one.value.lastIndexOf("$")).equals(two.value.substring(0, two.value.lastIndexOf("$")))) return Integer.valueOf(one.value.substring(one.value.lastIndexOf("$"))).compareTo(Integer.valueOf(two.value.substring(two.value.lastIndexOf("$")))); } catch (NumberFormatException e) {}   return one.value.compareTo(two.value);
int first = Integer.valueOf(one.value); int second = Integer.valueOf(two.value); if(first==-1) first = Integer.MAX_VALUE; if(second==-1) second = Integer.MAX_VALUE; return new Integer(first).compareTo(second);
		public int compare(StringPair one, StringPair two)		{			// If both have dollar signs and are of the same outer class, compare the numbers after the dollar signs.			try			{				if (one.value.contains("$") && two.value.contains("$")						&& one.value.substring(0, one.value.lastIndexOf("$")).equals(two.value.substring(0, two.value.lastIndexOf("$"))))					return Integer.valueOf(one.value.substring(one.value.lastIndexOf("$"))).compareTo(Integer.valueOf(two.value.substring(two.value.lastIndexOf("$"))));			}			catch (NumberFormatException e) {} // Somebody's playing silly buggers with dollar signs, just do it lexicographically						// Otherwise, lexicographicalify it			return one.value.compareTo(two.value);		}