Revision: 5648 http://sourceforge.net/p/jump-pilot/code/5648 Author: edso Date: 2017-12-25 14:55:10 +0000 (Mon, 25 Dec 2017) Log Message: ----------- add a missing method to retrieve a specific wrapper from the feature collection
Modified Paths: -------------- core/trunk/src/com/vividsolutions/jump/feature/FeatureCollectionWrapper.java Modified: core/trunk/src/com/vividsolutions/jump/feature/FeatureCollectionWrapper.java =================================================================== --- core/trunk/src/com/vividsolutions/jump/feature/FeatureCollectionWrapper.java 2017-12-25 14:03:36 UTC (rev 5647) +++ core/trunk/src/com/vividsolutions/jump/feature/FeatureCollectionWrapper.java 2017-12-25 14:55:10 UTC (rev 5648) @@ -103,6 +103,25 @@ } /** + * Return the wrapper matching the given class or null, if there is none. + * @param c + * @return + */ + public FeatureCollection getWrappee(Class c) { + Assert.isTrue(FeatureCollectionWrapper.class.isAssignableFrom(c)); + + if (c.isInstance(this)) { + return this; + } + + if (fc instanceof FeatureCollectionWrapper) { + return ((FeatureCollectionWrapper) fc).getWrappee(c); + } + + return null; + } + + /** * Returns the FeatureCollection that this wrapper delegates to (possibly * another FeatureCollectionWrapper). * ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel