/** * {@inheritDoc} */ @Override public EntityContainer createContainer(Bound entity) { return new BoundContainer(entity); } }
/** * {@inheritDoc} */ @Override public void process(BoundContainer boundContainer) { Bound newBound; /* * The order of calling intersect is important because the first non-empty origin string * will be used for the resulting Bound, and we want the origin string from the pipeline * Bound to be used. */ newBound = boundContainer.getEntity().intersect(bound); // intersect will return null if there is no overlapping area if (newBound != null) { // Send on a bound element clipped to the area super.process(new BoundContainer(newBound)); } }
@Override public void process(BoundContainer bound) { // Specialcase this. Assume we only ever get one contigious bound // request. switchTypes(); processBounds(bound.getEntity()); }
/** * {@inheritDoc} */ public void process(BoundContainer bound) { if (boundWritten) { throw new OsmosisRuntimeException("Bound element already written and only one allowed."); } if (entitiesWritten) { throw new OsmosisRuntimeException("Can't write bound element after other entities."); } boundWriter.process(bound.getEntity()); boundWritten = true; } }
/** * {@inheritDoc} */ @Override public EntityContainer createContainer(Bound entity) { return new BoundContainer(entity); } }
/** * {@inheritDoc} */ @Override public void process(BoundContainer boundContainer) { Bound newBound; /* * The order of calling intersect is important because the first non-empty origin string * will be used for the resulting Bound, and we want the origin string from the pipeline * Bound to be used. */ newBound = boundContainer.getEntity().intersect(bound); // intersect will return null if there is no overlapping area if (newBound != null) { // Send on a bound element clipped to the area super.process(new BoundContainer(newBound)); } }
/** * {@inheritDoc} */ public void process(BoundContainer bound) { if (boundWritten) { throw new OsmosisRuntimeException("Bound element already written and only one allowed."); } if (entitiesWritten) { throw new OsmosisRuntimeException("Can't write bound element after other entities."); } boundWriter.process(bound.getEntity()); boundWritten = true; } }
/** * {@inheritDoc} */ @Override public BoundContainer next() { return new BoundContainer(source.next()); }
/** * {@inheritDoc} */ @Override public void process(BoundContainer boundContainer) { Bound newBound = null; // Configure the area if it hasn't been created yet. (Should this be in an "initialize" method?) if (area == null) { area = new PolygonFileReader(polygonFile).loadPolygon(); } for (Bound b : boundContainer.getEntity().toSimpleBound()) { if (newBound == null) { newBound = simpleBoundIntersect(b); } else { newBound = newBound.union(simpleBoundIntersect(b)); } } if (newBound != null) { super.process(new BoundContainer(newBound)); } }
/** * {@inheritDoc} */ @Override public BoundContainer next() { return new BoundContainer(source.next()); }
/** * {@inheritDoc} */ @Override public void process(BoundContainer boundContainer) { Bound newBound = null; // Configure the area if it hasn't been created yet. (Should this be in an "initialize" method?) if (area == null) { area = new PolygonFileReader(polygonFile).loadPolygon(); } for (Bound b : boundContainer.getEntity().toSimpleBound()) { if (newBound == null) { newBound = simpleBoundIntersect(b); } else { newBound = newBound.union(simpleBoundIntersect(b)); } } if (newBound != null) { super.process(new BoundContainer(newBound)); } }
/** * {@inheritDoc} */ @Override public void end() { getSink().process(new BoundContainer(bound)); bound = null; }
/** * {@inheritDoc} */ @Override public BoundContainer getWriteableInstance() { if (bound.isReadOnly()) { return new BoundContainer(bound.getWriteableInstance()); } else { return this; } } }
/** * {@inheritDoc} */ @Override public void end() { getSink().process(new BoundContainer(bound)); bound = null; }
/** * {@inheritDoc} */ @Override public void end() { getSink().process(new BoundContainer(bound)); bound = null; }
/** * {@inheritDoc} */ @Override public void end() { getSink().process(new BoundContainer(bound)); bound = null; }
/** * {@inheritDoc} */ @Override public BoundContainer getWriteableInstance() { if (bound.isReadOnly()) { return new BoundContainer(bound.getWriteableInstance()); } else { return this; } } }
private void processFirstEntity(EntityContainer entityContainer) { if (entityContainer.getEntity().getType() == EntityType.Bound) { if (newBound == null) { // Just returning won't pass the entity downstream return; } else { sink.process(new BoundContainer(newBound)); } } else { if (newBound != null) { sink.process(new BoundContainer(newBound)); } sink.process(entityContainer); } }
private void processFirstEntity(EntityContainer entityContainer) { if (entityContainer.getEntity().getType() == EntityType.Bound) { if (newBound == null) { // Just returning won't pass the entity downstream return; } else { sink.process(new BoundContainer(newBound)); } } else { if (newBound != null) { sink.process(new BoundContainer(newBound)); } sink.process(entityContainer); } }
&& reader.getLocalName().equals(ELEMENT_NAME_BOUND)) { LOG.fine("Legacy <bound> element encountered."); sink.process(new BoundContainer(readBound())); sink.process(new BoundContainer(readBounds(generator)));