com.google.common.collect.UnmodifiableListIterator Java Examples

The following examples show how to use com.google.common.collect.UnmodifiableListIterator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MixinMultiMap.java    From Hyperium with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * @author FalseHonesty
 * @reason ChatTriggers
 */
@Overwrite
public <S> Iterable<S> getByClass(final Class<S> clazz) {
    return () -> {
        List<T> list = map.get(initializeClassLookup(clazz));

        if (list == null) {
            return (UnmodifiableListIterator<S>) Utils.EMPTY_ITERATOR;
        } else {
            Iterator<T> iterator = list.iterator();
            return Iterators.filter(iterator, clazz);
        }
    };
}
 
Example #2
Source File: MixinMultiMap.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * @author FalseHonesty
 * @reason ChatTriggers
 */
@Overwrite
public Iterator<T> iterator() {
    return values.isEmpty() ? (UnmodifiableListIterator<T>) Utils.EMPTY_ITERATOR : Iterators.unmodifiableIterator(values.iterator());
}