featurecollection.html
来自「Geotools是一个开源的Java GIS工具包,可利用它来开发符合标准的地理」· HTML 代码 · 共 746 行 · 第 1/3 页
HTML
746 行
</TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../org/geotools/feature/FeatureIterator.html" title="interface in org.geotools.feature">FeatureIterator</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/feature/FeatureCollection.html#features()">features</A></B>()</CODE><BR> Obtain a FeatureIterator of the Features within this collection. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../org/geotools/feature/FeatureType.html" title="interface in org.geotools.feature">FeatureType</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/feature/FeatureCollection.html#getFeatureType()">getFeatureType</A></B>()</CODE><BR> Gets a reference to the type of this feature collection. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../org/geotools/feature/FeatureType.html" title="interface in org.geotools.feature">FeatureType</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/feature/FeatureCollection.html#getSchema()">getSchema</A></B>()</CODE><BR> The schema for the child features of this collection. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/feature/FeatureCollection.html#removeListener(org.geotools.feature.CollectionListener)">removeListener</A></B>(<A HREF="../../../org/geotools/feature/CollectionListener.html" title="interface in org.geotools.feature">CollectionListener</A> listener)</CODE><BR> Removes a listener for collection events.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../org/geotools/feature/FeatureList.html" title="interface in org.geotools.feature">FeatureList</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/feature/FeatureCollection.html#sort(org.geotools.filter.SortBy)">sort</A></B>(<A HREF="../../../org/geotools/filter/SortBy.html" title="interface in org.geotools.filter">SortBy</A> order)</CODE><BR> collection.subCollection( myFilter ).sort( {"foo","bar"} ); collection.subCollection( myFilter ).sort( "bar" ).sort("foo")</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../org/geotools/feature/FeatureCollection.html" title="interface in org.geotools.feature">FeatureCollection</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/feature/FeatureCollection.html#subCollection(org.geotools.filter.Filter)">subCollection</A></B>(<A HREF="../../../org/geotools/filter/Filter.html" title="interface in org.geotools.filter">Filter</A> filter)</CODE><BR> FeatureCollection "view" indicated by provided filter. </TD></TR></TABLE> <A NAME="methods_inherited_from_class_ResourceCollection"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface <A HREF="../../../org/geotools/data/collection/ResourceCollection.html" title="interface in org.geotools.data.collection">ResourceCollection</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../org/geotools/data/collection/ResourceCollection.html#iterator()">iterator</A>, <A HREF="../../../org/geotools/data/collection/ResourceCollection.html#purge()">purge</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_Collection"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#add(java.lang.Object)" title="class or interface in java.util">add</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#addAll(java.util.Collection)" title="class or interface in java.util">addAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#clear()" title="class or interface in java.util">clear</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#contains(java.lang.Object)" title="class or interface in java.util">contains</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#containsAll(java.util.Collection)" title="class or interface in java.util">containsAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#equals(java.lang.Object)" title="class or interface in java.util">equals</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#hashCode()" title="class or interface in java.util">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#isEmpty()" title="class or interface in java.util">isEmpty</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#remove(java.lang.Object)" title="class or interface in java.util">remove</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#removeAll(java.util.Collection)" title="class or interface in java.util">removeAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#retainAll(java.util.Collection)" title="class or interface in java.util">retainAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#size()" title="class or interface in java.util">size</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#toArray()" title="class or interface in java.util">toArray</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#toArray(java.lang.Object[])" title="class or interface in java.util">toArray</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_FeatureResults"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface <A HREF="../../../org/geotools/data/FeatureResults.html" title="interface in org.geotools.data">FeatureResults</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../org/geotools/data/FeatureResults.html#collection()">collection</A>, <A HREF="../../../org/geotools/data/FeatureResults.html#getBounds()">getBounds</A>, <A HREF="../../../org/geotools/data/FeatureResults.html#getCount()">getCount</A>, <A HREF="../../../org/geotools/data/FeatureResults.html#reader()">reader</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_Feature"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface <A HREF="../../../org/geotools/feature/Feature.html" title="interface in org.geotools.feature">Feature</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../org/geotools/feature/Feature.html#getAttribute(int)">getAttribute</A>, <A HREF="../../../org/geotools/feature/Feature.html#getAttribute(java.lang.String)">getAttribute</A>, <A HREF="../../../org/geotools/feature/Feature.html#getAttributes(java.lang.Object[])">getAttributes</A>, <A HREF="../../../org/geotools/feature/Feature.html#getBounds()">getBounds</A>, <A HREF="../../../org/geotools/feature/Feature.html#getDefaultGeometry()">getDefaultGeometry</A>, <A HREF="../../../org/geotools/feature/Feature.html#getID()">getID</A>, <A HREF="../../../org/geotools/feature/Feature.html#getNumberOfAttributes()">getNumberOfAttributes</A>, <A HREF="../../../org/geotools/feature/Feature.html#getParent()">getParent</A>, <A HREF="../../../org/geotools/feature/Feature.html#setAttribute(int, java.lang.Object)">setAttribute</A>, <A HREF="../../../org/geotools/feature/Feature.html#setAttribute(java.lang.String, java.lang.Object)">setAttribute</A>, <A HREF="../../../org/geotools/feature/Feature.html#setDefaultGeometry(com.vividsolutions.jts.geom.Geometry)">setDefaultGeometry</A>, <A HREF="../../../org/geotools/feature/Feature.html#setParent(org.geotools.feature.FeatureCollection)">setParent</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ 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="features()"><!-- --></A><H3>features</H3><PRE>public <A HREF="../../../org/geotools/feature/FeatureIterator.html" title="interface in org.geotools.feature">FeatureIterator</A> <B>features</B>()</PRE><DL><DD>Obtain a FeatureIterator of the Features within this collection. <p> The implementation of Collection must adhere to the rules of fail-fast concurrent modification. In addition (to allow for resource backed collections, the <code>close( Iterator )</code> method must be called. <p> This is almost equivalent to: <ul> <li>a Type-Safe call to: <code>getAttribute(getFeatureType().getAttributeType(0).getName()).iterator();</code>. <li>A Java 5:<code>Iterator<Feature></code> </ul> </p> Example (safe) use:<pre><code> FeatureIterator iterator=collection.features(); try { while( iterator.hasNext() ){ Feature feature = iterator.next(); System.out.println( feature.getID() ); } } finally { collection.close( iterator ); } </code></pre> </p> <p> GML Note: The contents of this iterator are considered to be defined by <b>featureMember</b> tags (and/or the single allowed <b>FeatureMembers</b> tag). Please see getFeatureType for more details. </p><P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>A FeatureIterator.</DL></DD></DL><HR><A NAME="close(org.geotools.feature.FeatureIterator)"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>(<A HREF="../../../org/geotools/feature/FeatureIterator.html" title="interface in org.geotools.feature">FeatureIterator</A> close)</PRE><DL><DD>Clean up any resources assocaited with this iterator in a manner similar to JDO collections. <p> You must be sure to allow null values, this is because in a try/finally block client code may not be sure if they have actualy succeed in assign a value to an iterator they wish to ensure is closed. By permiting null as an api we prevent a null check in lots of finally statements. </p> <p> Note: Because of FeatureReader using an interator internally, there is only one implementation of this method that makes any sense:<pre><code> <b>public void</b> close( FeatureIterator iterator) { <b>if</b>( iterator != null ) iterator.close(); } </code></pre> </p><P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="close(java.util.Iterator)"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A> close)</PRE><DL><DD>Clean up after any resources assocaited with this itterator in a manner similar to JDO collections. </p> Example (safe) use:<pre><code> Iterator iterator = collection.iterator(); try { for( Iterator i=collection.iterator(); i.hasNext();){ Feature feature = (Feature) i.hasNext(); System.out.println( feature.getID() ); } } finally { collection.close( iterator ); } </code></pre> </p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/data/collection/ResourceCollection.html#close(java.util.Iterator)">close</A></CODE> in interface <CODE><A HREF="../../../org/geotools/data/collection/ResourceCollection.html" title="interface in org.geotools.data.collection">ResourceCollection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>close</CODE> - </DL></DD></DL><HR><A NAME="addListener(org.geotools.feature.CollectionListener)"><!-- --></A><H3>addListener</H3><PRE>public void <B>addListener</B>(<A HREF="../../../org/geotools/feature/CollectionListener.html" title="interface in org.geotools.feature">CollectionListener</A> listener) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></PRE><DL><DD>Adds a listener for collection events. <p> When this collection is backed by live data the event notification will follow the guidelines outlined by FeatureListner. </p><P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - The listener to add<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - If the listener is null.</DL></DD></DL><HR><A NAME="removeListener(org.geotools.feature.CollectionListener)"><!-- --></A><H3>removeListener</H3><PRE>public void <B>removeListener</B>(<A HREF="../../../org/geotools/feature/CollectionListener.html" title="interface in org.geotools.feature">CollectionListener</A> listener)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?