public boolean isEmpty() { return delegate.isEmpty(); }
public boolean isEmpty() { return delegate.isEmpty() || max == 0; }
public boolean isEmpty() { return collection.isEmpty(); }
public boolean isEmpty() { return delegate.isEmpty(); }
public boolean isEmpty() { return delegate.isEmpty() || max == 0; }
public boolean isEmpty() { return delegate.isEmpty(); }
public boolean isEmpty() { return delegate.isEmpty(); }
public boolean isEmpty() { return collection.isEmpty(); }
public boolean isEmpty() { return delegate.isEmpty() || max == 0; }
public boolean isEmpty() { return fc.isEmpty(); }
/** * Create a new instance. * * @param featuresArg a FeatureCollection. <b>All features must be of the same FeatureType</b> * @param typeArg the Feature type of of the features. */ public CollectionFeatureReader(FeatureCollection featuresArg, FeatureType typeArg) { assert !featuresArg.isEmpty(); collection = featuresArg; this.features = featuresArg.iterator(); this.type = typeArg; }
@Override public boolean isEmpty() { timeoutVerifier.checkTimeout(); return delegate.isEmpty(); }
/** * Checks that a given FeatureCollection contains the specified feature * * @param fc the feature collection we're going to search * @param f the feature we're looking for * * @return true if the feature is in the feature collection, false * otherwise */ boolean containsFeatureCollection(FeatureCollection fc, Feature f) { if ((fc == null) || fc.isEmpty()) { return false; } return containsFeature(fc.toArray(), f); }
/** * The number of columns in the feature table. Note: for the moment, this is * determined by the first feature. * * @return the number of columns in this feature table. * * @todo Just gets first feature type - should use typed feature * collection. Revisit when we have FeatureDocument. */ public int getColumnCount() { if (featureTable==null || featureTable.isEmpty()) { return 0; } return featureTable.features().next().getNumberOfAttributes(); }
/** * Gets the name of a specified column. * * @param col the index of the column to get the name of. * @return the name of {@code col}. * * @todo Just gets first feature type - should use typed feature * collection. Revisit when we have FeatureDocument. */ public String getColumnName(int col) { if (featureTable==null || featureTable.isEmpty()) { return null; } Feature firstFeature = featureTable.features().next(); FeatureType firstType = firstFeature.getFeatureType(); return firstType.getAttributeType(col).getName(); }
@Test public void testAddingEmptyPinVectorDataNode() throws Exception { final Product p = new Product("n", "t", 1, 1); assertNotNull(p.getPinGroup()); final VectorDataNode node = p.getVectorDataGroup().get("pins"); // add empty "pins" VDN final VectorDataNode node2 = new VectorDataNode("pins", node.getFeatureType()); final boolean added = p.getVectorDataGroup().add(node2); assertFalse(added); assertSame(node, p.getVectorDataGroup().get("pins")); assertTrue(node.getFeatureCollection().isEmpty()); assertEquals(0, node.getPlacemarkGroup().getNodeCount()); assertTrue(node.isPermanent()); }
@Test public void testInitialPinVectorDataNodeState() throws Exception { final Product p = new Product("n", "t", 1, 1); assertNotNull(p.getPinGroup()); final VectorDataNode node = p.getVectorDataGroup().get("pins"); assertNotNull(node); assertTrue(node.getPlacemarkDescriptor() instanceof PinDescriptor); assertSame(p.getPinGroup(), p.getPinGroup()); assertSame(p.getPinGroup(), node.getPlacemarkGroup()); assertTrue(node.getFeatureCollection().isEmpty()); assertEquals(0, node.getPlacemarkGroup().getNodeCount()); assertTrue(node.isPermanent()); }
@Test public void testAddingEmptyGcpVectorDataNode() throws Exception { final Product p = new Product("n", "t", 1, 1); assertNotNull(p.getGcpGroup()); final VectorDataNode node = p.getVectorDataGroup().get("ground_control_points"); // add empty "GCP" VDN final VectorDataNode node2 = new VectorDataNode("ground_control_points", node.getFeatureType()); final boolean added = p.getVectorDataGroup().add(node2); assertFalse(added); assertSame(node, p.getVectorDataGroup().get("ground_control_points")); assertTrue(node.getFeatureCollection().isEmpty()); assertEquals(0, node.getPlacemarkGroup().getNodeCount()); assertTrue(node.isPermanent()); }
@Test public void testInitialGcpVectorDataNodeState() throws Exception { final Product p = new Product("n", "t", 1, 1); assertNotNull(p.getGcpGroup()); final VectorDataNode node = p.getVectorDataGroup().get("ground_control_points"); assertNotNull(node); assertTrue(node.getPlacemarkDescriptor() instanceof GcpDescriptor); assertSame(p.getGcpGroup(), p.getGcpGroup()); assertSame(p.getGcpGroup(), node.getPlacemarkGroup()); assertTrue(node.getFeatureCollection().isEmpty()); assertEquals(0, node.getPlacemarkGroup().getNodeCount()); assertTrue(node.isPermanent()); }
@Test public void testAddingNonEmptyPinVectorDataNode() throws Exception { final Product p = new Product("n", "t", 1, 1); assertNotNull(p.getPinGroup()); final VectorDataNode node = p.getVectorDataGroup().get("pins"); // add non-empty "pins" VDN final VectorDataNode node2 = new VectorDataNode("pins", node.getFeatureType()); node2.getFeatureCollection().add(new SimpleFeatureBuilder(node.getFeatureType()).buildFeature("id")); final boolean added3 = p.getVectorDataGroup().add(node2); assertFalse(added3); assertSame(node, p.getVectorDataGroup().get("pins")); assertFalse(node.getFeatureCollection().isEmpty()); assertEquals(1, node.getPlacemarkGroup().getNodeCount()); assertTrue(node.isPermanent()); }