Package org.geotools.xml.gml
Class FCBuffer
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- Runnable,- FeatureReader<SimpleFeatureType,- SimpleFeature> 
Feature Buffer ... acts as a FeatureReader<SimpleFeatureType, SimpleFeature> by making itself as a seperate thread
 prior starting execution with the SAX Parser.
- Author:
- dzwiers
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class ThreadThread.State, Thread.UncaughtExceptionHandler
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected SAXExceptionstatic final intLast feature is in the bufferprotected SimpleFeatureTypeprotected static Loggerprotected intstatic final intFields inherited from class ThreadMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedFCBuffer(URI document, int capacity, int timeout, SimpleFeatureType ft) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanAdds a feature to the buffervoidclose()Release the underlying resources associated with this stream.intgetFeatureReader(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.getFeatureReader(URI document, int capacity, int timeout) getFeatureReader(URI document, int capacity, int timeout, SimpleFeatureType ft) getFeatureReader(URI document, int capacity, SimpleFeatureType ft) Return the FeatureType this reader has been configured to create.intintgetSize()intbooleanhasNext()Query whether this FeatureReader has another Feature.protected voidinitHints(XMLHandlerHints hints) Called before parsing the FeatureCollection.next()Reads the next Feature in the FeatureReader.peek()voidvoidrun()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 Details- 
FINISHpublic static final int FINISHLast feature is in the buffer- See Also:
 
- 
STOPpublic static final int STOP- See Also:
 
- 
logger
- 
stateprotected int state
- 
exception
- 
ft
 
- 
- 
Constructor Details- 
FCBuffer- Parameters:
- ft- Nullable
 
 
- 
- 
Method Details- 
getSizepublic int getSize()- Returns:
- The buffer size
 
- 
getCapacitypublic int getCapacity()- Returns:
- The buffer capacity
 
- 
getTimeoutpublic int getTimeout()- Returns:
- The buffer capacity
 
- 
addFeatureAdds 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
 
- 
getFeatureTypeDescription 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:
 
- 
nextDescription 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:
 
- 
peek- Throws:
- IOException
- NoSuchElementException
- See Also:
 
- 
hasNextDescription 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:
 
- 
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:
 
- 
runpublic void run()
- 
initHintsCalled before parsing the FeatureCollection. Subclasses may override to set their custom hints.
- 
getInternalStatepublic int getInternalState()
- 
resetTimerpublic void resetTimer()
 
-