@Test public void testStringArrayToList() { DocumentAnnotation da = (DocumentAnnotation) jCas.getDocumentAnnotationFs(); StringArray rel = new StringArray(jCas, 3); rel.set(0, "ENG"); rel.set(1, "WAL"); rel.set(2, "SCO"); da.setDocumentReleasability(rel); Feature f = da.getType().getFeatureByBaseName(DOCUMENT_RELEASABILITY); List<Object> o = FeatureUtils.featureToList(f, da); assertEquals(3, o.size()); assertTrue(o.get(0) instanceof String); assertEquals("ENG", (String) o.get(0)); assertTrue(o.get(1) instanceof String); assertEquals("WAL", (String) o.get(1)); assertTrue(o.get(2) instanceof String); assertEquals("SCO", (String) o.get(2)); }
public static List<Object> featureToList(Feature f, Annotation a) { if (a.getFeatureValue(f) == null) { return Collections.emptyList(); } return Arrays.asList(toArray(f, a)); }
FeatureUtils { public static List<Object> featureToList(Feature f, Annotation a) { if (a.getFeatureValue(f) == null) { return Collections.emptyList(); } return Arrays.asList(toArray(f, a)); } }
FeatureUtils { public static List<Object> featureToList(Feature f, Annotation a) { if (a.getFeatureValue(f) == null) { return Collections.emptyList(); } return Arrays.asList(toArray(f, a)); } private  FeatureUtils(); }
FeatureUtils { public static List<Object> featureToList(Feature f, Annotation a) { if (a.getFeatureValue(f) == null) { return Collections.emptyList(); } return Arrays.asList(toArray(f, a)); } private  FeatureUtils(); static Object featureToObject(Feature f, Annotation a); static Object[] featureToArray(Feature f, Annotation a); static List<Object> featureToList(Feature f, Annotation a); }
FeatureUtils { public static List<Object> featureToList(Feature f, Annotation a) { if (a.getFeatureValue(f) == null) { return Collections.emptyList(); } return Arrays.asList(toArray(f, a)); } private  FeatureUtils(); static Object featureToObject(Feature f, Annotation a); static Object[] featureToArray(Feature f, Annotation a); static List<Object> featureToList(Feature f, Annotation a);  }