Package org.geotools.xml.gml
Class FCBuffer
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- Runnable,- FeatureReader<SimpleFeatureType,SimpleFeature>
 
 public class FCBuffer extends Thread implements FeatureReader<SimpleFeatureType,SimpleFeature> Feature Buffer ... acts as a FeatureReaderby making itself as a seperate thread prior starting execution with the SAX Parser. - Author:
- dzwiers
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classFCBuffer.StopException- 
Nested classes/interfaces inherited from class ThreadThread.State, Thread.UncaughtExceptionHandler
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected SAXExceptionexceptionstatic intFINISHLast feature is in the bufferprotected SimpleFeatureTypeftprotected static Loggerloggerprotected intstatestatic intSTOP- 
Fields inherited from class ThreadMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedFCBuffer(URI document, int capacity, int timeout, SimpleFeatureType ft)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaddFeature(SimpleFeature f)Adds a feature to the buffervoidclose()Release the underlying resources associated with this stream.intgetCapacity()static FeatureReader<SimpleFeatureType,SimpleFeature>getFeatureReader(URI document, int capacity)The prefered method of using this class, this will return the Feature Reader for the document specified, using the specified buffer capacity.static FeatureReader<SimpleFeatureType,SimpleFeature>getFeatureReader(URI document, int capacity, int timeout)static FeatureReader<SimpleFeatureType,SimpleFeature>getFeatureReader(URI document, int capacity, int timeout, SimpleFeatureType ft)static FeatureReader<SimpleFeatureType,SimpleFeature>getFeatureReader(URI document, int capacity, SimpleFeatureType ft)SimpleFeatureTypegetFeatureType()Return the FeatureType this reader has been configured to create.intgetInternalState()intgetSize()intgetTimeout()booleanhasNext()Query whether this FeatureReader has another Feature.protected voidinitHints(XMLHandlerHints hints)Called before parsing the FeatureCollection.SimpleFeaturenext()Reads the next Feature in the FeatureReader.SimpleFeaturepeek()voidresetTimer()voidrun()- 
Methods inherited from class ThreadactiveCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
 
- 
 
- 
- 
- 
Field Detail- 
FINISHpublic static final int FINISH Last feature is in the buffer- See Also:
- Constant Field Values
 
 - 
STOPpublic static final int STOP - See Also:
- Constant Field Values
 
 - 
loggerprotected static Logger logger 
 - 
stateprotected int state 
 - 
exceptionprotected SAXException exception 
 - 
ftprotected SimpleFeatureType ft 
 
- 
 - 
Constructor Detail- 
FCBufferprotected FCBuffer(URI document, int capacity, int timeout, SimpleFeatureType ft) - Parameters:
- ft- Nullable
 
 
- 
 - 
Method Detail- 
getSizepublic int getSize() - Returns:
- The buffer size
 
 - 
getCapacitypublic int getCapacity() - Returns:
- The buffer capacity
 
 - 
getTimeoutpublic int getTimeout() - Returns:
- The buffer capacity
 
 - 
addFeatureprotected boolean addFeature(SimpleFeature f) Adds a feature to the buffer- Parameters:
- f- Feature to add
- Returns:
- false if unable to add the feature
 
 - 
getFeatureReaderpublic static FeatureReader<SimpleFeatureType,SimpleFeature> getFeatureReader(URI document, int capacity) throws SAXException The prefered method of using this class, this will return the Feature Reader for the document specified, using the specified buffer capacity.- Parameters:
- document- URL to parse
- Throws:
- SAXException
 
 - 
getFeatureReaderpublic static FeatureReader<SimpleFeatureType,SimpleFeature> getFeatureReader(URI document, int capacity, SimpleFeatureType ft) throws SAXException - Throws:
- SAXException
 
 - 
getFeatureReaderpublic static FeatureReader<SimpleFeatureType,SimpleFeature> getFeatureReader(URI document, int capacity, int timeout) throws SAXException - Throws:
- SAXException
 
 - 
getFeatureReaderpublic static FeatureReader<SimpleFeatureType,SimpleFeature> getFeatureReader(URI document, int capacity, int timeout, SimpleFeatureType ft) throws SAXException - Throws:
- SAXException
 
 - 
getFeatureTypepublic SimpleFeatureType getFeatureType() Description copied from interface:FeatureReaderReturn the FeatureType this reader has been configured to create.- Specified by:
- getFeatureTypein interface- FeatureReader<SimpleFeatureType,SimpleFeature>
- Returns:
- the FeatureType of the Features this FeatureReader will create.
- See Also:
- FeatureReader.getFeatureType()
 
 - 
nextpublic SimpleFeature next() throws IOException, NoSuchElementException Description copied from interface:FeatureReaderReads the next Feature in the FeatureReader.- Specified by:
- nextin interface- FeatureReader<SimpleFeatureType,SimpleFeature>
- Returns:
- The next feature in the reader.
- Throws:
- IOException- If an error occurs reading the Feature.
- NoSuchElementException- If there are no more Features in the Reader.
- See Also:
- FeatureReader.next()
 
 - 
peekpublic SimpleFeature peek() throws IOException, NoSuchElementException - Throws:
- IOException
- NoSuchElementException
- See Also:
- FeatureReader.next()
 
 - 
hasNextpublic boolean hasNext() throws IOExceptionDescription copied from interface:FeatureReaderQuery whether this FeatureReader has another Feature.- Specified by:
- hasNextin interface- FeatureReader<SimpleFeatureType,SimpleFeature>
- Returns:
- True if there are more Features to be read. In other words, true if calls to next would return a feature rather than throwing an exception.
- Throws:
- IOException- If an error occurs determining if there are more Features.
- See Also:
- FeatureReader.hasNext()
 
 - 
closepublic void close() Description copied from interface:FeatureReaderRelease the underlying resources associated with this stream.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Specified by:
- closein interface- FeatureReader<SimpleFeatureType,SimpleFeature>
- See Also:
- FeatureReader.close()
 
 - 
runpublic void run() - Specified by:
- runin interface- Runnable
- Overrides:
- runin class- Thread
- See Also:
- Runnable.run()
 
 - 
initHintsprotected void initHints(XMLHandlerHints hints) Called before parsing the FeatureCollection. Subclasses may override to set their custom hints.
 - 
getInternalStatepublic int getInternalState() 
 - 
resetTimerpublic void resetTimer() 
 
- 
 
-