net.dongliu.commons.collection.EmptyRange Maven / Gradle / Ivy
package net.dongliu.commons.collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Stream;
/**
* Empty range impl
*
* @author Liu Dong
*/
class EmptyRange implements Range {
static final EmptyRange instance = new EmptyRange();
private EmptyRange() {
}
@Override
public Range reverse() {
return this;
}
@Override
public Range endClosed(boolean endClosed) {
return this;
}
@Override
public Range step(int step) {
return this;
}
@Override
public boolean contains(Object value) {
return false;
}
@Override
public long count() {
return 0;
}
@Override
public List toList() {
return Lists.of();
}
@Override
public Stream stream() {
return Stream.empty();
}
@Override
public Iterator iterator() {
return Collections.emptyIterator();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy