featuretype.html
来自「Geotools是一个开源的Java GIS工具包,可利用它来开发符合标准的地理」· HTML 代码 · 共 989 行 · 第 1/4 页
HTML
989 行
<DT><B>Returns:</B><DD>Namespace of schema</DL></DD></DL><HR><A NAME="getTypeName()"><!-- --></A><H3>getTypeName</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>getTypeName</B>()</PRE><DL><DD>Gets the type name for this schema. <p> In GML this must be the element name of the Feature. </p><P><DD><DL><DT><B>Returns:</B><DD>The name of this feature type.</DL></DD></DL><HR><A NAME="isDescendedFrom(java.net.URI, java.lang.String)"><!-- --></A><H3>isDescendedFrom</H3><PRE>public boolean <B>isDescendedFrom</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/net/URI.html" title="class or interface in java.net">URI</A> nsURI, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> typeName)</PRE><DL><DD>Test to determine whether this FeatureType is descended from the given FeatureType. Think of this relationship likes the "extends" relationship in java.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>nsURI</CODE> - The namespace URI to use.<DD><CODE>typeName</CODE> - The typeName.<DT><B>Returns:</B><DD>true if descendant, false otherwise.</DL></DD></DL><HR><A NAME="isDescendedFrom(org.geotools.feature.FeatureType)"><!-- --></A><H3>isDescendedFrom</H3><PRE>public boolean <B>isDescendedFrom</B>(<A HREF="../../../org/geotools/feature/FeatureType.html" title="interface in org.geotools.feature">FeatureType</A> type)</PRE><DL><DD>A convenience method for calling <br> <code><pre> FeatureType f1; FeatureType f2; f1.isDescendedFrom(f2.getNamespace(), f2.getName()); </pre></code> <p> Question: this method duplicates the information provided by getAncestors(). </p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>type</CODE> - The type to compare to.<DT><B>Returns:</B><DD>true if descendant, false otherwise.</DL></DD></DL><HR><A NAME="isAbstract()"><!-- --></A><H3>isAbstract</H3><PRE>public boolean <B>isAbstract</B>()</PRE><DL><DD>Is this FeatureType an abstract type? <p> When true is returned instances of this Feature cannot be created, instead a child FeatureType must use this FeatureType as its ancestor. </p><P><DD><DL><DT><B>Returns:</B><DD>true if abstract, false otherwise.</DL></DD></DL><HR><A NAME="getAncestors()"><!-- --></A><H3>getAncestors</H3><PRE>public <A HREF="../../../org/geotools/feature/FeatureType.html" title="interface in org.geotools.feature">FeatureType</A>[] <B>getAncestors</B>()</PRE><DL><DD>Obtain an array of this FeatureType's direct ancestors. Implementors should return a non-null array (may be of length 0). <p> <ul> <li>length 0 - a root FeatureType <li>length 1 - singe inhieratance <li>length 1+ - multiple inheiratance, order is not significant </ul> </p> GetAncestors() indicates *just* the direct parents of this FeatureType. It capures the inheirtance relationship from the OGC overview document. </p> <p> Example Code:<pre><code> public FeatureType getAncestors()} return new FeatureType[]{ getSuper(), }; } </code></pre> </p><P><DD><DL><DT><B>Returns:</B><DD>An array of ancestors.</DL></DD></DL><HR><A NAME="getDefaultGeometry()"><!-- --></A><H3>getDefaultGeometry</H3><PRE>public <A HREF="../../../org/geotools/feature/GeometryAttributeType.html" title="interface in org.geotools.feature">GeometryAttributeType</A> <B>getDefaultGeometry</B>()</PRE><DL><DD>Gets the default geometry AttributeType. <p> If the FeatureType has more one geometry it is up to the implementor to determine which geometry is the default. If working with multiple geometries it is best to get the attributeTypes and iterate through them, checking for instances of GeometryAttribtueType. </p> <p> This should just be used a convenience method when it is known that the features do not have multiple geometries. </p><P><DD><DL><DT><B>Returns:</B><DD>The attribute type of the default geometry, which will contain the position.</DL></DD></DL><HR><A NAME="getAttributeCount()"><!-- --></A><H3>getAttributeCount</H3><PRE>public int <B>getAttributeCount</B>()</PRE><DL><DD>The number of attribues defined by this schema. <p> This method to allows access to the complete schema as defined by this FeatureType and its ancestors. </p> <p> <ul> Notes: <li> <li>for FeatureType with no super type this count value is the the same as getAttributeTypes().length. </p><P><DD><DL><DT><B>Returns:</B><DD>number of distinct attributeTypes available, taking ancestors and taking overrides into account.</DL></DD></DL><HR><A NAME="getAttributeType(java.lang.String)"><!-- --></A><H3>getAttributeType</H3><PRE>public <A HREF="../../../org/geotools/feature/AttributeType.html" title="interface in org.geotools.feature">AttributeType</A> <B>getAttributeType</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 the attributeType at this xPath, if the specified attributeType does not exist then <code>null</code> is returned. <p> Question: it is unclear how this interacts with the complete schema defined by this FeatureType and its ancestors (in which a given xpath may refer to several AttributeTypes as restrictions are applied. </p> <p> Perhaps this method should be restricted to a FlatFeatureType? Or should have the option of returning an array of matching AttributeType in order of inheiritence? </p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>xPath</CODE> - XPath pointer to attribute type.<DT><B>Returns:</B><DD>AttributeType, or null if unavaialble</DL></DD></DL><HR><A NAME="find(org.geotools.feature.AttributeType)"><!-- --></A><H3>find</H3><PRE>public int <B>find</B>(<A HREF="../../../org/geotools/feature/AttributeType.html" title="interface in org.geotools.feature">AttributeType</A> type)</PRE><DL><DD>Find the position of a given AttributeType. <p> Match is based on attribute type name, the resulting index may be used with getAttributeType( index ). </p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>type</CODE> - The type to search for.<DT><B>Returns:</B><DD>-1 if not found, a zero-based index if found.</DL></DD></DL><HR><A NAME="find(java.lang.String)"><!-- --></A><H3>find</H3><PRE>public int <B>find</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> attName)</PRE><DL><DD>Find the position of an AttributeType which matches the given String. <p> This index may be used with getAttributeType( index ), the search space is the entire schema defined by this FeatureType and its ancestors. </p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>attName</CODE> - the name to look for<DT><B>Returns:</B><DD>-1 if not found, zero-based index otherwise</DL></DD></DL><HR><A NAME="getAttributeType(int)"><!-- --></A><H3>getAttributeType</H3><PRE>public <A HREF="../../../org/geotools/feature/AttributeType.html" title="interface in org.geotools.feature">AttributeType</A> <B>getAttributeType</B>(int position)</PRE><DL><DD>Gets the schema attributeType at the specified index. <p> The index is specified with respect to the entire Schema (as defined by this FeatureType and it's ancestors). <p> <ul> The index value should not be used with either: <li>FeatureType.getAttributeTypes()[index] - as it defines only attributes contributed by this FeatureType <li>Feature.getAttribute( index ) - as attributes order may or may not be in sequence </ul> </p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>position</CODE> - a integer index into the complete schema represented by this FeatureType and its ancestors<DT><B>Returns:</B><DD>the attribute type at the specified position</DL></DD></DL><HR><A NAME="getAttributeTypes()"><!-- --></A><H3>getAttributeTypes</H3><PRE>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?