@Test public void testOneDimArrayStr() { Variable var = dataset.findVariable("SHAPE_Leng"); String str = CFSimpleGeometryHelper.getSubsetString(var, 0); Assert.assertEquals("0", str); }
public static String getSubsetString(Variable var, int beginInd, int endInd, int id) { if (var == null) return null; String subStr = ""; List<Dimension> dimList = var.getDimensions(); if (dimList.size() > 2 || dimList.size() < 1) { return null; } for (int i = 0; i < dimList.size(); i++) { Dimension dim = dimList.get(i); if (dim == null) continue; if (!CF.TIME.equalsIgnoreCase(dim.getShortName())) { subStr += id; } else { if (beginInd < 0 || endInd < 0) subStr += ":"; else subStr += (beginInd + ":" + endInd); } if (i < dimList.size() - 1) { subStr += ","; } } return subStr; }
CFSimpleGeometryHelper { public static String getSubsetString(Variable var, int beginInd, int endInd, int id) { if (var == null) return null; String subStr = ""; List<Dimension> dimList = var.getDimensions(); if (dimList.size() > 2 || dimList.size() < 1) { return null; } for (int i = 0; i < dimList.size(); i++) { Dimension dim = dimList.get(i); if (dim == null) continue; if (!CF.TIME.equalsIgnoreCase(dim.getShortName())) { subStr += id; } else { if (beginInd < 0 || endInd < 0) subStr += ":"; else subStr += (beginInd + ":" + endInd); } if (i < dimList.size() - 1) { subStr += ","; } } return subStr; } }
CFSimpleGeometryHelper { public static String getSubsetString(Variable var, int beginInd, int endInd, int id) { if (var == null) return null; String subStr = ""; List<Dimension> dimList = var.getDimensions(); if (dimList.size() > 2 || dimList.size() < 1) { return null; } for (int i = 0; i < dimList.size(); i++) { Dimension dim = dimList.get(i); if (dim == null) continue; if (!CF.TIME.equalsIgnoreCase(dim.getShortName())) { subStr += id; } else { if (beginInd < 0 || endInd < 0) subStr += ":"; else subStr += (beginInd + ":" + endInd); } if (i < dimList.size() - 1) { subStr += ","; } } return subStr; }  }
CFSimpleGeometryHelper { public static String getSubsetString(Variable var, int beginInd, int endInd, int id) { if (var == null) return null; String subStr = ""; List<Dimension> dimList = var.getDimensions(); if (dimList.size() > 2 || dimList.size() < 1) { return null; } for (int i = 0; i < dimList.size(); i++) { Dimension dim = dimList.get(i); if (dim == null) continue; if (!CF.TIME.equalsIgnoreCase(dim.getShortName())) { subStr += id; } else { if (beginInd < 0 || endInd < 0) subStr += ":"; else subStr += (beginInd + ":" + endInd); } if (i < dimList.size() - 1) { subStr += ","; } } return subStr; }  static String getSubsetString(Variable var, int beginInd, int endInd, int id); static String getSubsetString(Variable var, int id); }
CFSimpleGeometryHelper { public static String getSubsetString(Variable var, int beginInd, int endInd, int id) { if (var == null) return null; String subStr = ""; List<Dimension> dimList = var.getDimensions(); if (dimList.size() > 2 || dimList.size() < 1) { return null; } for (int i = 0; i < dimList.size(); i++) { Dimension dim = dimList.get(i); if (dim == null) continue; if (!CF.TIME.equalsIgnoreCase(dim.getShortName())) { subStr += id; } else { if (beginInd < 0 || endInd < 0) subStr += ":"; else subStr += (beginInd + ":" + endInd); } if (i < dimList.size() - 1) { subStr += ","; } } return subStr; }  static String getSubsetString(Variable var, int beginInd, int endInd, int id); static String getSubsetString(Variable var, int id);  }