@Test public void testGetRangeFromString() { final String test_1 = "0, 32767"; final String test_2 = "6,2"; Range result = ModisUtils.getRangeFromString(test_1); assertNotNull(result); assertEquals(0, (int) result.getMin()); assertEquals(32767, (int) result.getMax()); result = ModisUtils.getRangeFromString(test_2); assertNotNull(result); assertEquals(2, (int) result.getMin()); assertEquals(6, (int) result.getMax()); }
public static Range getRangeFromString(String rangeString) { final Range range = new Range(); final String[] intStringArray = StringUtils.toStringArray(rangeString, ","); final int start = Integer.parseInt(intStringArray[0]); final int stop = Integer.parseInt(intStringArray[1]); if (start < stop) { range.setMin(start); range.setMax(stop); } else { range.setMin(stop); range.setMax(start); } return range; }
ModisUtils { public static Range getRangeFromString(String rangeString) { final Range range = new Range(); final String[] intStringArray = StringUtils.toStringArray(rangeString, ","); final int start = Integer.parseInt(intStringArray[0]); final int stop = Integer.parseInt(intStringArray[1]); if (start < stop) { range.setMin(start); range.setMax(stop); } else { range.setMin(stop); range.setMax(start); } return range; } }
ModisUtils { public static Range getRangeFromString(String rangeString) { final Range range = new Range(); final String[] intStringArray = StringUtils.toStringArray(rangeString, ","); final int start = Integer.parseInt(intStringArray[0]); final int stop = Integer.parseInt(intStringArray[1]); if (start < stop) { range.setMin(start); range.setMax(stop); } else { range.setMin(stop); range.setMax(start); } return range; }  }
ModisUtils { public static Range getRangeFromString(String rangeString) { final Range range = new Range(); final String[] intStringArray = StringUtils.toStringArray(rangeString, ","); final int start = Integer.parseInt(intStringArray[0]); final int stop = Integer.parseInt(intStringArray[1]); if (start < stop) { range.setMin(start); range.setMax(stop); } else { range.setMin(stop); range.setMax(start); } return range; }  static String decodeBandName(String names, int layerIdx); static float[] decodeSpectralInformation(String bandExt, float[] recycle); static String extractValueForKey(String metaDataString, String key); static Date createDateFromStrings(final String date, final String time); static IncrementOffset getIncrementOffset(String attribute); static Range getRangeFromString(String rangeString); static String extractBandName(String variableName); }
ModisUtils { public static Range getRangeFromString(String rangeString) { final Range range = new Range(); final String[] intStringArray = StringUtils.toStringArray(rangeString, ","); final int start = Integer.parseInt(intStringArray[0]); final int stop = Integer.parseInt(intStringArray[1]); if (start < stop) { range.setMin(start); range.setMax(stop); } else { range.setMin(stop); range.setMax(start); } return range; }  static String decodeBandName(String names, int layerIdx); static float[] decodeSpectralInformation(String bandExt, float[] recycle); static String extractValueForKey(String metaDataString, String key); static Date createDateFromStrings(final String date, final String time); static IncrementOffset getIncrementOffset(String attribute); static Range getRangeFromString(String rangeString); static String extractBandName(String variableName);  }