Java Doc for TextImageReader.java in  » GIS » GeoTools-2.4.1 » org » geotools » image » io » text » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.image.io.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.geotools.image.io.StreamImageReader
   org.geotools.image.io.text.TextImageReader

All known Subclasses:   org.geotools.image.io.text.TextRecordImageReader,  org.geotools.image.io.text.TestReader,  org.geotools.image.io.text.TextMatrixImageReader,
TextImageReader
abstract public class TextImageReader extends StreamImageReader (Code)
Base class for text image decoders. "Text images" are usually ASCII files containing pixel as geophysical values. This base class provides a convenient way to get BufferedReader for reading lines.

TextImageReader accepts many input types, including File , URL , Reader , InputStream and ImageInputStream . The Spi provider automatically advises those input types. The above cited Spi provided also provides a convenient way to control the character encoding, with the Spi.charset charset field. Developer can gain yet more control on character encoding by overriding the TextImageReader.getCharset method.
since:
   2.4
version:
   $Id: TextImageReader.java 26761 2007-08-29 21:25:45Z desruisseaux $
author:
   Martin Desruisseaux


Inner Class :abstract public static class Spi extends StreamImageReader.Spi


Constructor Summary
protected  TextImageReader(ImageReaderSpi provider)
     Constructs a new image reader.

Method Summary
protected  voidclose()
     Closes the reader created by TextImageReader.getReader() .
protected  CharsetgetCharset(InputStream input)
     Returns the character set to use for decoding the string from the input stream.
final  ReadergetInputStreamReader(InputStream stream)
     Returns the specified InputStream as a Reader .
protected  LineFormatgetLineFormat(int imageIndex)
     Returns the line format to use for parsing every lines in the input stream.
protected  doublegetPadValue(int imageIndex)
     Returns the pad value for missing data, or Double.NaN if none.
protected  StringgetPositionString(String message)
     Returns a string representation of the current stream position.
protected  BufferedReadergetReader()
     Returns the as an . If the input is already a buffered reader, it is returned unchanged.
final  longgetStreamLength(int fromImage, int toImage)
     Retourne une approximation du nombre d'octets du flot occupés par les images fromImage inclusivement jusqu'à toImage exclusivement.
static  longgetStreamPosition(Reader reader)
     Retourne la position du flot spécifié, ou -1 si cette position est inconnue.
protected  booleanisComment(String line)
     Returns true if the specified line is a comment.


Constructor Detail
TextImageReader
protected TextImageReader(ImageReaderSpi provider)(Code)
Constructs a new image reader.
Parameters:
  provider - The provider that is invoking this constructor, or null if none.




Method Detail
close
protected void close() throws IOException(Code)
Closes the reader created by TextImageReader.getReader() . This method does nothing if the reader is the instance given by the user rather than a reader created by this class from a File or URL input.
See Also:   TextImageReader.closeOnReset



getCharset
protected Charset getCharset(InputStream input) throws IOException(Code)
Returns the character set to use for decoding the string from the input stream. The default implementation returns the specified to the Spi object given to this TextImageReader constructor. Subclasses can override this method if they want to detect the character encoding in some other way.
Parameters:
  input - The input stream. The character encoding, or null for the platform default encoding.
throws:
  IOException - If reading from the input stream failed.
See Also:   Spi.charset



getInputStreamReader
final Reader getInputStreamReader(InputStream stream) throws IOException(Code)
Returns the specified InputStream as a Reader .



getLineFormat
protected LineFormat getLineFormat(int imageIndex) throws IOException(Code)
Returns the line format to use for parsing every lines in the input stream. The default implementation creates a new LineFormat instance using the locale specified by Spi.locale . Subclasses should override this method if they want more control on the parser to be created.
Parameters:
  imageIndex - the index of the image to be queried.
throws:
  IOException - If reading from the input stream failed.
See Also:   Spi.locale



