Package org.geotools.feature.FeatureComparators

Examples of org.geotools.feature.FeatureComparators.Name


        SimpleFeature f1 = b.buildFeature(null, new Object[] { "Steve", 32 });
        SimpleFeature f2 = b.buildFeature(null, new Object[] { null, null });
        SimpleFeature f3 = b.buildFeature(null, new Object[] { null, null });

        Name compareName = new FeatureComparators.Name("name");

        // f1 has name, f2 has null name, expecting that f1 is greater g2
        assertTrue(compareName.compare(f1, f2) > 0);
        assertTrue(compareName.compare(f2, f1) < 0);
        assertTrue(compareName.compare(f2, f3) == 0);

        Name compareNumber = new FeatureComparators.Name("name");
        // f1 has number, f2 has null number, expecting that f1 is greater g2
        assertTrue(compareNumber.compare(f1, f2) > 0);
        assertTrue(compareNumber.compare(f2, f1) < 0);
        assertTrue(compareNumber.compare(f2, f3) == 0);
    }
View Full Code Here

TOP

Related Classes of org.geotools.feature.FeatureComparators.Name

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.