Class TextIO.ForCharset

An implementation of TextIO class that writes and reads text files
in encodings specified by their names (as the second argument of
InputStreamReader and OutputStreamWriter constructors).
You can create an instance of this class for any desired encoding by the
getInstance(String) method or use one of the following constants declared
in TextIO class:

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Method Detail

charsetName

public java.lang.String charsetName()

Returns the name of the encoding used by this instance. The returned name
is the canonical name for java.io and java.lang API.
(java.nio API uses another names: see
"supported
encodings" Sun's page for more details.)

Returns:

canonical name of the used encoding (for java.io and java.lang API)

getInstance

Creates a new instance of this class that will write and read text files
in the encoding specified by charsetName argument.
charsetName should be the canonical encoding name for
java.io and java.lang API.
(java.nio API uses another names: see
"supported
encodings" Sun's page for more details.)

Parameters:

charsetName - canonical name of the encoding that will be used by new instance

Returns:

the new created instance of this class

Throws:

java.io.UnsupportedEncodingException - if the given encoding is not supported

toString

public java.lang.String toString()

Returns a string representation of this object.
This method is intended to be used only for debugging purposes,
and the content and format of the returned string may vary between
implementations.
The returned string may be empty but may not be null.

Overrides:

toString in class java.lang.Object

Returns:

a string representation of this rectangle

hashCode

public int hashCode()

Returns the hash code for this instance.

Overrides:

hashCode in class java.lang.Object

Returns:

a hash code for this instance

equals

public boolean equals(java.lang.Object obj)

Determines whether or not two instances are equal.
Two instances of ForCharset are equal if they
have equal encoding names.

Overrides:

equals in class java.lang.Object

Parameters:

obj - an object to be compared with this Rect

Returns:

true if the object to be compared is an instance of
ForCharset and has the same encoding name