defaultfeature.html
来自「Geotools是一个开源的Java GIS工具包,可利用它来开发符合标准的地理」· HTML 代码 · 共 921 行 · 第 1/4 页
HTML
921 行
<PRE>protected <B>DefaultFeature</B>(<A HREF="../../../org/geotools/feature/DefaultFeatureType.html" title="class in org.geotools.feature">DefaultFeatureType</A> schema, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>[] attributes) throws <A HREF="../../../org/geotools/feature/IllegalAttributeException.html" title="class in org.geotools.feature">IllegalAttributeException</A></PRE><DL><DD>Creates a new instance of flat feature, which must take a flat feature type schema and all attributes as arguments.<P><DT><B>Parameters:</B><DD><CODE>schema</CODE> - Feature type schema for this flat feature.<DD><CODE>attributes</CODE> - Initial attributes for this feature.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/geotools/feature/IllegalAttributeException.html" title="class in org.geotools.feature">IllegalAttributeException</A></CODE> - Attribtues do not conform to feature type schema.<DT><B>'TODO:'</B></DT> <DD>REVISIT: should we allow this? Force users to explicitly set featureID to null?</DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getFeatureType()"><!-- --></A><H3>getFeatureType</H3><PRE>public <A HREF="../../../org/geotools/feature/FeatureType.html" title="interface in org.geotools.feature">FeatureType</A> <B>getFeatureType</B>()</PRE><DL><DD>Gets a reference to the feature type schema for this feature.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/feature/SimpleFeature.html#getFeatureType()">getFeatureType</A></CODE> in interface <CODE><A HREF="../../../org/geotools/feature/SimpleFeature.html" title="interface in org.geotools.feature">SimpleFeature</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>A copy of this feature's metadata in the form of a feature type schema.</DL></DD></DL><HR><A NAME="getID()"><!-- --></A><H3>getID</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getID</B>()</PRE><DL><DD>Gets the unique indentification string of this Feature.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/feature/Feature.html#getID()">getID</A></CODE> in interface <CODE><A HREF="../../../org/geotools/feature/Feature.html" title="interface in org.geotools.feature">Feature</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>The unique id.</DL></DD></DL><HR><A NAME="getAttributes(java.lang.Object[])"><!-- --></A><H3>getAttributes</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>[] <B>getAttributes</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>[] array)</PRE><DL><DD>Copy all the attributes of this Feature into the given array. If the argument array is null, a new one will be created. Gets all attributes from this feature, returned as a complex object array. This array comes with no metadata, so to interpret this collection the caller class should ask for the schema as well.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/feature/Feature.html#getAttributes(java.lang.Object[])">getAttributes</A></CODE> in interface <CODE><A HREF="../../../org/geotools/feature/Feature.html" title="interface in org.geotools.feature">Feature</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>array</CODE> - The array to copy the attributes into.<DT><B>Returns:</B><DD>The array passed in, or a new one if null.</DL></DD></DL><HR><A NAME="getAttribute(java.lang.String)"><!-- --></A><H3>getAttribute</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getAttribute</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> xPath)</PRE><DL><DD>Gets an attribute for this feature at the location specified by xPath.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/feature/SimpleFeature.html#getAttribute(java.lang.String)">getAttribute</A></CODE> in interface <CODE><A HREF="../../../org/geotools/feature/SimpleFeature.html" title="interface in org.geotools.feature">SimpleFeature</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>xPath</CODE> - XPath representation of attribute location.<DT><B>Returns:</B><DD>Attribute.<DT><B>See Also:</B><DD><A HREF="../../../org/geotools/feature/Feature.html#getAttribute(java.lang.String)"><CODE>Feature.getAttribute(String)</CODE></A></DL></DD></DL><HR><A NAME="getAttribute(int)"><!-- --></A><H3>getAttribute</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getAttribute</B>(int index)</PRE><DL><DD>Gets an attribute by the given zero-based index.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/feature/SimpleFeature.html#getAttribute(int)">getAttribute</A></CODE> in interface <CODE><A HREF="../../../org/geotools/feature/SimpleFeature.html" title="interface in org.geotools.feature">SimpleFeature</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the position of the attribute to retrieve.<DT><B>Returns:</B><DD>The attribute at the given index.</DL></DD></DL><HR><A NAME="setAttribute(int, java.lang.Object)"><!-- --></A><H3>setAttribute</H3><PRE>public void <B>setAttribute</B>(int position, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> val) throws <A HREF="../../../org/geotools/feature/IllegalAttributeException.html" title="class in org.geotools.feature">IllegalAttributeException</A></PRE><DL><DD>Sets the attribute at position to val.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/feature/SimpleFeature.html#setAttribute(int, java.lang.Object)">setAttribute</A></CODE> in interface <CODE><A HREF="../../../org/geotools/feature/SimpleFeature.html" title="interface in org.geotools.feature">SimpleFeature</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>position</CODE> - the index of the attribute to set.<DD><CODE>val</CODE> - the new value to give the attribute at position.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/geotools/feature/IllegalAttributeException.html" title="class in org.geotools.feature">IllegalAttributeException</A></CODE> - if the passed in val does not validate against the AttributeType at that position.</DL></DD></DL><HR><A NAME="setAttributeValue(int, java.lang.Object)"><!-- --></A><H3>setAttributeValue</H3><PRE>protected void <B>setAttributeValue</B>(int position, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> val)</PRE><DL><DD>Sets the attribute value at a given position, performing no parsing or validation. This is so subclasses can have access to setting the array, without opening it up completely.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>position</CODE> - the index of the attribute to set.<DD><CODE>val</CODE> - the new value to give the attribute at position.</DL></DD></DL><HR><A NAME="setAttributes(java.lang.Object[])"><!-- --></A><H3>setAttributes</H3><PRE>public void <B>setAttributes</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>[] attributes) throws <A HREF="../../../org/geotools/feature/IllegalAttributeException.html" title="class in org.geotools.feature">IllegalAttributeException</A></PRE><DL><DD>Sets all attributes for this feature, passed as an array. All attributes are checked for validity before adding.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/feature/SimpleFeature.html#setAttributes(java.lang.Object[])">setAttributes</A></CODE> in interface <CODE><A HREF="../../../org/geotools/feature/SimpleFeature.html" title="interface in org.geotools.feature">SimpleFeature</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attributes</CODE> - All feature attributes.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/geotools/feature/IllegalAttributeException.html" title="class in org.geotools.feature">IllegalAttributeException</A></CODE> - Passed attributes do not match feature type.</DL></DD></DL><HR><A NAME="setAttribute(java.lang.String, java.lang.Object)"><!-- --></A><H3>setAttribute</H3><PRE>public void <B>setAttribute</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> xPath, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> attribute) throws <A HREF="../../../org/geotools/feature/IllegalAttributeException.html" title="class in org.geotools.feature">IllegalAttributeException</A></PRE><DL><DD>Sets a single attribute for this feature, passed as a complex object. If the attribute does not exist or the object does not conform to the internal feature type, an exception is thrown.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/feature/Feature.html#setAttribute(java.lang.String, java.lang.Object)">setAttribute</A></CODE> in interface <CODE><A HREF="../../../org/geotools/feature/Feature.html" title="interface in org.geotools.feature">Feature</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>xPath</CODE> - XPath representation of attribute location.<DD><CODE>attribute</CODE> - Feature attribute to set.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/geotools/feature/IllegalAttributeException.html" title="class in org.geotools.feature">IllegalAttributeException</A></CODE> - Passed attribute does not match feature type</DL></DD></DL><HR><A NAME="getDefaultGeometry()"><!-- --></A><H3>getDefaultGeometry</H3><PRE>public <A HREF="http://www.jump-project.org/docs/jts/1.7/api/com/vividsolutions/jts/geom/Geometry.html" title="class or interface in com.vividsolutions.jts.geom">Geometry</A> <B>getDefaultGeometry</B>()</PRE><DL><DD>Gets the geometry for this feature.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/feature/Feature.html#getDefaultGeometry()">getDefaultGeometry</A></CODE> in interface <CODE><A HREF="../../../org/geotools/feature/Feature.html" title="interface in org.geotools.feature">Feature</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>Geometry for this feature.</DL></DD></DL><HR><A NAME="setDefaultGeometry(com.vividsolutions.jts.geom.Geometry)"><!-- --></A><H3>setDefaultGeometry</H3><PRE>public void <B>setDefaultGeometry</B>(<A HREF="http://www.jump-project.org/docs/jts/1.7/api/com/vividsolutions/jts/geom/Geometry.html" title="class or interface in com.vividsolutions.jts.geom">Geometry</A> geometry) throws <A HREF="../../../org/geotools/feature/IllegalAttributeException.html" title="class in org.geotools.feature">IllegalAttributeException</A></PRE><DL><DD>Modifies the geometry.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/feature/Feature.html#setDefaultGeometry(com.vividsolutions.jts.geom.Geometry)">setDefaultGeometry</A></CODE> in interface <CODE><A HREF="../../../org/geotools/feature/Feature.html" title="interface in org.geotools.feature">Feature</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>geometry</CODE> - All feature attributes.<DT><B>Throws:</B>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?