From Charlie: fixed bug in size() and some hygeine.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2608 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -276,6 +276,7 @@ public abstract class Predicate<T>
|
||||
// oh god, oh god: we iterate and count
|
||||
int size = 0;
|
||||
for (Iterator<E> iter = iterator(); iter.hasNext(); ) {
|
||||
iter.next();
|
||||
size++;
|
||||
}
|
||||
return size;
|
||||
@@ -313,14 +314,14 @@ public abstract class Predicate<T>
|
||||
|
||||
/** A shared predicate instance that always matches its input. */
|
||||
protected static final Predicate<Object> TRUE_INSTANCE = new Predicate<Object>() {
|
||||
public boolean isMatch (Object object) {
|
||||
@Override public boolean isMatch (Object object) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/** A shared predicate instance that never matches its input. */
|
||||
protected static final Predicate<Object> FALSE_INSTANCE = new Predicate<Object>() {
|
||||
public boolean isMatch (Object object) {
|
||||
@Override public boolean isMatch (Object object) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user