Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.io.gml.reader.internal
Class GmlInstanceCollection

java.lang.Object
  extended by eu.esdihumboldt.hale.io.gml.reader.internal.GmlInstanceCollection
All Implemented Interfaces:
InstanceCollection, InstanceResolver

public class GmlInstanceCollection
extends Object
implements InstanceCollection

Instance collection based on an XML/GML input stream

Author:
Simon Templer
Partner:
01 / Fraunhofer Institute for Computer Graphics Research

Nested Class Summary
 class GmlInstanceCollection.InstanceIterator
          Iterates over Instances in an XML/GML stream
 
Field Summary
 
Fields inherited from interface eu.esdihumboldt.hale.common.instance.model.InstanceCollection
UNKNOWN_SIZE
 
Constructor Summary
GmlInstanceCollection(LocatableInputSupplier<? extends InputStream> source, TypeIndex sourceSchema, boolean restrictToFeatures, boolean ignoreRoot, boolean strict, CRSProvider crsProvider)
          Create an XMl/GML instance collection based on the given source.
 
Method Summary
 Instance getInstance(InstanceReference reference)
          Get the instance referenced by the given reference.
 InstanceReference getReference(Instance instance)
          Get a reference to an instance that can be used to retrieve the given instance using InstanceResolver.getInstance(InstanceReference).
 boolean hasSize()
          States if the collection has a known size.
 boolean isEmpty()
          States if the collection has no instances.
 GmlInstanceCollection.InstanceIterator iterator()
          Get an iterator over all instances contained in the collection.
 InstanceCollection select(Filter filter)
          Select the instances in the collection, matching the given filter.
 int size()
          Get the collection size if known.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GmlInstanceCollection

public GmlInstanceCollection(LocatableInputSupplier<? extends InputStream> source,
                             TypeIndex sourceSchema,
                             boolean restrictToFeatures,
                             boolean ignoreRoot,
                             boolean strict,
                             CRSProvider crsProvider)
Create an XMl/GML instance collection based on the given source.

Parameters:
source - the source
sourceSchema - the source schema
restrictToFeatures - if only instances that are GML features shall be loaded
ignoreRoot - if the root element should be ignored for creating instances even if it is recognized as an allowed instance type
strict - if associating elements with properties should be done strictly according to the schema, otherwise a fall-back is used trying to populate values also on invalid property paths
crsProvider - CRS provider in case no CRS is specified, may be null
Method Detail

hasSize

public boolean hasSize()
Description copied from interface: InstanceCollection
States if the collection has a known size.

Specified by:
hasSize in interface InstanceCollection
Returns:
if the collection size is known
See Also:
InstanceCollection.hasSize()

size

public int size()
Description copied from interface: InstanceCollection
Get the collection size if known.

Specified by:
size in interface InstanceCollection
Returns:
the collection size or InstanceCollection.UNKNOWN_SIZE
See Also:
InstanceCollection.size()

iterator

public GmlInstanceCollection.InstanceIterator iterator()
Description copied from interface: InstanceCollection
Get an iterator over all instances contained in the collection. The iterator must be disposed after use (using ResourceIterator.close()).

Specified by:
iterator in interface InstanceCollection
Returns:
an iterator over the instances
See Also:
Iterable.iterator()

isEmpty

public boolean isEmpty()
Description copied from interface: InstanceCollection
States if the collection has no instances. This must return a valid value even if InstanceCollection.hasSize() returns false.

Specified by:
isEmpty in interface InstanceCollection
Returns:
if the collection is empty
See Also:
InstanceCollection.isEmpty()

select

public InstanceCollection select(Filter filter)
Description copied from interface: InstanceCollection
Select the instances in the collection, matching the given filter.

Specified by:
select in interface InstanceCollection
Parameters:
filter - the instance filter
Returns:
the instance collection representing the selection
See Also:
InstanceCollection.select(Filter)

getReference

public InstanceReference getReference(Instance instance)
Description copied from interface: InstanceResolver
Get a reference to an instance that can be used to retrieve the given instance using InstanceResolver.getInstance(InstanceReference).

Specified by:
getReference in interface InstanceResolver
Parameters:
instance - the instance, must have originated from this resolver
Returns:
the reference
See Also:
InstanceResolver.getReference(Instance)

getInstance

public Instance getInstance(InstanceReference reference)
Description copied from interface: InstanceResolver
Get the instance referenced by the given reference.

Specified by:
getInstance in interface InstanceResolver
Parameters:
reference - the instance reference
Returns:
the referenced instance or null if it does not exist or the reference is invalid
See Also:
InstanceResolver.getInstance(InstanceReference)

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d