public static void assertValues(Vec v, String[] expValues) { Assert.assertEquals("Number of rows", expValues.length, v.length()); BufferedString tmpStr = new BufferedString(); for (int i = 0; i < v.length(); i++) { if (v.isNA(i)) Assert.assertEquals("NAs should match", null, expValues[i]); else Assert.assertEquals("Values should match", expValues[i], v.atStr(tmpStr, i).toString()); } }
public static String[] collectS(Vec v) { String[] res = new String[(int) v.length()]; BufferedString tmpStr = new BufferedString(); for (int i = 0; i < v.length(); i++) res[i] = v.isNA(i) ? null : v.atStr(tmpStr, i).toString(); return res; }