public SimpleFeatureType createSimpleFeatureType( Name name, List<AttributeDescriptor> schema, GeometryDescriptor defaultGeometry, boolean isAbstract, List<Filter> restrictions, AttributeType superType, InternationalString description) { return new SimpleFeatureTypeImpl( name, schema, defaultGeometry, isAbstract, restrictions, superType, description); } }
@SuppressWarnings("unchecked") public SimpleFeatureTypeImpl( Name name, List<AttributeDescriptor> schema, GeometryDescriptor defaultGeometry, boolean isAbstract, List<Filter> restrictions, AttributeType superType, InternationalString description) { // Note intentional circumvention of generics type checking; // this is only valid if schema is not modified. super( name, (List) schema, defaultGeometry, isAbstract, restrictions, superType, description); index = buildIndex(this); descriptors = buildDescriptorIndex(this); }
public int indexOf(Name name) { if (name.getNamespaceURI() == null) { return indexOf(name.getLocalPart()); } // otherwise do a full scan int index = 0; for (AttributeDescriptor descriptor : getAttributeDescriptors()) { if (descriptor.getName().equals(name)) { return index; } index++; } return -1; }
public AttributeDescriptor getDescriptor(int index) { return getAttributeDescriptors().get(index); }
public SimpleFeatureBuilder(SimpleFeatureType featureType, FeatureFactory factory) { super(featureType, factory); this.featureType = featureType; this.factory = factory; if (featureType instanceof SimpleFeatureTypeImpl) { index = ((SimpleFeatureTypeImpl) featureType).index; } else { this.index = SimpleFeatureTypeImpl.buildIndex(featureType); } reset(); }
public AttributeType getType(String name) { AttributeDescriptor attribute = (AttributeDescriptor) getDescriptor(name); if (attribute != null) { return attribute.getType(); } return null; }
public boolean equals(Object other) { if (other instanceof FeatureType) return super.equals((FeatureType) other); return false; }
public int getAttributeCount() { return getAttributeDescriptors().size(); }
} else { Map<String, Integer> generatedIndex = SimpleFeatureTypeImpl.buildIndex(featureType); featureType.getUserData().put("indexLookup", generatedIndex); return generatedIndex;
public AttributeType getType(Name name) { AttributeDescriptor attribute = (AttributeDescriptor) getDescriptor(name); if (attribute != null) { return attribute.getType(); } return null; }
new SimpleFeatureTypeImpl( new NameImpl( dataStore.getNamespace() == null
public int indexOf(Name name) { if(name.getNamespaceURI() == null) { return indexOf(name.getLocalPart()); } // otherwise do a full scan int index = 0; for (AttributeDescriptor descriptor : getAttributeDescriptors()) { if (descriptor.getName().equals(name)) { return index; } index++; } return -1; }
public List<AttributeType> getTypes() { if (types == null) { synchronized (this) { if (types == null) { ArrayList<AttributeType> temp = new ArrayList<AttributeType>(); for (AttributeDescriptor ad : getAttributeDescriptors()) { temp.add(ad.getType()); } types = temp; } } } return types; }
@SuppressWarnings("unchecked") public SimpleFeatureTypeImpl(Name name, List<AttributeDescriptor> schema, GeometryDescriptor defaultGeometry, boolean isAbstract, List<Filter> restrictions, AttributeType superType, InternationalString description) { // Note intentional circumvention of generics type checking; // this is only valid if schema is not modified. super(name, (List) schema, defaultGeometry, isAbstract, restrictions, superType, description); index = buildIndex(this); }
public AttributeType getType(Name name) { AttributeDescriptor attribute = (AttributeDescriptor) getDescriptor(name); if (attribute != null) { return attribute.getType(); } return null; }
public SimpleFeatureType createSimpleFeatureType(Name name, List<AttributeDescriptor> schema, GeometryDescriptor defaultGeometry, boolean isAbstract, List<Filter> restrictions, AttributeType superType, InternationalString description) { return new SimpleFeatureTypeImpl(name,schema,defaultGeometry,isAbstract, restrictions,superType,description); } }
public AttributeDescriptor getDescriptor(int index) { return getAttributeDescriptors().get(index); }
public SimpleFeatureBuilder(SimpleFeatureType featureType, FeatureFactory factory) { this.featureType = featureType; this.factory = factory; if(featureType instanceof SimpleFeatureTypeImpl) { index = ((SimpleFeatureTypeImpl) featureType).index; } else { this.index = SimpleFeatureTypeImpl.buildIndex(featureType); } reset(); }
public AttributeType getType(String name) { AttributeDescriptor attribute = (AttributeDescriptor) getDescriptor(name); if (attribute != null) { return attribute.getType(); } return null; }
@BeforeClass public static void setUpOnce() { List<AttributeDescriptor> schema = new ArrayList<AttributeDescriptor>(); schema.add( new AttributeDescriptorImpl( XSSchema.DOUBLE_TYPE, Types.typeName("pointOne"), 0, 1, false, null)); schema.add( new AttributeDescriptorImpl( XSSchema.DOUBLE_TYPE, Types.typeName("pointTwo"), 0, 1, false, null)); SimpleFeatureType type = new SimpleFeatureTypeImpl( Types.typeName("GeometryContainer"), schema, null, false, null, GMLSchema.ABSTRACTFEATURETYPE_TYPE, null); feature = SimpleFeatureBuilder.build(type, new Object[] {5.0, 2.5}, null); pointOne = ff.property("pointOne"); pointTwo = ff.property("pointTwo"); }