Java Doc for Channel.java in  » Scripting » jacl » tcl » lang » 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 » Scripting » jacl » tcl.lang 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   tcl.lang.Channel

All known Subclasses:   tcl.lang.ReadInputStreamChannel,  tcl.lang.FileChannel,  tcl.lang.SocketChannel,  tcl.lang.StdChannel,  tcl.lang.ServerSocketChannel,
Channel
abstract class Channel (Code)
The Channel class provides functionality that will be needed for any type of Tcl channel. It performs generic reads, writes, without specifying how a given channel is actually created. Each new channel type will need to extend the abstract Channel class and override any methods it needs to provide a specific implementation for.


Field Summary
protected  booleanblocking
     Set to false when channel is in non-blocking mode.
protected  intbufferSize
    
protected  intbuffering
    
protected  intbytesPerChar
    
protected  Stringencoding
     Name of Java encoding for this Channel.
protected  TclInputStreaminput
     Tcl input and output objecs.
protected  charinputEofChar
     If nonzero, use this as a signal of EOF on input.
protected  intinputTranslation
    
protected  intmode
     The read, write, append and create flags are set here.
protected  TclOutputStreamoutput
    
protected  charoutputEofChar
     If nonzero, append this to a writeable channel on close.
protected  intoutputTranslation
    
protected  intrefCount
    

Constructor Summary
 Channel()
    

Method Summary
protected  voidcheckRead(Interp interp)
    
protected  voidcheckWrite(Interp interp)
    
 voidclose()
     Close the Channel.
final  booleaneof()
     Returns true if the last read reached the EOF.
 voidflush(Interp interp)
     Flush the Channel.
 booleangetBlocking()
     Query blocking mode.
 intgetBufferSize()
    
 intgetBuffering()
     Query buffering mode.
 StringgetChanName()
     Gets the chanName that is the key for the chanTable hashtable.
abstract  StringgetChanType()
     Return a string that describes the channel type.
 StringgetEncoding()
    
 chargetInputEofChar()
    
abstract protected  InputStreamgetInputStream()
     This method should be overridden in the subclass to provide a channel specific InputStream object.
 intgetInputTranslation()
    
 intgetNumBufferedInputBytes()
    
 intgetNumBufferedOutputBytes()
    
 chargetOutputEofChar()
    
abstract protected  OutputStreamgetOutputStream()
     This method should be overridden in the subclass to provide a channel specific OutputStream object.
 intgetOutputTranslation()
    
 intgetRefCount()
     Return number of references to this Channel.
protected  voidinitInput()
    
protected  voidinitOutput()
    
 booleaninputSawCR()
     Channel is in CRLF eol input translation mode and the last byte seen was a CR.
 booleanisBgFlushScheduled()
     Returns true if a background flush is waiting to happen.
 booleanisBlocked(Interp interp)
     Tcl_InputBlocked -> isBlocked Returns true if input is blocked on this channel, false otherwise.
 booleanisReadOnly()
    
 booleanisReadWrite()
    
 booleanisWriteOnly()
    
 intread(Interp interp, TclObject tobj, int readType, int numBytes)
     Tcl_ReadChars -> read Read data from the Channel into the given TclObject.
Parameters:
  interp - is used for TclExceptions.
 voidseek(Interp interp, long offset, int mode)
     Move the current file pointer.
 voidsetBlocking(boolean inBlocking)
     Set blocking mode.
 voidsetBufferSize(int size)
    
 voidsetBuffering(int inBuffering)
    
 voidsetChanName(String chan)
     Sets the chanName that is the key for the chanTable hashtable.
 voidsetEncoding(String inEncoding)
    
 voidsetInputEofChar(char inEof)
    
 voidsetInputTranslation(int translation)
    
 voidsetOutputEofChar(char outEof)
    
 voidsetOutputTranslation(int translation)
    
 longtell()
     Return the current file pointer.
 voidwrite(Interp interp, TclObject outData)
     Tcl_WriteObj -> write Write data to the Channel
Parameters:
  interp - is used for TclExceptions.
 voidwrite(Interp interp, String outStr)
     Tcl_WriteChars -> write Write string data to the Channel.
Parameters:
  interp - is used for TclExceptions.

Field Detail
blocking
protected boolean blocking(Code)
Set to false when channel is in non-blocking mode.



bufferSize
protected int bufferSize(Code)
Buffer size, in bytes, allocated for channel to store input or output



buffering
protected int buffering(Code)
Buffering (full,line, or none)



bytesPerChar
protected int bytesPerChar(Code)



encoding
protected String encoding(Code)
Name of Java encoding for this Channel. A null value means use no encoding (binary).



input
protected TclInputStream input(Code)
Tcl input and output objecs. These are like a mix between a Java Stream and a Reader.



inputEofChar
protected char inputEofChar(Code)
If nonzero, use this as a signal of EOF on input.



inputTranslation
protected int inputTranslation(Code)
Translation mode for end-of-line character



mode
protected int mode(Code)
The read, write, append and create flags are set here. The variables used to set the flags are found in the class TclIO.



output
protected TclOutputStream output(Code)



outputEofChar
protected char outputEofChar(Code)
If nonzero, append this to a writeable channel on close.



outputTranslation
protected int outputTranslation(Code)



refCount
protected int refCount(Code)
How many interpreters hold references to this IO channel?




Constructor Detail
Channel
Channel()(Code)




Method Detail
checkRead
protected void checkRead(Interp interp) throws TclException(Code)



checkWrite
protected void checkWrite(Interp interp) throws TclException(Code)



