public Object get(Object object, String xpath, Class target) { Feature feature = (Feature) object; return feature.getID(); }
public boolean add( Object o ) { Feature feature = (Feature) o; contents.put( feature.getID(), feature ); return true; }
protected Attributes encodeFeatureId( Feature f ) { AttributesImpl fidAtts = new org.xml.sax.helpers.AttributesImpl(); String fid = f.getID(); if (fid != null) { fidAtts.addAttribute("", "fid", "fid", "fids", fid); } return fidAtts; }
protected void queryModified() { while( modifiedIterator.hasNext() && next == null ){ next = (Feature) modifiedIterator.next(); if( next==TransactionStateDiff.NULL || encounteredFids.contains(next.getID()) || !filter.evaluate(next) ){ next = null; } } }
public int indexOf( Object o ) { Feature feature = (Feature) o; return index().indexOf( feature.getID() ); } public int lastIndexOf( Object o ) {
public int lastIndexOf( Object o ) { Feature feature = (Feature) o; return index().lastIndexOf( feature.getID() ); } public ListIterator listIterator() {
public boolean matches(Object object) { if ( object instanceof Feature ) { return matches( (Feature) object ); } if ( object instanceof org.geotools.feature.Feature ) { return fid.equals( ( (org.geotools.feature.Feature) object ).getID() ); } return false; }
protected void querySpatialIndex() { while( spatialIndexIterator.hasNext() && next == null ){ Feature f = (Feature) spatialIndexIterator.next(); if( encounteredFids.contains(f.getID()) || !filter.evaluate(f)){ continue; } next = f; } }
protected void queryAdded() { while( addedIterator.hasNext() && next == null ){ next = (Feature) addedIterator.next(); if( encounteredFids.contains(next.getID()) || !filter.evaluate(next)){ next = null; } } }
public void setAttribute(int position, Object val) throws IllegalAttributeException, ArrayIndexOutOfBoundsException { if(position == 0 && val instanceof List){ List nw = (List)val; if( !FeatureState.isFeatures( nw )) return; contents.clear(); for( Iterator i = nw.iterator(); i.hasNext(); ){ Feature feature = (Feature) i.next(); contents.put( feature.getID(), feature ); } fireChange(nw,0); } }
public Object getProperty(Object object, String property) { Feature feature = (Feature) object; Object value = feature.getAttribute(property(property)); if (value != null) { return value; } //check additional properties if ("fid".equals(property) || property.matches("(\\w+:)?id")) { return feature.getID(); } return null; }
public Object getProperty(Object object, String property) { Feature feature = (Feature) object; Object value = feature.getAttribute( property( property ) ); if ( value != null ) { return value; } //check additional properties if ( "fid".equals( property ) || property.matches( "(\\w+:)?id" ) ) { return feature.getID(); } return null; }
public Element encode(Object object, Document document, Element value) throws Exception { Feature feature = (Feature) object; FeatureType featureType = feature.getFeatureType(); String namespace = featureType.getNamespace().toString(); String typeName = featureType.getTypeName(); Element encoding = document.createElementNS(namespace, typeName); encoding.setAttributeNS(GML.NAMESPACE, "id", feature.getID()); return encoding; }
public void write() throws IOException { if (live != null) { assertAccess(typeName, live.getID(), transaction); } writer.write(); live = null; }
public void remove() throws IOException { if (live != null) { assertAccess(typeName, live.getID(), transaction); } writer.remove(); live = null; }
private void writeImplementation( Feature f ) throws IOException{ writer.next(); writer.writeFeatureID( f.getID() ); for( int i=0; i<f.getNumberOfAttributes(); i++){ writer.write( i, f.getAttribute( i )); } } public Feature next() throws IOException {
private void writeImplementation( Feature f ) throws IOException{ writer.next(); writer.writeFeatureID( f.getID() ); for( int i=0; i<f.getNumberOfAttributes(); i++){ writer.write( i, f.getAttribute( i )); } } public Feature next() throws IOException {
public Feature next() throws IOException, IllegalAttributeException, NoSuchElementException { Feature feature = wrapped.next(); FeatureType featureType = wrapped.getFeatureType(); String id = feature.getID(); return featureType.create(feature .getAttributes(new Object[featureType.getAttributeCount()]), fidMapper .getUnversionedFid(id)); } }
void assertCovers(String msg, FeatureCollection c1, FeatureCollection c2) { if (c1 == c2) { return; } assertNotNull(msg, c1); assertNotNull(msg, c2); assertEquals(msg + " size", c1.size(), c2.size()); Feature f; for (FeatureIterator i = c1.features(); i.hasNext();) { f = i.next(); assertTrue(msg + " " + f.getID(), containsFeatureCollection(c2, f)); //c2.contains(f)); } }