@Override public NavigableMap<String, Collection<String>> create(Object... elements) { TreeMultimap<String, String> multimap = TreeMultimap.create(); for (Object o : elements) { @SuppressWarnings("unchecked") Entry<String, Collection<String>> entry = (Entry<String, Collection<String>>) o; checkArgument(!multimap.containsKey(entry.getKey())); multimap.putAll(entry.getKey(), entry.getValue()); } return multimap.asMap(); }
/*** * Check if this token is part of a tag with the specified descriptor. * @param descriptor * @return */ public boolean containsType(String descriptor) { return this.sentence.typeLookup.get(this.index).containsKey(descriptor); }
protected SortedSet<Integer> removeContainer(int containerId) { Preconditions.checkArgument(containerToElement.containsKey(containerId), "Container %s doesn't exists", containerId); SortedSet<Integer> removedElements = containerToElement.removeAll(containerId); final C container = containers.remove(containerId); observer.onContainerRemoved(containerId, container); for (Integer elementId : removedElements) { final E element = elements.remove(elementId); elementToContainer.remove(elementId); observer.onElementRemoved(containerId, container, elementId, element); } return removedElements; }
if (filters.containsKey(t)) { return true;
@Override public NavigableMap<String, Collection<String>> create(Object... elements) { TreeMultimap<String, String> multimap = TreeMultimap.create(); for (Object o : elements) { @SuppressWarnings("unchecked") Entry<String, Collection<String>> entry = (Entry<String, Collection<String>>) o; checkArgument(!multimap.containsKey(entry.getKey())); multimap.putAll(entry.getKey(), entry.getValue()); } return multimap.asMap(); }