Пример #1
0
  @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;
  }
Пример #2
0
  public void addLabel(DocumentLabel label) {
    labels.add(label);

    if (label.isHumanLabel()) humanLabelCount++;
  }