You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2009/04/27 20:39:25 UTC
svn commit: r769094 [2/2] - in
/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset:
./ spi/
Modified: harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CoderResult.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CoderResult.java?rev=769094&r1=769093&r2=769094&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CoderResult.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CoderResult.java Mon Apr 27 18:39:23 2009
@@ -26,21 +26,20 @@
* Used to indicate the result of encoding/decoding. There are four types of
* results:
* <ol>
- * <li>UNDERFLOW indicates all input has been processed, or more input is
+ * <li>UNDERFLOW indicates that all input has been processed but more input is
* required. It is represented by the unique object
* <code>CoderResult.UNDERFLOW</code>.
- * <li>OVERFLOW indicates insufficient output buffer. It is represented by the
- * unique object <code>CoderResult.OVERFLOW</code>.
- * <li>A malformed-input error indicates an unrecognizable sequence of input
- * units has been encountered. Get an instance of this type of result by calling
- * <code>CoderResult.malformedForLength(int)</code> with the length of the
- * malformed-input.
- * <li>An unmappable-character error indicates a sequence of input units can
- * not be mapped to the output charset. Get an instance of this type of result
- * by calling <code>CoderResult.unmappableForLength(int)</code> with the input
- * sequence size indicating the identity of the unmappable character.
+ * <li>OVERFLOW indicates an insufficient output buffer size. It is represented
+ * by the unique object <code>CoderResult.OVERFLOW</code>.
+ * <li>A malformed-input error indicates that an unrecognizable sequence of
+ * input units has been encountered. Get an instance of this type of result by
+ * calling <code>CoderResult.malformedForLength(int)</code> with the length of
+ * the malformed-input.
+ * <li>An unmappable-character error indicates that a sequence of input units
+ * can not be mapped to the output charset. Get an instance of this type of
+ * result by calling <code>CoderResult.unmappableForLength(int)</code> with
+ * the input sequence size indicating the identity of the unmappable character.
* </ol>
- *
*/
public class CoderResult {
@@ -64,8 +63,8 @@
0);
/**
- * Result object used to signify that the out buffer does not have enough
- * space available in it to store the result of the encoding/decoding.
+ * Result object used to indicate that the output buffer does not have
+ * enough space available to store the result of the encoding/decoding.
*/
public static final CoderResult OVERFLOW = new CoderResult(TYPE_OVERFLOW, 0);
@@ -81,14 +80,14 @@
*/
private static WeakHashMap<Integer, CoderResult> _unmappableErrors = new WeakHashMap<Integer, CoderResult>();
- // the type this result
+ // the type of this result
private final int type;
// the length of the erroneous input
private final int length;
/**
- * Construct a <code>CoderResult</code> object with its text description.
+ * Constructs a <code>CoderResult</code> object with its text description.
*
* @param type
* the type of this result
@@ -106,11 +105,11 @@
* error.
*
* @param length
- * the length of the malformed-input
+ * the length of the malformed-input.
* @return a <code>CoderResult</code> object indicating a malformed-input
- * error
+ * error.
* @throws IllegalArgumentException
- * If <code>length</code> is non-positive.
+ * if <code>length</code> is non-positive.
*/
public static synchronized CoderResult malformedForLength(int length)
throws IllegalArgumentException {
@@ -136,11 +135,11 @@
*
* @param length
* the length of the input unit sequence denoting the unmappable
- * character
+ * character.
* @return a <code>CoderResult</code> object indicating an unmappable
- * character error
+ * character error.
* @throws IllegalArgumentException
- * If <code>length</code> is non-positive.
+ * if <code>length</code> is non-positive.
*/
public static synchronized CoderResult unmappableForLength(int length)
throws IllegalArgumentException {
@@ -161,20 +160,20 @@
}
/**
- * Answers true if this result is an underflow condition.
+ * Returns true if this result is an underflow condition.
*
- * @return true if an underflow, otherwise false
+ * @return true if an underflow, otherwise false.
*/
public boolean isUnderflow() {
return this.type == TYPE_UNDERFLOW;
}
/**
- * Answers true if this result represents a malformed-input error or an
+ * Returns true if this result represents a malformed-input error or an
* unmappable-character error.
*
- * @return true if a malformed-input error or an unmappable-character error,
- * otherwise false
+ * @return true if this is a malformed-input error or an
+ * unmappable-character error, otherwise false.
*/
public boolean isError() {
return this.type == TYPE_MALFORMED_INPUT
@@ -182,27 +181,27 @@
}
/**
- * Answers true if this result represents a malformed-input error.
+ * Returns true if this result represents a malformed-input error.
*
- * @return true if a malformed-input error, otherwise false
+ * @return true if this is a malformed-input error, otherwise false.
*/
public boolean isMalformed() {
return this.type == TYPE_MALFORMED_INPUT;
}
/**
- * Answers true if this result is an overflow condition.
+ * Returns true if this result is an overflow condition.
*
- * @return true if an overflow, otherwise false
+ * @return true if this is an overflow, otherwise false.
*/
public boolean isOverflow() {
return this.type == TYPE_OVERFLOW;
}
/**
- * Answers true if this result represents an unmappable-character error.
+ * Returns true if this result represents an unmappable-character error.
*
- * @return true if an unmappable-character error, otherwise false
+ * @return true if this is an unmappable-character error, otherwise false.
*/
public boolean isUnmappable() {
return this.type == TYPE_UNMAPPABLE_CHAR;
@@ -212,9 +211,9 @@
* Gets the length of the erroneous input. The length is only meaningful to
* a malformed-input error or an unmappble character error.
*
- * @return the length, as an integer, of this object's erroneous input
+ * @return the length, as an integer, of this object's erroneous input.
* @throws UnsupportedOperationException
- * If this result is an overflow or underflow.
+ * if this result is an overflow or underflow.
*/
public int length() throws UnsupportedOperationException {
if (this.type == TYPE_MALFORMED_INPUT
@@ -231,15 +230,15 @@
* Throws an exception corresponding to this coder result.
*
* @throws BufferUnderflowException
- * If an underflow.
+ * in case this is an underflow.
* @throws BufferOverflowException
- * If an overflow.
+ * in case this is an overflow.
* @throws UnmappableCharacterException
- * If an unmappable-character error.
+ * in case this is an unmappable-character error.
* @throws MalformedInputException
- * If a malformed-input error.
+ * in case this is a malformed-input error.
* @throws CharacterCodingException
- * The default exception.
+ * the default exception.
*/
public void throwException() throws BufferUnderflowException,
BufferOverflowException, UnmappableCharacterException,
@@ -261,7 +260,7 @@
/**
* Returns a text description of this result.
*
- * @return a text description of this result
+ * @return a text description of this result.
*/
@Override
public String toString() {
Modified: harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CodingErrorAction.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CodingErrorAction.java?rev=769094&r1=769093&r2=769094&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CodingErrorAction.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/CodingErrorAction.java Mon Apr 27 18:39:23 2009
@@ -18,27 +18,28 @@
/**
* Used to indicate what kind of actions to take in case of encoding/decoding
- * errors. Currently three actions are defined, namely, IGNORE, REPLACE and
- * REPORT.
+ * errors. Currently three actions are defined: {@code IGNORE}, {@code REPLACE}
+ * and {@code REPORT}.
*/
public class CodingErrorAction {
/**
- * Indicating the action to ignore any errors.
+ * Denotes the action to ignore any errors.
*/
public static final CodingErrorAction IGNORE = new CodingErrorAction(
"IGNORE"); //$NON-NLS-1$
/**
- * Indicating the action to fill in the output with a replacement character
+ * Denotes the action to fill in the output with a replacement character
* when malformed input or an unmappable character is encountered.
*/
public static final CodingErrorAction REPLACE = new CodingErrorAction(
"REPLACE"); //$NON-NLS-1$
/**
- * Indicating the action to report the encountered error in an appropriate
- * manner, for example, throw an exception or return an informative result.
+ * Denotes the action to report the encountered error in an appropriate
+ * manner, for example to throw an exception or return an informative
+ * result.
*/
public static final CodingErrorAction REPORT = new CodingErrorAction(
"REPORT"); //$NON-NLS-1$
@@ -54,7 +55,7 @@
}
/**
- * Returns a text description of this action indication..
+ * Returns a text description of this action indication.
*
* @return a text description of this action indication.
*/
Modified: harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/IllegalCharsetNameException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/IllegalCharsetNameException.java?rev=769094&r1=769093&r2=769094&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/IllegalCharsetNameException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/IllegalCharsetNameException.java Mon Apr 27 18:39:23 2009
@@ -20,7 +20,8 @@
import org.apache.harmony.niochar.internal.nls.Messages;
/**
- * Thrown when an illegal charset name is encountered.
+ * An {@code IllegalCharsetNameException} is thrown when an illegal charset name
+ * is encountered.
*/
public class IllegalCharsetNameException extends IllegalArgumentException {
@@ -34,10 +35,11 @@
private String charsetName;
/**
- * Constructs an instance of this exception with the supplied charset name.
+ * Constructs a new {@code IllegalCharsetNameException} with the supplied
+ * charset name.
*
* @param charset
- * the encountered illegal charset name
+ * the encountered illegal charset name.
*/
public IllegalCharsetNameException(String charset) {
// niochar.0F=The illegal charset name is "{0}".
@@ -48,7 +50,7 @@
/**
* Gets the encountered illegal charset name.
*
- * @return the encountered illegal charset name
+ * @return the encountered illegal charset name.
*/
public String getCharsetName() {
return this.charsetName;
Modified: harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/MalformedInputException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/MalformedInputException.java?rev=769094&r1=769093&r2=769094&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/MalformedInputException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/MalformedInputException.java Mon Apr 27 18:39:23 2009
@@ -20,8 +20,8 @@
import org.apache.harmony.niochar.internal.nls.Messages;
/**
- * Thrown when a malformed input is encountered, for example, a byte sequence is
- * illegal for the given charset.
+ * A {@code MalformedInputException} is thrown when a malformed input is
+ * encountered, for example if a byte sequence is illegal for the given charset.
*/
public class MalformedInputException extends CharacterCodingException {
@@ -35,10 +35,10 @@
private int inputLength;
/**
- * Constructs an instance of this exception.
+ * Constructs a new {@code MalformedInputException}.
*
* @param length
- * the length of the malformed input
+ * the length of the malformed input.
*/
public MalformedInputException(int length) {
this.inputLength = length;
@@ -47,7 +47,7 @@
/**
* Gets the length of the malformed input.
*
- * @return the length of the malformed input
+ * @return the length of the malformed input.
*/
public int getInputLength() {
return this.inputLength;
@@ -56,7 +56,7 @@
/**
* Gets a message describing this exception.
*
- * @return a message describing this exception
+ * @return a message describing this exception.
*/
@Override
public String getMessage() {
Modified: harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnmappableCharacterException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnmappableCharacterException.java?rev=769094&r1=769093&r2=769094&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnmappableCharacterException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnmappableCharacterException.java Mon Apr 27 18:39:23 2009
@@ -20,7 +20,8 @@
import org.apache.harmony.niochar.internal.nls.Messages;
/**
- * Thrown when an unmappable character for the given charset is encountered.
+ * An {@code UnmappableCharacterException} is thrown when an unmappable
+ * character for the given charset is encountered.
*/
public class UnmappableCharacterException extends CharacterCodingException {
@@ -34,10 +35,10 @@
private int inputLength;
/**
- * Constructs an instance of this exception.
+ * Constructs a new {@code UnmappableCharacterException}.
*
* @param length
- * the length of the unmappable character
+ * the length of the unmappable character.
*/
public UnmappableCharacterException(int length) {
this.inputLength = length;
@@ -46,7 +47,7 @@
/**
* Gets the length of the unmappable character.
*
- * @return the length of the unmappable character
+ * @return the length of the unmappable character.
*/
public int getInputLength() {
return this.inputLength;
@@ -55,7 +56,7 @@
/**
* Gets a message describing this exception.
*
- * @return a message describing this exception
+ * @return a message describing this exception.
*/
@Override
public String getMessage() {
Modified: harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnsupportedCharsetException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnsupportedCharsetException.java?rev=769094&r1=769093&r2=769094&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnsupportedCharsetException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/UnsupportedCharsetException.java Mon Apr 27 18:39:23 2009
@@ -20,7 +20,8 @@
import org.apache.harmony.niochar.internal.nls.Messages;
/**
- * Thrown when an unsupported charset name is encountered.
+ * An {@code UnsupportedCharsetException} is thrown when an unsupported charset
+ * name is encountered.
*/
public class UnsupportedCharsetException extends IllegalArgumentException {
@@ -34,10 +35,11 @@
private String charsetName;
/**
- * Constructs an instance of this exception with the supplied charset name.
+ * Constructs a new {@code UnsupportedCharsetException} with the supplied
+ * charset name.
*
* @param charset
- * the encountered unsupported charset name
+ * the encountered unsupported charset name.
*/
public UnsupportedCharsetException(String charset) {
// niochar.04=The unsupported charset name is "{0}".
@@ -48,7 +50,7 @@
/**
* Gets the encountered unsupported charset name.
*
- * @return the encountered unsupported charset name
+ * @return the encountered unsupported charset name.
*/
public String getCharsetName() {
return this.charsetName;
Modified: harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/spi/CharsetProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/spi/CharsetProvider.java?rev=769094&r1=769093&r2=769094&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/spi/CharsetProvider.java (original)
+++ harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/spi/CharsetProvider.java Mon Apr 27 18:39:23 2009
@@ -42,14 +42,14 @@
}
/**
- * Answers an iterator over all the available charsets.
+ * Returns an iterator over all the available charsets.
*
* @return the iterator.
*/
public abstract Iterator<Charset> charsets();
/**
- * Answers the named charset.
+ * Returns the named charset.
* <p>
* If the charset is unavailable the method returns <code>null</code>.
*