public boolean hasNext() throws IOException {
if (!entityIterator.hasNext()) {
return false;
} else {
Geometry g = null;
DXFEntity entry = null;
try {
entry = null;
boolean passedFilter = false;
do {
entry = (DXFEntity) entityIterator.next();
passedFilter = passedFilter(entry);
} while (!passedFilter && entityIterator.hasNext());
if (passedFilter) {
g = entry.getGeometry();
cache = SimpleFeatureBuilder.build(ft, new Object[]{
g,
entry.getName(),
entry.getKey(),
entry.getUrlLink(),
entry.getLineTypeName(),
entry.getColorRGB(),
entry.getRefLayerName(),
new Double(entry.getThickness()),
((entry instanceof DXFText) ? new Double(((DXFText) entry)._rotation) : new Double(0.0)), // Text rotation
new Integer(entry.isVisible() ? 1 : 0),
new Integer(entry.getStartingLineNumber()),
new Integer(entry.isParseError() ? 1 : 0),
entry.getErrorDescription(),
DXFExtendedData.toMap(entry.getExtendedData())
}, Integer.toString(featureID++));
return true;
} else {
// No next features found
return false;
}
} catch (IllegalAttributeException ex) {
log.error(ex.getLocalizedMessage() + "\n" + entry.getErrorDescription());
return false;
}
}
}