getPadValue
protected double getPadValue(int imageIndex) throws IOException(Code)
Returns the pad value for missing data, or Double.NaN if none. The pad value will applies to all columns except the one for TextRecordImageReader.getColumnX x and TextRecordImageReader.getColumnY y values, if any.

The default implementation returns the pad value specified to the Spi object given to this TextImageReader constructor. Subclasses can override this method if they want to detect the pad value in some other way.
Parameters:
  imageIndex - the index of the image to be queried.
throws:
  IOException - If reading from the input stream failed.
See Also:   Spi.padValue SampleConverter




getPositionString
protected String getPositionString(String message)(Code)
Returns a string representation of the current stream position. For example this method may returns something like "Line 14 in file HUV18204.asc" . This method returns null if the stream position is unknown.
Parameters:
  message - An optional message to append to the stream position, or null if none.



getReader
protected BufferedReader getReader() throws IllegalStateException, IOException(Code)
Returns the as an . If the input is already a buffered reader, it is returned unchanged. Otherwise this method creates a new from various input types including File , URL , URLConnection , Reader , InputStream and ImageInputStream .

This method creates a new only when first invoked. All subsequent calls will returns the same instance. Consequently, the returned reader should never be closed by the caller. It may be automatically when TextImageReader.setInput setInput(...) , TextImageReader.reset() reset() or TextImageReader.dispose()dispose() methods are invoked. TextImageReader.getInput as a BufferedReader.
throws:
  IllegalStateException - if the is not set.
throws:
  IOException - If the input stream can't be created for an other reason.
See Also:   TextImageReader.getInput
See Also:   TextImageReader.getInputStream




getStreamLength
final long getStreamLength(int fromImage, int toImage) throws IOException(Code)
Retourne une approximation du nombre d'octets du flot occupés par les images fromImage inclusivement jusqu'à toImage exclusivement. L'implémentation par défaut calcule cette longueur en supposant que toutes les images se divisent la longueur totale du flot en parts égales.
Parameters:
  fromImage - Index de la première image à prendre en compte.
Parameters:
  toImage - Index suivant celui de la dernière image à prendre encompte, ou -1 pour prendre en compte toutes les imagesrestantes jusqu'à la fin du flot. Le nombre d'octets occupés par les images spécifiés, ou -1 sicette longueur n'a pas pu être calculée. Si le calcul précis decette longueur serait prohibitif, cette méthode est autorisée àretourner une simple approximation ou même à retourner la longueurtotale du flot.
throws:
  IOException - si une erreur est survenue lors de la lecture du flot.



getStreamPosition
static long getStreamPosition(Reader reader) throws IOException(Code)
Retourne la position du flot spécifié, ou -1 si cette position est inconnue. Note: la position retournée est approximative. Elle est utile pour afficher un rapport des progrès, mais sans plus.
Parameters:
  reader - Flot dont on veut connaître la position. Position approximative du flot, ou -1 si cette position n'a pas pu être obtenue.
throws:
  IOException - si l'opération a échouée.



isComment
protected boolean isComment(String line)(Code)
Returns true if the specified line is a comment. This method is invoked automatically during a TextImageReader.read read operation. The default implementation returns true if the line is empty or if the first non-whitespace character is '#' , and false otherwise. Override this method if comment lines should be determined in a different way.
Parameters:
  line - A line to be parsed. true if the line is a comment and should be ignored, or false if itshould be parsed.



Fields inherited from org.geotools.image.io.StreamImageReader
protected Object closeOnReset(Code)(Java Doc)

Methods inherited from org.geotools.image.io.StreamImageReader
protected void close() throws IOException(Code)(Java Doc)
public void dispose()(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
protected InputStream getInputStream() throws IllegalStateException, IOException(Code)(Java Doc)
protected long getStreamLength() throws IOException(Code)(Java Doc)
public void reset()(Code)(Java Doc)
public void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.