public Property getProperty(String name) { final Integer idx = index.get(name); if (idx == null) { return null; } else { int index = idx.intValue(); AttributeDescriptor descriptor = featureType.getDescriptor(index); if (descriptor instanceof GeometryDescriptor) { return new GeometryAttributeImpl( values[index], (GeometryDescriptor) descriptor, null); } else { return new Attribute(index); } } }
public String toString() { StringBuffer sb = new StringBuffer("SimpleFeatureImpl.Attribute: "); sb.append(getDescriptor().getName().getLocalPart()); if (!getDescriptor() .getName() .getLocalPart() .equals(getDescriptor().getType().getName().getLocalPart()) || id != null) { sb.append("<"); sb.append(getDescriptor().getType().getName().getLocalPart()); if (id != null) { sb.append(" id="); sb.append(id); } sb.append(">"); } sb.append("="); sb.append(values[index]); return sb.toString(); } }
/** * Override of hashCode; uses descriptor name to agree with AttributeImpl * * @return hashCode for this object. */ public int hashCode() { return 37 * getDescriptor().hashCode() + (37 * (getValue() == null ? 0 : getValue().hashCode())); }
/** * Override of equals. * * @param other * the object to be tested for equality. * * @return whether other is equal to this attribute Type. */ public boolean equals(Object obj) { if ( this == obj ) { return true; } if (!(obj instanceof Attribute)) { return false; } Attribute other = (Attribute) obj; if (!Utilities.equals(getDescriptor(), other.getDescriptor())){ return false; } if (!Utilities.deepEquals(getValue(), other.getValue())){ return false; } return Utilities.equals( getIdentifier(), other.getIdentifier()); }
public String toString() { StringBuffer sb = new StringBuffer("SimpleFeatureImpl.Attribute: "); sb.append(getDescriptor().getName().getLocalPart()); if (!getDescriptor().getName().getLocalPart().equals( getDescriptor().getType().getName().getLocalPart()) || id != null) { sb.append("<"); sb.append(getDescriptor().getType().getName().getLocalPart()); if (id != null) { sb.append(" id="); sb.append(id); } sb.append(">"); } sb.append("="); sb.append( values[index] ); return sb.toString(); } }
public boolean isNillable() { return getDescriptor().isNillable(); }
public Name getName() { return getDescriptor().getName(); }
public Property getProperty(String name) { final Integer idx = index.get(name); if(idx == null){ return null; } else { int index = idx.intValue(); AttributeDescriptor descriptor = featureType.getDescriptor(index); if(descriptor instanceof GeometryDescriptor){ return new GeometryAttributeImpl(values[index], (GeometryDescriptor) descriptor, null); }else{ return new Attribute( index ); } } }
public void validate() { Types.validate(getDescriptor(), values[index]); }
@Override public int hashCode() { return 17 * super.hashCode(); }
@Override public GeometryDescriptor getDescriptor() { return (GeometryDescriptor) super.getDescriptor(); }
@Override public GeometryType getType() { return (GeometryType) super.getType(); }
public Property get(int index) { AttributeDescriptor descriptor = featureType.getDescriptor(index); if (descriptor instanceof GeometryDescriptor) { return new SimpleGeometryAttribute(index); } return new Attribute(index); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof SimpleGeometryAttribute)) { return false; } return super.equals(obj); } }
public Collection<Property> getProperties(String name) { final Integer idx = index.get(name); if(idx != null) { // cast temporarily to a plain collection to avoid type problems with generics Collection c = Collections.singleton( new Attribute( idx ) ); return c; } else { return Collections.emptyList(); } }
/** * Override of hashCode; uses descriptor name to agree with AttributeImpl * * @return hashCode for this object. */ public int hashCode() { return 37 * getDescriptor().hashCode() + (37 * (getValue() == null ? 0 : getValue().hashCode())); }
/** * Override of equals. * * @param other the object to be tested for equality. * @return whether other is equal to this attribute Type. */ public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof Attribute)) { return false; } Attribute other = (Attribute) obj; if (!Utilities.equals(getDescriptor(), other.getDescriptor())) { return false; } if (!Utilities.deepEquals(getValue(), other.getValue())) { return false; } return Utilities.equals(getIdentifier(), other.getIdentifier()); }
public boolean isNillable() { return getDescriptor().isNillable(); }
public Name getName() { return getDescriptor().getName(); }
public void validate() { Types.validate(getDescriptor(), values[index]); }