@SuppressWarnings("unchecked") public <T extends DocumentLabel> ArrayList<T> getHumanLabels(Class<T> classFilter) { ArrayList<T> items = new ArrayList<T>(); for (DocumentLabel label : labels) { if (label.isHumanLabel() && classFilter.isAssignableFrom(label.getClass())) items.add((T) label); } return items; }
public void addLabel(DocumentLabel label) { labels.add(label); if (label.isHumanLabel()) humanLabelCount++; }