close
void close() throws IOException(Code)
Close the Channel. The channel is only closed, it is the responsibility of the "closer" to remove the channel from the channel table.



eof
final boolean eof()(Code)
Returns true if the last read reached the EOF.



flush
void flush(Interp interp) throws IOException, TclException(Code)
Flush the Channel.
exception:
  TclException - is thrown when attempting to flush a read only channel.
exception:
  IOEcception - is thrown for all other flush errors.



getBlocking
boolean getBlocking()(Code)
Query blocking mode.



getBufferSize
int getBufferSize()(Code)
Query buffer size



getBuffering
int getBuffering()(Code)
Query buffering mode.



getChanName
String getChanName()(Code)
Gets the chanName that is the key for the chanTable hashtable. channelId



getChanType
abstract String getChanType()(Code)
Return a string that describes the channel type. This is the equivilent of the Tcl_ChannelType->typeName field.



getEncoding
String getEncoding()(Code)
Query encoding Name of Channel's Java encoding (null if no encoding)



getInputEofChar
char getInputEofChar()(Code)
Query input eof character



getInputStream
abstract protected InputStream getInputStream() throws IOException(Code)
This method should be overridden in the subclass to provide a channel specific InputStream object.



getInputTranslation
int getInputTranslation()(Code)
Query input translation



getNumBufferedInputBytes
int getNumBufferedInputBytes()(Code)



getNumBufferedOutputBytes
int getNumBufferedOutputBytes()(Code)



getOutputEofChar
char getOutputEofChar()(Code)
Query output eof character



getOutputStream
abstract protected OutputStream getOutputStream() throws IOException(Code)
This method should be overridden in the subclass to provide a channel specific OutputStream object.



getOutputTranslation
int getOutputTranslation()(Code)
Query output translation



getRefCount
int getRefCount()(Code)
Return number of references to this Channel.



initInput
protected void initInput() throws IOException(Code)
Setup the TclInputStream on the first call to read



initOutput
protected void initOutput() throws IOException(Code)
Setup the TclOutputStream on the first call to write



inputSawCR
boolean inputSawCR()(Code)
Channel is in CRLF eol input translation mode and the last byte seen was a CR.



isBgFlushScheduled
boolean isBgFlushScheduled()(Code)
Returns true if a background flush is waiting to happen.



isBlocked
boolean isBlocked(Interp interp) throws TclException(Code)
Tcl_InputBlocked -> isBlocked Returns true if input is blocked on this channel, false otherwise.



isReadOnly
boolean isReadOnly()(Code)



isReadWrite
boolean isReadWrite()(Code)



isWriteOnly
boolean isWriteOnly()(Code)



read
int read(Interp interp, TclObject tobj, int readType, int numBytes) throws IOException, TclException(Code)
Tcl_ReadChars -> read Read data from the Channel into the given TclObject.
Parameters:
  interp - is used for TclExceptions.
Parameters:
  tobj - the object data will be added to.
Parameters:
  readType - specifies if the read should read the entirebuffer (TclIO.READ_ALL), the next line(TclIO.READ_LINE), of a specified numberof bytes (TclIO.READ_N_BYTES).
Parameters:
  numBytes - the number of bytes/chars to read. Used onlywhen the readType is TclIO.READ_N_BYTES. the number of bytes read.Returns -1 on EOF or on error.
exception:
  TclException - is thrown if read occurs on WRONLY channel.
exception:
  IOException - is thrown when an IO error occurs that was notcorrectly tested for. Most cases should be caught.



seek
void seek(Interp interp, long offset, int mode) throws IOException, TclException(Code)
Move the current file pointer. If seek is not supported on the given channel then -1 will be returned. A subclass should override this method if it supports the seek operation.
Parameters:
  interp - currrent interpreter.
Parameters:
  offset - The number of bytes to move the file pointer.
Parameters:
  mode - where to begin incrementing the file pointer; beginning,current, end.



setBlocking
void setBlocking(boolean inBlocking)(Code)
Set blocking mode.
Parameters:
  blocking - new blocking mode



setBufferSize
void setBufferSize(int size)(Code)
Tcl_SetChannelBufferSize -> setBufferSize
Parameters:
  size - new buffer size



setBuffering
void setBuffering(int inBuffering)(Code)
Set buffering mode
Parameters:
  buffering - One of TclIO.BUFF_FULL, TclIO.BUFF_LINE,or TclIO.BUFF_NONE



setChanName
void setChanName(String chan)(Code)
Sets the chanName that is the key for the chanTable hashtable.
Parameters:
  chan - the unique channelId



setEncoding
void setEncoding(String inEncoding)(Code)
Set new Java encoding



setInputEofChar
void setInputEofChar(char inEof)(Code)
Set new input eof character



setInputTranslation
void setInputTranslation(int translation)(Code)
Set new input translation



setOutputEofChar
void setOutputEofChar(char outEof)(Code)
Set new output eof character



setOutputTranslation
void setOutputTranslation(int translation)(Code)
Set new output translation



tell
long tell() throws IOException(Code)
Return the current file pointer. If tell is not supported on the given channel then -1 will be returned. A subclass should override this method if it supports the tell operation.



write
void write(Interp interp, TclObject outData) throws IOException, TclException(Code)
Tcl_WriteObj -> write Write data to the Channel
Parameters:
  interp - is used for TclExceptions.
Parameters:
  outData - the TclObject that holds the data to write.



write
void write(Interp interp, String outStr) throws IOException, TclException(Code)
Tcl_WriteChars -> write Write string data to the Channel.
Parameters:
  interp - is used for TclExceptions.
Parameters:
  outStr - the String object to write.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.