import java.util.*;
/**
* Created by IntelliJ IDEA.
* User: me
* Date: 11.09.2006
* Time: 15:21:14
* To change this template use File | Settings | File Templates.
*/
public class ShortStrings
implements Iterator { private final int maxLen;
public ShortStrings
(Iterator strings,
int maxLen
) { this.strings = strings;
this.nextShort = null;
this.maxLen = maxLen;
}
public boolean hasNext() {
if (nextShort != null)
return true;
while (strings.hasNext()) {
nextShort =
(String) strings.
next();
if (nextShort.length() <= maxLen)
return true;
}
nextShort = null;
return false;
}
if (nextShort == null && !hasNext())
nextShort = null;
return n;
}
public void remove() {
}
}