7132338: Use @code friendly idiom for '\' in javadoc

Reviewed-by: alanb
This commit is contained in:
Joe Darcy 2012-01-23 12:17:30 -08:00
parent 20acbf2a93
commit 032af13e8b
13 changed files with 902 additions and 903 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,12 +26,12 @@
package java.io;
/**
* The <code>DataInput</code> interface provides
* The {@code DataInput} interface provides
* for reading bytes from a binary stream and
* reconstructing from them data in any of
* the Java primitive types. There is also
* a
* facility for reconstructing a <code>String</code>
* facility for reconstructing a {@code String}
* from data in
* <a href="#modified-utf-8">modified UTF-8</a>
* format.
@ -39,12 +39,12 @@ package java.io;
* It is generally true of all the reading
* routines in this interface that if end of
* file is reached before the desired number
* of bytes has been read, an <code>EOFException</code>
* (which is a kind of <code>IOException</code>)
* of bytes has been read, an {@code EOFException}
* (which is a kind of {@code IOException})
* is thrown. If any byte cannot be read for
* any reason other than end of file, an <code>IOException</code>
* other than <code>EOFException</code> is
* thrown. In particular, an <code>IOException</code>
* any reason other than end of file, an {@code IOException}
* other than {@code EOFException} is
* thrown. In particular, an {@code IOException}
* may be thrown if the input stream has been
* closed.
*
@ -58,8 +58,8 @@ package java.io;
* Note that in the following tables, the most significant bit appears in the
* far left-hand column.
* <p>
* All characters in the range <code>'&#92;u0001'</code> to
* <code>'&#92;u007F'</code> are represented by a single byte:
* All characters in the range {@code '\u005Cu0001'} to
* {@code '\u005Cu007F'} are represented by a single byte:
*
* <blockquote>
* <table border="1" cellspacing="0" cellpadding="8" width="50%"
@ -83,8 +83,8 @@ package java.io;
* </blockquote>
*
* <p>
* The null character <code>'&#92;u0000'</code> and characters in the
* range <code>'&#92;u0080'</code> to <code>'&#92;u07FF'</code> are
* The null character {@code '\u005Cu0000'} and characters in the
* range {@code '\u005Cu0080'} to {@code '\u005Cu07FF'} are
* represented by a pair of bytes:
*
* <blockquote>
@ -123,8 +123,8 @@ package java.io;
* </blockquote>
*
* <br>
* <code>char</code> values in the range <code>'&#92;u0800'</code> to
* <code>'&#92;uFFFF'</code> are represented by three bytes:
* {@code char} values in the range {@code '\u005Cu0800'} to
* {@code '\u005CuFFFF'} are represented by three bytes:
*
* <blockquote>
* <table border="1" cellspacing="0" cellpadding="8" width="50%"
@ -178,7 +178,7 @@ package java.io;
* The differences between this format and the
* standard UTF-8 format are the following:
* <ul>
* <li>The null byte <code>'&#92;u0000'</code> is encoded in 2-byte format
* <li>The null byte {@code '\u005Cu0000'} is encoded in 2-byte format
* rather than 1-byte, so that the encoded strings never have
* embedded nulls.
* <li>Only the 1-byte, 2-byte, and 3-byte formats are used.
@ -195,36 +195,36 @@ interface DataInput {
/**
* Reads some bytes from an input
* stream and stores them into the buffer
* array <code>b</code>. The number of bytes
* array {@code b}. The number of bytes
* read is equal
* to the length of <code>b</code>.
* to the length of {@code b}.
* <p>
* This method blocks until one of the
* following conditions occurs:<p>
* <ul>
* <li><code>b.length</code>
* <li>{@code b.length}
* bytes of input data are available, in which
* case a normal return is made.
*
* <li>End of
* file is detected, in which case an <code>EOFException</code>
* file is detected, in which case an {@code EOFException}
* is thrown.
*
* <li>An I/O error occurs, in
* which case an <code>IOException</code> other
* than <code>EOFException</code> is thrown.
* which case an {@code IOException} other
* than {@code EOFException} is thrown.
* </ul>
* <p>
* If <code>b</code> is <code>null</code>,
* a <code>NullPointerException</code> is thrown.
* If <code>b.length</code> is zero, then
* If {@code b} is {@code null},
* a {@code NullPointerException} is thrown.
* If {@code b.length} is zero, then
* no bytes are read. Otherwise, the first
* byte read is stored into element <code>b[0]</code>,
* the next one into <code>b[1]</code>, and
* byte read is stored into element {@code b[0]},
* the next one into {@code b[1]}, and
* so on.
* If an exception is thrown from
* this method, then it may be that some but
* not all bytes of <code>b</code> have been
* not all bytes of {@code b} have been
* updated with data from the input stream.
*
* @param b the buffer into which the data is read.
@ -236,7 +236,7 @@ interface DataInput {
/**
*
* Reads <code>len</code>
* Reads {@code len}
* bytes from
* an input stream.
* <p>
@ -244,32 +244,32 @@ interface DataInput {
* blocks until one of the following conditions
* occurs:<p>
* <ul>
* <li><code>len</code> bytes
* <li>{@code len} bytes
* of input data are available, in which case
* a normal return is made.
*
* <li>End of file
* is detected, in which case an <code>EOFException</code>
* is detected, in which case an {@code EOFException}
* is thrown.
*
* <li>An I/O error occurs, in
* which case an <code>IOException</code> other
* than <code>EOFException</code> is thrown.
* which case an {@code IOException} other
* than {@code EOFException} is thrown.
* </ul>
* <p>
* If <code>b</code> is <code>null</code>,
* a <code>NullPointerException</code> is thrown.
* If <code>off</code> is negative, or <code>len</code>
* is negative, or <code>off+len</code> is
* greater than the length of the array <code>b</code>,
* then an <code>IndexOutOfBoundsException</code>
* If {@code b} is {@code null},
* a {@code NullPointerException} is thrown.
* If {@code off} is negative, or {@code len}
* is negative, or {@code off+len} is
* greater than the length of the array {@code b},
* then an {@code IndexOutOfBoundsException}
* is thrown.
* If <code>len</code> is zero,
* If {@code len} is zero,
* then no bytes are read. Otherwise, the first
* byte read is stored into element <code>b[off]</code>,
* the next one into <code>b[off+1]</code>,
* byte read is stored into element {@code b[off]},
* the next one into {@code b[off+1]},
* and so on. The number of bytes read is,
* at most, equal to <code>len</code>.
* at most, equal to {@code len}.
*
* @param b the buffer into which the data is read.
* @param off an int specifying the offset into the data.
@ -282,7 +282,7 @@ interface DataInput {
/**
* Makes an attempt to skip over
* <code>n</code> bytes
* {@code n} bytes
* of data from the input
* stream, discarding the skipped bytes. However,
* it may skip
@ -290,10 +290,10 @@ interface DataInput {
* bytes, possibly zero. This may result from
* any of a
* number of conditions; reaching
* end of file before <code>n</code> bytes
* end of file before {@code n} bytes
* have been skipped is
* only one possibility.
* This method never throws an <code>EOFException</code>.
* This method never throws an {@code EOFException}.
* The actual
* number of bytes skipped is returned.
*
@ -305,13 +305,13 @@ interface DataInput {
/**
* Reads one input byte and returns
* <code>true</code> if that byte is nonzero,
* <code>false</code> if that byte is zero.
* {@code true} if that byte is nonzero,
* {@code false} if that byte is zero.
* This method is suitable for reading
* the byte written by the <code>writeBoolean</code>
* method of interface <code>DataOutput</code>.
* the byte written by the {@code writeBoolean}
* method of interface {@code DataOutput}.
*
* @return the <code>boolean</code> value read.
* @return the {@code boolean} value read.
* @exception EOFException if this stream reaches the end before reading
* all the bytes.
* @exception IOException if an I/O error occurs.
@ -321,11 +321,11 @@ interface DataInput {
/**
* Reads and returns one input byte.
* The byte is treated as a signed value in
* the range <code>-128</code> through <code>127</code>,
* the range {@code -128} through {@code 127},
* inclusive.
* This method is suitable for
* reading the byte written by the <code>writeByte</code>
* method of interface <code>DataOutput</code>.
* reading the byte written by the {@code writeByte}
* method of interface {@code DataOutput}.
*
* @return the 8-bit value read.
* @exception EOFException if this stream reaches the end before reading
@ -336,16 +336,16 @@ interface DataInput {
/**
* Reads one input byte, zero-extends
* it to type <code>int</code>, and returns
* it to type {@code int}, and returns
* the result, which is therefore in the range
* <code>0</code>
* through <code>255</code>.
* {@code 0}
* through {@code 255}.
* This method is suitable for reading
* the byte written by the <code>writeByte</code>
* method of interface <code>DataOutput</code>
* if the argument to <code>writeByte</code>
* the byte written by the {@code writeByte}
* method of interface {@code DataOutput}
* if the argument to {@code writeByte}
* was intended to be a value in the range
* <code>0</code> through <code>255</code>.
* {@code 0} through {@code 255}.
*
* @return the unsigned 8-bit value read.
* @exception EOFException if this stream reaches the end before reading
@ -356,8 +356,8 @@ interface DataInput {
/**
* Reads two input bytes and returns
* a <code>short</code> value. Let <code>a</code>
* be the first byte read and <code>b</code>
* a {@code short} value. Let {@code a}
* be the first byte read and {@code b}
* be the second byte. The value
* returned
* is:
@ -365,8 +365,8 @@ interface DataInput {
* </code></pre>
* This method
* is suitable for reading the bytes written
* by the <code>writeShort</code> method of
* interface <code>DataOutput</code>.
* by the {@code writeShort} method of
* interface {@code DataOutput}.
*
* @return the 16-bit value read.
* @exception EOFException if this stream reaches the end before reading
@ -377,19 +377,19 @@ interface DataInput {
/**
* Reads two input bytes and returns
* an <code>int</code> value in the range <code>0</code>
* through <code>65535</code>. Let <code>a</code>
* an {@code int} value in the range {@code 0}
* through {@code 65535}. Let {@code a}
* be the first byte read and
* <code>b</code>
* {@code b}
* be the second byte. The value returned is:
* <p><pre><code>(((a &amp; 0xff) &lt;&lt; 8) | (b &amp; 0xff))
* </code></pre>
* This method is suitable for reading the bytes
* written by the <code>writeShort</code> method
* of interface <code>DataOutput</code> if
* the argument to <code>writeShort</code>
* written by the {@code writeShort} method
* of interface {@code DataOutput} if
* the argument to {@code writeShort}
* was intended to be a value in the range
* <code>0</code> through <code>65535</code>.
* {@code 0} through {@code 65535}.
*
* @return the unsigned 16-bit value read.
* @exception EOFException if this stream reaches the end before reading
@ -399,19 +399,19 @@ interface DataInput {
int readUnsignedShort() throws IOException;
/**
* Reads two input bytes and returns a <code>char</code> value.
* Let <code>a</code>
* be the first byte read and <code>b</code>
* Reads two input bytes and returns a {@code char} value.
* Let {@code a}
* be the first byte read and {@code b}
* be the second byte. The value
* returned is:
* <p><pre><code>(char)((a &lt;&lt; 8) | (b &amp; 0xff))
* </code></pre>
* This method
* is suitable for reading bytes written by
* the <code>writeChar</code> method of interface
* <code>DataOutput</code>.
* the {@code writeChar} method of interface
* {@code DataOutput}.
*
* @return the <code>char</code> value read.
* @return the {@code char} value read.
* @exception EOFException if this stream reaches the end before reading
* all the bytes.
* @exception IOException if an I/O error occurs.
@ -420,18 +420,17 @@ interface DataInput {
/**
* Reads four input bytes and returns an
* <code>int</code> value. Let <code>a-d</code>
* {@code int} value. Let {@code a-d}
* be the first through fourth bytes read. The value returned is:
* <p><pre>
* <code>
* <p><pre><code>
* (((a &amp; 0xff) &lt;&lt; 24) | ((b &amp; 0xff) &lt;&lt; 16) |
* &#32;((c &amp; 0xff) &lt;&lt; 8) | (d &amp; 0xff))
* </code></pre>
* This method is suitable
* for reading bytes written by the <code>writeInt</code>
* method of interface <code>DataOutput</code>.
* for reading bytes written by the {@code writeInt}
* method of interface {@code DataOutput}.
*
* @return the <code>int</code> value read.
* @return the {@code int} value read.
* @exception EOFException if this stream reaches the end before reading
* all the bytes.
* @exception IOException if an I/O error occurs.
@ -440,10 +439,10 @@ interface DataInput {
/**
* Reads eight input bytes and returns
* a <code>long</code> value. Let <code>a-h</code>
* a {@code long} value. Let {@code a-h}
* be the first through eighth bytes read.
* The value returned is:
* <p><pre> <code>
* <p><pre><code>
* (((long)(a &amp; 0xff) &lt;&lt; 56) |
* ((long)(b &amp; 0xff) &lt;&lt; 48) |
* ((long)(c &amp; 0xff) &lt;&lt; 40) |
@ -455,10 +454,10 @@ interface DataInput {
* </code></pre>
* <p>
* This method is suitable
* for reading bytes written by the <code>writeLong</code>
* method of interface <code>DataOutput</code>.
* for reading bytes written by the {@code writeLong}
* method of interface {@code DataOutput}.
*
* @return the <code>long</code> value read.
* @return the {@code long} value read.
* @exception EOFException if this stream reaches the end before reading
* all the bytes.
* @exception IOException if an I/O error occurs.
@ -467,18 +466,18 @@ interface DataInput {
/**
* Reads four input bytes and returns
* a <code>float</code> value. It does this
* by first constructing an <code>int</code>
* a {@code float} value. It does this
* by first constructing an {@code int}
* value in exactly the manner
* of the <code>readInt</code>
* method, then converting this <code>int</code>
* value to a <code>float</code> in
* exactly the manner of the method <code>Float.intBitsToFloat</code>.
* of the {@code readInt}
* method, then converting this {@code int}
* value to a {@code float} in
* exactly the manner of the method {@code Float.intBitsToFloat}.
* This method is suitable for reading
* bytes written by the <code>writeFloat</code>
* method of interface <code>DataOutput</code>.
* bytes written by the {@code writeFloat}
* method of interface {@code DataOutput}.
*
* @return the <code>float</code> value read.
* @return the {@code float} value read.
* @exception EOFException if this stream reaches the end before reading
* all the bytes.
* @exception IOException if an I/O error occurs.
@ -487,18 +486,18 @@ interface DataInput {
/**
* Reads eight input bytes and returns
* a <code>double</code> value. It does this
* by first constructing a <code>long</code>
* a {@code double} value. It does this
* by first constructing a {@code long}
* value in exactly the manner
* of the <code>readlong</code>
* method, then converting this <code>long</code>
* value to a <code>double</code> in exactly
* the manner of the method <code>Double.longBitsToDouble</code>.
* of the {@code readlong}
* method, then converting this {@code long}
* value to a {@code double} in exactly
* the manner of the method {@code Double.longBitsToDouble}.
* This method is suitable for reading
* bytes written by the <code>writeDouble</code>
* method of interface <code>DataOutput</code>.
* bytes written by the {@code writeDouble}
* method of interface {@code DataOutput}.
*
* @return the <code>double</code> value read.
* @return the {@code double} value read.
* @exception EOFException if this stream reaches the end before reading
* all the bytes.
* @exception IOException if an I/O error occurs.
@ -512,35 +511,35 @@ interface DataInput {
* until it encounters a line terminator or
* end of
* file; the characters read are then
* returned as a <code>String</code>. Note
* returned as a {@code String}. Note
* that because this
* method processes bytes,
* it does not support input of the full Unicode
* character set.
* <p>
* If end of file is encountered
* before even one byte can be read, then <code>null</code>
* before even one byte can be read, then {@code null}
* is returned. Otherwise, each byte that is
* read is converted to type <code>char</code>
* by zero-extension. If the character <code>'\n'</code>
* read is converted to type {@code char}
* by zero-extension. If the character {@code '\n'}
* is encountered, it is discarded and reading
* ceases. If the character <code>'\r'</code>
* ceases. If the character {@code '\r'}
* is encountered, it is discarded and, if
* the following byte converts &#32;to the
* character <code>'\n'</code>, then that is
* character {@code '\n'}, then that is
* discarded also; reading then ceases. If
* end of file is encountered before either
* of the characters <code>'\n'</code> and
* <code>'\r'</code> is encountered, reading
* ceases. Once reading has ceased, a <code>String</code>
* of the characters {@code '\n'} and
* {@code '\r'} is encountered, reading
* ceases. Once reading has ceased, a {@code String}
* is returned that contains all the characters
* read and not discarded, taken in order.
* Note that every character in this string
* will have a value less than <code>&#92;u0100</code>,
* that is, <code>(char)256</code>.
* will have a value less than {@code \u005Cu0100},
* that is, {@code (char)256}.
*
* @return the next line of text from the input stream,
* or <CODE>null</CODE> if the end of file is
* or {@code null} if the end of file is
* encountered before a byte can be read.
* @exception IOException if an I/O error occurs.
*/
@ -550,15 +549,15 @@ interface DataInput {
* Reads in a string that has been encoded using a
* <a href="#modified-utf-8">modified UTF-8</a>
* format.
* The general contract of <code>readUTF</code>
* The general contract of {@code readUTF}
* is that it reads a representation of a Unicode
* character string encoded in modified
* UTF-8 format; this string of characters
* is then returned as a <code>String</code>.
* is then returned as a {@code String}.
* <p>
* First, two bytes are read and used to
* construct an unsigned 16-bit integer in
* exactly the manner of the <code>readUnsignedShort</code>
* exactly the manner of the {@code readUnsignedShort}
* method . This integer value is called the
* <i>UTF length</i> and specifies the number
* of additional bytes to be read. These bytes
@ -570,58 +569,58 @@ interface DataInput {
* next group.
* <p>
* If the first byte of a group
* matches the bit pattern <code>0xxxxxxx</code>
* (where <code>x</code> means "may be <code>0</code>
* or <code>1</code>"), then the group consists
* matches the bit pattern {@code 0xxxxxxx}
* (where {@code x} means "may be {@code 0}
* or {@code 1}"), then the group consists
* of just that byte. The byte is zero-extended
* to form a character.
* <p>
* If the first byte
* of a group matches the bit pattern <code>110xxxxx</code>,
* then the group consists of that byte <code>a</code>
* and a second byte <code>b</code>. If there
* is no byte <code>b</code> (because byte
* <code>a</code> was the last of the bytes
* to be read), or if byte <code>b</code> does
* not match the bit pattern <code>10xxxxxx</code>,
* then a <code>UTFDataFormatException</code>
* of a group matches the bit pattern {@code 110xxxxx},
* then the group consists of that byte {@code a}
* and a second byte {@code b}. If there
* is no byte {@code b} (because byte
* {@code a} was the last of the bytes
* to be read), or if byte {@code b} does
* not match the bit pattern {@code 10xxxxxx},
* then a {@code UTFDataFormatException}
* is thrown. Otherwise, the group is converted
* to the character:<p>
* <pre><code>(char)(((a&amp; 0x1F) &lt;&lt; 6) | (b &amp; 0x3F))
* </code></pre>
* If the first byte of a group
* matches the bit pattern <code>1110xxxx</code>,
* then the group consists of that byte <code>a</code>
* and two more bytes <code>b</code> and <code>c</code>.
* If there is no byte <code>c</code> (because
* byte <code>a</code> was one of the last
* matches the bit pattern {@code 1110xxxx},
* then the group consists of that byte {@code a}
* and two more bytes {@code b} and {@code c}.
* If there is no byte {@code c} (because
* byte {@code a} was one of the last
* two of the bytes to be read), or either
* byte <code>b</code> or byte <code>c</code>
* does not match the bit pattern <code>10xxxxxx</code>,
* then a <code>UTFDataFormatException</code>
* byte {@code b} or byte {@code c}
* does not match the bit pattern {@code 10xxxxxx},
* then a {@code UTFDataFormatException}
* is thrown. Otherwise, the group is converted
* to the character:<p>
* <pre><code>
* (char)(((a &amp; 0x0F) &lt;&lt; 12) | ((b &amp; 0x3F) &lt;&lt; 6) | (c &amp; 0x3F))
* </code></pre>
* If the first byte of a group matches the
* pattern <code>1111xxxx</code> or the pattern
* <code>10xxxxxx</code>, then a <code>UTFDataFormatException</code>
* pattern {@code 1111xxxx} or the pattern
* {@code 10xxxxxx}, then a {@code UTFDataFormatException}
* is thrown.
* <p>
* If end of file is encountered
* at any time during this entire process,
* then an <code>EOFException</code> is thrown.
* then an {@code EOFException} is thrown.
* <p>
* After every group has been converted to
* a character by this process, the characters
* are gathered, in the same order in which
* their corresponding groups were read from
* the input stream, to form a <code>String</code>,
* the input stream, to form a {@code String},
* which is returned.
* <p>
* The <code>writeUTF</code>
* method of interface <code>DataOutput</code>
* The {@code writeUTF}
* method of interface {@code DataOutput}
* may be used to write data that is suitable
* for reading by this method.
* @return a Unicode string.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -30,13 +30,13 @@ package java.io;
* functionality of keeping track of the current line number.
* <p>
* A line is a sequence of bytes ending with a carriage return
* character (<code>'&#92;r'</code>), a newline character
* (<code>'&#92;n'</code>), or a carriage return character followed
* character ({@code '\u005Cr'}), a newline character
* ({@code '\u005Cn'}), or a carriage return character followed
* immediately by a linefeed character. In all three cases, the line
* terminating character(s) are returned as a single newline character.
* <p>
* The line number begins at <code>0</code>, and is incremented by
* <code>1</code> when a <code>read</code> returns a newline character.
* The line number begins at {@code 0}, and is incremented by
* {@code 1} when a {@code read} returns a newline character.
*
* @author Arthur van Hoff
* @see java.io.LineNumberReader
@ -66,22 +66,22 @@ class LineNumberInputStream extends FilterInputStream {
/**
* Reads the next byte of data from this input stream. The value
* byte is returned as an <code>int</code> in the range
* <code>0</code> to <code>255</code>. If no byte is available
* byte is returned as an {@code int} in the range
* {@code 0} to {@code 255}. If no byte is available
* because the end of the stream has been reached, the value
* <code>-1</code> is returned. This method blocks until input data
* {@code -1} is returned. This method blocks until input data
* is available, the end of the stream is detected, or an exception
* is thrown.
* <p>
* The <code>read</code> method of
* <code>LineNumberInputStream</code> calls the <code>read</code>
* The {@code read} method of
* {@code LineNumberInputStream} calls the {@code read}
* method of the underlying input stream. It checks for carriage
* returns and newline characters in the input, and modifies the
* current line number as appropriate. A carriage-return character or
* a carriage return followed by a newline character are both
* converted into a single newline character.
*
* @return the next byte of data, or <code>-1</code> if the end of this
* @return the next byte of data, or {@code -1} if the end of this
* stream is reached.
* @exception IOException if an I/O error occurs.
* @see java.io.FilterInputStream#in
@ -111,18 +111,18 @@ class LineNumberInputStream extends FilterInputStream {
}
/**
* Reads up to <code>len</code> bytes of data from this input stream
* Reads up to {@code len} bytes of data from this input stream
* into an array of bytes. This method blocks until some input is available.
* <p>
* The <code>read</code> method of
* <code>LineNumberInputStream</code> repeatedly calls the
* <code>read</code> method of zero arguments to fill in the byte array.
* The {@code read} method of
* {@code LineNumberInputStream} repeatedly calls the
* {@code read} method of zero arguments to fill in the byte array.
*
* @param b the buffer into which the data is read.
* @param off the start offset of the data.
* @param len the maximum number of bytes read.
* @return the total number of bytes read into the buffer, or
* <code>-1</code> if there is no more data because the end of
* {@code -1} if there is no more data because the end of
* this stream has been reached.
* @exception IOException if an I/O error occurs.
* @see java.io.LineNumberInputStream#read()
@ -160,15 +160,15 @@ class LineNumberInputStream extends FilterInputStream {
}
/**
* Skips over and discards <code>n</code> bytes of data from this
* input stream. The <code>skip</code> method may, for a variety of
* Skips over and discards {@code n} bytes of data from this
* input stream. The {@code skip} method may, for a variety of
* reasons, end up skipping over some smaller number of bytes,
* possibly <code>0</code>. The actual number of bytes skipped is
* returned. If <code>n</code> is negative, no bytes are skipped.
* possibly {@code 0}. The actual number of bytes skipped is
* returned. If {@code n} is negative, no bytes are skipped.
* <p>
* The <code>skip</code> method of <code>LineNumberInputStream</code> creates
* The {@code skip} method of {@code LineNumberInputStream} creates
* a byte array and then repeatedly reads into it until
* <code>n</code> bytes have been read or the end of the stream has
* {@code n} bytes have been read or the end of the stream has
* been reached.
*
* @param n the number of bytes to be skipped.
@ -225,12 +225,12 @@ class LineNumberInputStream extends FilterInputStream {
* <p>
* Note that if the underlying input stream is able to supply
* <i>k</i> input characters without blocking, the
* <code>LineNumberInputStream</code> can guarantee only to provide
* {@code LineNumberInputStream} can guarantee only to provide
* <i>k</i>/2 characters without blocking, because the
* <i>k</i> characters from the underlying input stream might
* consist of <i>k</i>/2 pairs of <code>'&#92;r'</code> and
* <code>'&#92;n'</code>, which are converted to just
* <i>k</i>/2 <code>'&#92;n'</code> characters.
* consist of <i>k</i>/2 pairs of {@code '\u005Cr'} and
* {@code '\u005Cn'}, which are converted to just
* <i>k</i>/2 {@code '\u005Cn'} characters.
*
* @return the number of bytes that can be read from this input stream
* without blocking.
@ -243,12 +243,12 @@ class LineNumberInputStream extends FilterInputStream {
/**
* Marks the current position in this input stream. A subsequent
* call to the <code>reset</code> method repositions this stream at
* call to the {@code reset} method repositions this stream at
* the last marked position so that subsequent reads re-read the same bytes.
* <p>
* The <code>mark</code> method of
* <code>LineNumberInputStream</code> remembers the current line
* number in a private variable, and then calls the <code>mark</code>
* The {@code mark} method of
* {@code LineNumberInputStream} remembers the current line
* number in a private variable, and then calls the {@code mark}
* method of the underlying input stream.
*
* @param readlimit the maximum limit of bytes that can be read before
@ -264,12 +264,12 @@ class LineNumberInputStream extends FilterInputStream {
/**
* Repositions this stream to the position at the time the
* <code>mark</code> method was last called on this input stream.
* {@code mark} method was last called on this input stream.
* <p>
* The <code>reset</code> method of
* <code>LineNumberInputStream</code> resets the line number to be
* the line number at the time the <code>mark</code> method was
* called, and then calls the <code>reset</code> method of the
* The {@code reset} method of
* {@code LineNumberInputStream} resets the line number to be
* the line number at the time the {@code mark} method was
* called, and then calls the {@code reset} method of the
* underlying input stream.
* <p>
* Stream marks are intended to be used in

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -41,16 +41,16 @@ import sun.nio.ch.FileChannelImpl;
* the file pointer past the bytes written. Output operations that write
* past the current end of the implied array cause the array to be
* extended. The file pointer can be read by the
* <code>getFilePointer</code> method and set by the <code>seek</code>
* {@code getFilePointer} method and set by the {@code seek}
* method.
* <p>
* It is generally true of all the reading routines in this class that
* if end-of-file is reached before the desired number of bytes has been
* read, an <code>EOFException</code> (which is a kind of
* <code>IOException</code>) is thrown. If any byte cannot be read for
* any reason other than end-of-file, an <code>IOException</code> other
* than <code>EOFException</code> is thrown. In particular, an
* <code>IOException</code> may be thrown if the stream has been closed.
* read, an {@code EOFException} (which is a kind of
* {@code IOException}) is thrown. If any byte cannot be read for
* any reason other than end-of-file, an {@code IOException} other
* than {@code EOFException} is thrown. In particular, an
* {@code IOException} may be thrown if the stream has been closed.
*
* @author unascribed
* @since JDK1.0
@ -82,12 +82,12 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* href="#mode"><tt>RandomAccessFile(File,String)</tt></a> constructor.
*
* <p>
* If there is a security manager, its <code>checkRead</code> method
* is called with the <code>name</code> argument
* If there is a security manager, its {@code checkRead} method
* is called with the {@code name} argument
* as its argument to see if read access to the file is allowed.
* If the mode allows writing, the security manager's
* <code>checkWrite</code> method
* is also called with the <code>name</code> argument
* {@code checkWrite} method
* is also called with the {@code name} argument
* as its argument to see if write access to the file is allowed.
*
* @param name the system-dependent filename
@ -103,9 +103,9 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* that name cannot be created, or if some other error occurs
* while opening or creating the file
* @exception SecurityException if a security manager exists and its
* <code>checkRead</code> method denies read access to the file
* {@code checkRead} method denies read access to the file
* or the mode is "rw" and the security manager's
* <code>checkWrite</code> method denies write access to the file
* {@code checkWrite} method denies write access to the file
* @see java.lang.SecurityException
* @see java.lang.SecurityManager#checkRead(java.lang.String)
* @see java.lang.SecurityManager#checkWrite(java.lang.String)
@ -164,10 +164,10 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* updates to both the file's content and its metadata to be written, which
* generally requires at least one more low-level I/O operation.
*
* <p> If there is a security manager, its <code>checkRead</code> method is
* called with the pathname of the <code>file</code> argument as its
* <p> If there is a security manager, its {@code checkRead} method is
* called with the pathname of the {@code file} argument as its
* argument to see if read access to the file is allowed. If the mode
* allows writing, the security manager's <code>checkWrite</code> method is
* allows writing, the security manager's {@code checkWrite} method is
* also called with the path argument to see if write access to the file is
* allowed.
*
@ -185,9 +185,9 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* that name cannot be created, or if some other error occurs
* while opening or creating the file
* @exception SecurityException if a security manager exists and its
* <code>checkRead</code> method denies read access to the file
* {@code checkRead} method denies read access to the file
* or the mode is "rw" and the security manager's
* <code>checkWrite</code> method denies write access to the file
* {@code checkWrite} method denies write access to the file
* @see java.lang.SecurityManager#checkRead(java.lang.String)
* @see java.lang.SecurityManager#checkWrite(java.lang.String)
* @see java.nio.channels.FileChannel#force(boolean)
@ -253,7 +253,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* object associated with this file.
*
* <p> The {@link java.nio.channels.FileChannel#position()
* </code>position<code>} of the returned channel will always be equal to
* position} of the returned channel will always be equal to
* this object's file-pointer offset as returned by the {@link
* #getFilePointer getFilePointer} method. Changing this object's
* file-pointer offset, whether explicitly or by reading or writing bytes,
@ -277,9 +277,9 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
/**
* Opens a file and returns the file descriptor. The file is
* opened in read-write mode if the O_RDWR bit in <code>mode</code>
* opened in read-write mode if the O_RDWR bit in {@code mode}
* is true, else the file is opened as read-only.
* If the <code>name</code> refers to a directory, an IOException
* If the {@code name} refers to a directory, an IOException
* is thrown.
*
* @param name the name of the file
@ -293,15 +293,15 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
/**
* Reads a byte of data from this file. The byte is returned as an
* integer in the range 0 to 255 (<code>0x00-0x0ff</code>). This
* integer in the range 0 to 255 ({@code 0x00-0x0ff}). This
* method blocks if no input is yet available.
* <p>
* Although <code>RandomAccessFile</code> is not a subclass of
* <code>InputStream</code>, this method behaves in exactly the same
* Although {@code RandomAccessFile} is not a subclass of
* {@code InputStream}, this method behaves in exactly the same
* way as the {@link InputStream#read()} method of
* <code>InputStream</code>.
* {@code InputStream}.
*
* @return the next byte of data, or <code>-1</code> if the end of the
* @return the next byte of data, or {@code -1} if the end of the
* file has been reached.
* @exception IOException if an I/O error occurs. Not thrown if
* end-of-file has been reached.
@ -318,59 +318,59 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
private native int readBytes(byte b[], int off, int len) throws IOException;
/**
* Reads up to <code>len</code> bytes of data from this file into an
* Reads up to {@code len} bytes of data from this file into an
* array of bytes. This method blocks until at least one byte of input
* is available.
* <p>
* Although <code>RandomAccessFile</code> is not a subclass of
* <code>InputStream</code>, this method behaves in exactly the
* Although {@code RandomAccessFile} is not a subclass of
* {@code InputStream}, this method behaves in exactly the
* same way as the {@link InputStream#read(byte[], int, int)} method of
* <code>InputStream</code>.
* {@code InputStream}.
*
* @param b the buffer into which the data is read.
* @param off the start offset in array <code>b</code>
* @param off the start offset in array {@code b}
* at which the data is written.
* @param len the maximum number of bytes read.
* @return the total number of bytes read into the buffer, or
* <code>-1</code> if there is no more data because the end of
* {@code -1} if there is no more data because the end of
* the file has been reached.
* @exception IOException If the first byte cannot be read for any reason
* other than end of file, or if the random access file has been closed, or if
* some other I/O error occurs.
* @exception NullPointerException If <code>b</code> is <code>null</code>.
* @exception IndexOutOfBoundsException If <code>off</code> is negative,
* <code>len</code> is negative, or <code>len</code> is greater than
* <code>b.length - off</code>
* @exception NullPointerException If {@code b} is {@code null}.
* @exception IndexOutOfBoundsException If {@code off} is negative,
* {@code len} is negative, or {@code len} is greater than
* {@code b.length - off}
*/
public int read(byte b[], int off, int len) throws IOException {
return readBytes(b, off, len);
}
/**
* Reads up to <code>b.length</code> bytes of data from this file
* Reads up to {@code b.length} bytes of data from this file
* into an array of bytes. This method blocks until at least one byte
* of input is available.
* <p>
* Although <code>RandomAccessFile</code> is not a subclass of
* <code>InputStream</code>, this method behaves in exactly the
* Although {@code RandomAccessFile} is not a subclass of
* {@code InputStream}, this method behaves in exactly the
* same way as the {@link InputStream#read(byte[])} method of
* <code>InputStream</code>.
* {@code InputStream}.
*
* @param b the buffer into which the data is read.
* @return the total number of bytes read into the buffer, or
* <code>-1</code> if there is no more data because the end of
* {@code -1} if there is no more data because the end of
* this file has been reached.
* @exception IOException If the first byte cannot be read for any reason
* other than end of file, or if the random access file has been closed, or if
* some other I/O error occurs.
* @exception NullPointerException If <code>b</code> is <code>null</code>.
* @exception NullPointerException If {@code b} is {@code null}.
*/
public int read(byte b[]) throws IOException {
return readBytes(b, 0, b.length);
}
/**
* Reads <code>b.length</code> bytes from this file into the byte
* Reads {@code b.length} bytes from this file into the byte
* array, starting at the current file pointer. This method reads
* repeatedly from the file until the requested number of bytes are
* read. This method blocks until the requested number of bytes are
@ -386,7 +386,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
}
/**
* Reads exactly <code>len</code> bytes from this file into the byte
* Reads exactly {@code len} bytes from this file into the byte
* array, starting at the current file pointer. This method reads
* repeatedly from the file until the requested number of bytes are
* read. This method blocks until the requested number of bytes are
@ -410,15 +410,15 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
}
/**
* Attempts to skip over <code>n</code> bytes of input discarding the
* Attempts to skip over {@code n} bytes of input discarding the
* skipped bytes.
* <p>
*
* This method may skip over some smaller number of bytes, possibly zero.
* This may result from any of a number of conditions; reaching end of
* file before <code>n</code> bytes have been skipped is only one
* possibility. This method never throws an <code>EOFException</code>.
* The actual number of bytes skipped is returned. If <code>n</code>
* file before {@code n} bytes have been skipped is only one
* possibility. This method never throws an {@code EOFException}.
* The actual number of bytes skipped is returned. If {@code n}
* is negative, no bytes are skipped.
*
* @param n the number of bytes to be skipped.
@ -451,7 +451,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* Writes the specified byte to this file. The write starts at
* the current file pointer.
*
* @param b the <code>byte</code> to be written.
* @param b the {@code byte} to be written.
* @exception IOException if an I/O error occurs.
*/
public native void write(int b) throws IOException;
@ -467,7 +467,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
private native void writeBytes(byte b[], int off, int len) throws IOException;
/**
* Writes <code>b.length</code> bytes from the specified byte array
* Writes {@code b.length} bytes from the specified byte array
* to this file, starting at the current file pointer.
*
* @param b the data.
@ -478,8 +478,8 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
}
/**
* Writes <code>len</code> bytes from the specified byte array
* starting at offset <code>off</code> to this file.
* Writes {@code len} bytes from the specified byte array
* starting at offset {@code off} to this file.
*
* @param b the data.
* @param off the start offset in the data.
@ -512,8 +512,8 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* @param pos the offset position, measured in bytes from the
* beginning of the file, at which to set the file
* pointer.
* @exception IOException if <code>pos</code> is less than
* <code>0</code> or if an I/O error occurs.
* @exception IOException if {@code pos} is less than
* {@code 0} or if an I/O error occurs.
*/
public native void seek(long pos) throws IOException;
@ -529,14 +529,14 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* Sets the length of this file.
*
* <p> If the present length of the file as returned by the
* <code>length</code> method is greater than the <code>newLength</code>
* {@code length} method is greater than the {@code newLength}
* argument then the file will be truncated. In this case, if the file
* offset as returned by the <code>getFilePointer</code> method is greater
* than <code>newLength</code> then after this method returns the offset
* will be equal to <code>newLength</code>.
* offset as returned by the {@code getFilePointer} method is greater
* than {@code newLength} then after this method returns the offset
* will be equal to {@code newLength}.
*
* <p> If the present length of the file as returned by the
* <code>length</code> method is smaller than the <code>newLength</code>
* {@code length} method is smaller than the {@code newLength}
* argument then the file will be extended. In this case, the contents of
* the extended portion of the file are not defined.
*
@ -584,14 +584,14 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
//
/**
* Reads a <code>boolean</code> from this file. This method reads a
* Reads a {@code boolean} from this file. This method reads a
* single byte from the file, starting at the current file pointer.
* A value of <code>0</code> represents
* <code>false</code>. Any other value represents <code>true</code>.
* A value of {@code 0} represents
* {@code false}. Any other value represents {@code true}.
* This method blocks until the byte is read, the end of the stream
* is detected, or an exception is thrown.
*
* @return the <code>boolean</code> value read.
* @return the {@code boolean} value read.
* @exception EOFException if this file has reached the end.
* @exception IOException if an I/O error occurs.
*/
@ -605,7 +605,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
/**
* Reads a signed eight-bit value from this file. This method reads a
* byte from the file, starting from the current file pointer.
* If the byte read is <code>b</code>, where
* If the byte read is {@code b}, where
* <code>0&nbsp;&lt;=&nbsp;b&nbsp;&lt;=&nbsp;255</code>,
* then the result is:
* <blockquote><pre>
@ -616,7 +616,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* is detected, or an exception is thrown.
*
* @return the next byte of this file as a signed eight-bit
* <code>byte</code>.
* {@code byte}.
* @exception EOFException if this file has reached the end.
* @exception IOException if an I/O error occurs.
*/
@ -651,8 +651,8 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* Reads a signed 16-bit number from this file. The method reads two
* bytes from this file, starting at the current file pointer.
* If the two bytes read, in order, are
* <code>b1</code> and <code>b2</code>, where each of the two values is
* between <code>0</code> and <code>255</code>, inclusive, then the
* {@code b1} and {@code b2}, where each of the two values is
* between {@code 0} and {@code 255}, inclusive, then the
* result is equal to:
* <blockquote><pre>
* (short)((b1 &lt;&lt; 8) | b2)
@ -679,7 +679,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* Reads an unsigned 16-bit number from this file. This method reads
* two bytes from the file, starting at the current file pointer.
* If the bytes read, in order, are
* <code>b1</code> and <code>b2</code>, where
* {@code b1} and {@code b2}, where
* <code>0&nbsp;&lt;=&nbsp;b1, b2&nbsp;&lt;=&nbsp;255</code>,
* then the result is equal to:
* <blockquote><pre>
@ -707,7 +707,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* Reads a character from this file. This method reads two
* bytes from the file, starting at the current file pointer.
* If the bytes read, in order, are
* <code>b1</code> and <code>b2</code>, where
* {@code b1} and {@code b2}, where
* <code>0&nbsp;&lt;=&nbsp;b1,&nbsp;b2&nbsp;&lt;=&nbsp;255</code>,
* then the result is equal to:
* <blockquote><pre>
@ -718,7 +718,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* stream is detected, or an exception is thrown.
*
* @return the next two bytes of this file, interpreted as a
* <code>char</code>.
* {@code char}.
* @exception EOFException if this file reaches the end before reading
* two bytes.
* @exception IOException if an I/O error occurs.
@ -734,8 +734,8 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
/**
* Reads a signed 32-bit integer from this file. This method reads 4
* bytes from the file, starting at the current file pointer.
* If the bytes read, in order, are <code>b1</code>,
* <code>b2</code>, <code>b3</code>, and <code>b4</code>, where
* If the bytes read, in order, are {@code b1},
* {@code b2}, {@code b3}, and {@code b4}, where
* <code>0&nbsp;&lt;=&nbsp;b1, b2, b3, b4&nbsp;&lt;=&nbsp;255</code>,
* then the result is equal to:
* <blockquote><pre>
@ -746,7 +746,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* stream is detected, or an exception is thrown.
*
* @return the next four bytes of this file, interpreted as an
* <code>int</code>.
* {@code int}.
* @exception EOFException if this file reaches the end before reading
* four bytes.
* @exception IOException if an I/O error occurs.
@ -765,9 +765,9 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* Reads a signed 64-bit integer from this file. This method reads eight
* bytes from the file, starting at the current file pointer.
* If the bytes read, in order, are
* <code>b1</code>, <code>b2</code>, <code>b3</code>,
* <code>b4</code>, <code>b5</code>, <code>b6</code>,
* <code>b7</code>, and <code>b8,</code> where:
* {@code b1}, {@code b2}, {@code b3},
* {@code b4}, {@code b5}, {@code b6},
* {@code b7}, and {@code b8,} where:
* <blockquote><pre>
* 0 &lt;= b1, b2, b3, b4, b5, b6, b7, b8 &lt;=255,
* </pre></blockquote>
@ -784,7 +784,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* stream is detected, or an exception is thrown.
*
* @return the next eight bytes of this file, interpreted as a
* <code>long</code>.
* {@code long}.
* @exception EOFException if this file reaches the end before reading
* eight bytes.
* @exception IOException if an I/O error occurs.
@ -794,18 +794,18 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
}
/**
* Reads a <code>float</code> from this file. This method reads an
* <code>int</code> value, starting at the current file pointer,
* as if by the <code>readInt</code> method
* and then converts that <code>int</code> to a <code>float</code>
* using the <code>intBitsToFloat</code> method in class
* <code>Float</code>.
* Reads a {@code float} from this file. This method reads an
* {@code int} value, starting at the current file pointer,
* as if by the {@code readInt} method
* and then converts that {@code int} to a {@code float}
* using the {@code intBitsToFloat} method in class
* {@code Float}.
* <p>
* This method blocks until the four bytes are read, the end of the
* stream is detected, or an exception is thrown.
*
* @return the next four bytes of this file, interpreted as a
* <code>float</code>.
* {@code float}.
* @exception EOFException if this file reaches the end before reading
* four bytes.
* @exception IOException if an I/O error occurs.
@ -817,18 +817,18 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
}
/**
* Reads a <code>double</code> from this file. This method reads a
* <code>long</code> value, starting at the current file pointer,
* as if by the <code>readLong</code> method
* and then converts that <code>long</code> to a <code>double</code>
* using the <code>longBitsToDouble</code> method in
* class <code>Double</code>.
* Reads a {@code double} from this file. This method reads a
* {@code long} value, starting at the current file pointer,
* as if by the {@code readLong} method
* and then converts that {@code long} to a {@code double}
* using the {@code longBitsToDouble} method in
* class {@code Double}.
* <p>
* This method blocks until the eight bytes are read, the end of the
* stream is detected, or an exception is thrown.
*
* @return the next eight bytes of this file, interpreted as a
* <code>double</code>.
* {@code double}.
* @exception EOFException if this file reaches the end before reading
* eight bytes.
* @exception IOException if an I/O error occurs.
@ -849,7 +849,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* therefore, support the full Unicode character set.
*
* <p> A line of text is terminated by a carriage-return character
* (<code>'&#92;r'</code>), a newline character (<code>'&#92;n'</code>), a
* ({@code '\u005Cr'}), a newline character ({@code '\u005Cn'}), a
* carriage-return character immediately followed by a newline character,
* or the end of the file. Line-terminating characters are discarded and
* are not included as part of the string returned.
@ -901,7 +901,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* <p>
* The first two bytes are read, starting from the current file
* pointer, as if by
* <code>readUnsignedShort</code>. This value gives the number of
* {@code readUnsignedShort}. This value gives the number of
* following bytes that are in the encoded string, not
* the length of the resulting string. The following bytes are then
* interpreted as bytes encoding characters in the modified UTF-8 format
@ -923,13 +923,13 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
}
/**
* Writes a <code>boolean</code> to the file as a one-byte value. The
* value <code>true</code> is written out as the value
* <code>(byte)1</code>; the value <code>false</code> is written out
* as the value <code>(byte)0</code>. The write starts at
* Writes a {@code boolean} to the file as a one-byte value. The
* value {@code true} is written out as the value
* {@code (byte)1}; the value {@code false} is written out
* as the value {@code (byte)0}. The write starts at
* the current position of the file pointer.
*
* @param v a <code>boolean</code> value to be written.
* @param v a {@code boolean} value to be written.
* @exception IOException if an I/O error occurs.
*/
public final void writeBoolean(boolean v) throws IOException {
@ -938,10 +938,10 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
}
/**
* Writes a <code>byte</code> to the file as a one-byte value. The
* Writes a {@code byte} to the file as a one-byte value. The
* write starts at the current position of the file pointer.
*
* @param v a <code>byte</code> value to be written.
* @param v a {@code byte} value to be written.
* @exception IOException if an I/O error occurs.
*/
public final void writeByte(int v) throws IOException {
@ -950,10 +950,10 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
}
/**
* Writes a <code>short</code> to the file as two bytes, high byte first.
* Writes a {@code short} to the file as two bytes, high byte first.
* The write starts at the current position of the file pointer.
*
* @param v a <code>short</code> to be written.
* @param v a {@code short} to be written.
* @exception IOException if an I/O error occurs.
*/
public final void writeShort(int v) throws IOException {
@ -963,11 +963,11 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
}
/**
* Writes a <code>char</code> to the file as a two-byte value, high
* Writes a {@code char} to the file as a two-byte value, high
* byte first. The write starts at the current position of the
* file pointer.
*
* @param v a <code>char</code> value to be written.
* @param v a {@code char} value to be written.
* @exception IOException if an I/O error occurs.
*/
public final void writeChar(int v) throws IOException {
@ -977,10 +977,10 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
}
/**
* Writes an <code>int</code> to the file as four bytes, high byte first.
* Writes an {@code int} to the file as four bytes, high byte first.
* The write starts at the current position of the file pointer.
*
* @param v an <code>int</code> to be written.
* @param v an {@code int} to be written.
* @exception IOException if an I/O error occurs.
*/
public final void writeInt(int v) throws IOException {
@ -992,10 +992,10 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
}
/**
* Writes a <code>long</code> to the file as eight bytes, high byte first.
* Writes a {@code long} to the file as eight bytes, high byte first.
* The write starts at the current position of the file pointer.
*
* @param v a <code>long</code> to be written.
* @param v a {@code long} to be written.
* @exception IOException if an I/O error occurs.
*/
public final void writeLong(long v) throws IOException {
@ -1011,13 +1011,13 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
}
/**
* Converts the float argument to an <code>int</code> using the
* <code>floatToIntBits</code> method in class <code>Float</code>,
* and then writes that <code>int</code> value to the file as a
* Converts the float argument to an {@code int} using the
* {@code floatToIntBits} method in class {@code Float},
* and then writes that {@code int} value to the file as a
* four-byte quantity, high byte first. The write starts at the
* current position of the file pointer.
*
* @param v a <code>float</code> value to be written.
* @param v a {@code float} value to be written.
* @exception IOException if an I/O error occurs.
* @see java.lang.Float#floatToIntBits(float)
*/
@ -1026,13 +1026,13 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
}
/**
* Converts the double argument to a <code>long</code> using the
* <code>doubleToLongBits</code> method in class <code>Double</code>,
* and then writes that <code>long</code> value to the file as an
* Converts the double argument to a {@code long} using the
* {@code doubleToLongBits} method in class {@code Double},
* and then writes that {@code long} value to the file as an
* eight-byte quantity, high byte first. The write starts at the current
* position of the file pointer.
*
* @param v a <code>double</code> value to be written.
* @param v a {@code double} value to be written.
* @exception IOException if an I/O error occurs.
* @see java.lang.Double#doubleToLongBits(double)
*/
@ -1060,10 +1060,10 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
/**
* Writes a string to the file as a sequence of characters. Each
* character is written to the data output stream as if by the
* <code>writeChar</code> method. The write starts at the current
* {@code writeChar} method. The write starts at the current
* position of the file pointer.
*
* @param s a <code>String</code> value to be written.
* @param s a {@code String} value to be written.
* @exception IOException if an I/O error occurs.
* @see java.io.RandomAccessFile#writeChar(int)
*/
@ -1087,7 +1087,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* <p>
* First, two bytes are written to the file, starting at the
* current file pointer, as if by the
* <code>writeShort</code> method giving the number of bytes to
* {@code writeShort} method giving the number of bytes to
* follow. This value is the number of bytes actually written out,
* not the length of the string. Following the length, each character
* of the string is output, in sequence, using the modified UTF-8 encoding

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,7 +28,7 @@ package java.io;
import java.util.Arrays;
/**
* The <code>StreamTokenizer</code> class takes an input stream and
* The {@code StreamTokenizer} class takes an input stream and
* parses it into "tokens", allowing the tokens to be
* read one at a time. The parsing process is controlled by a table
* and a number of flags that can be set to various states. The
@ -36,7 +36,7 @@ import java.util.Arrays;
* strings, and various comment styles.
* <p>
* Each byte read from the input stream is regarded as a character
* in the range <code>'&#92;u0000'</code> through <code>'&#92;u00FF'</code>.
* in the range {@code '\u005Cu0000'} through {@code '\u005Cu00FF'}.
* The character value is used to look up five possible attributes of
* the character: <i>white space</i>, <i>alphabetic</i>,
* <i>numeric</i>, <i>string quote</i>, and <i>comment character</i>.
@ -53,8 +53,8 @@ import java.util.Arrays;
* <p>
* A typical application first constructs an instance of this class,
* sets up the syntax tables, and then repeatedly loops calling the
* <code>nextToken</code> method in each iteration of the loop until
* it returns the value <code>TT_EOF</code>.
* {@code nextToken} method in each iteration of the loop until
* it returns the value {@code TT_EOF}.
*
* @author James Gosling
* @see java.io.StreamTokenizer#nextToken()
@ -99,19 +99,19 @@ public class StreamTokenizer {
private static final byte CT_COMMENT = 16;
/**
* After a call to the <code>nextToken</code> method, this field
* After a call to the {@code nextToken} method, this field
* contains the type of the token just read. For a single character
* token, its value is the single character, converted to an integer.
* For a quoted string token, its value is the quote character.
* Otherwise, its value is one of the following:
* <ul>
* <li><code>TT_WORD</code> indicates that the token is a word.
* <li><code>TT_NUMBER</code> indicates that the token is a number.
* <li><code>TT_EOL</code> indicates that the end of line has been read.
* <li>{@code TT_WORD} indicates that the token is a word.
* <li>{@code TT_NUMBER} indicates that the token is a number.
* <li>{@code TT_EOL} indicates that the end of line has been read.
* The field can only have this value if the
* <code>eolIsSignificant</code> method has been called with the
* argument <code>true</code>.
* <li><code>TT_EOF</code> indicates that the end of the input stream
* {@code eolIsSignificant} method has been called with the
* argument {@code true}.
* <li>{@code TT_EOF} indicates that the end of the input stream
* has been reached.
* </ul>
* <p>
@ -160,8 +160,8 @@ public class StreamTokenizer {
* the string.
* <p>
* The current token is a word when the value of the
* <code>ttype</code> field is <code>TT_WORD</code>. The current token is
* a quoted string token when the value of the <code>ttype</code> field is
* {@code ttype} field is {@code TT_WORD}. The current token is
* a quoted string token when the value of the {@code ttype} field is
* a quote character.
* <p>
* The initial value of this field is null.
@ -175,7 +175,7 @@ public class StreamTokenizer {
/**
* If the current token is a number, this field contains the value
* of that number. The current token is a number when the value of
* the <code>ttype</code> field is <code>TT_NUMBER</code>.
* the {@code ttype} field is {@code TT_NUMBER}.
* <p>
* The initial value of this field is 0.0.
*
@ -201,14 +201,14 @@ public class StreamTokenizer {
* stream. The stream tokenizer is initialized to the following
* default state:
* <ul>
* <li>All byte values <code>'A'</code> through <code>'Z'</code>,
* <code>'a'</code> through <code>'z'</code>, and
* <code>'&#92;u00A0'</code> through <code>'&#92;u00FF'</code> are
* <li>All byte values {@code 'A'} through {@code 'Z'},
* {@code 'a'} through {@code 'z'}, and
* {@code '\u005Cu00A0'} through {@code '\u005Cu00FF'} are
* considered to be alphabetic.
* <li>All byte values <code>'&#92;u0000'</code> through
* <code>'&#92;u0020'</code> are considered to be white space.
* <li><code>'/'</code> is a comment character.
* <li>Single quote <code>'&#92;''</code> and double quote <code>'"'</code>
* <li>All byte values {@code '\u005Cu0000'} through
* {@code '\u005Cu0020'} are considered to be white space.
* <li>{@code '/'} is a comment character.
* <li>Single quote {@code '\u005C''} and double quote {@code '"'}
* are string quote characters.
* <li>Numbers are parsed.
* <li>Ends of lines are treated as white space, not as separate tokens.
@ -252,7 +252,7 @@ public class StreamTokenizer {
/**
* Resets this tokenizer's syntax table so that all characters are
* "ordinary." See the <code>ordinaryChar</code> method
* "ordinary." See the {@code ordinaryChar} method
* for more information on a character being ordinary.
*
* @see java.io.StreamTokenizer#ordinaryChar(int)
@ -305,7 +305,7 @@ public class StreamTokenizer {
* Specifies that all characters <i>c</i> in the range
* <code>low&nbsp;&lt;=&nbsp;<i>c</i>&nbsp;&lt;=&nbsp;high</code>
* are "ordinary" in this tokenizer. See the
* <code>ordinaryChar</code> method for more information on a
* {@code ordinaryChar} method for more information on a
* character being ordinary.
*
* @param low the low end of the range.
@ -327,12 +327,12 @@ public class StreamTokenizer {
* character has as a comment character, word component, string
* delimiter, white space, or number character. When such a character
* is encountered by the parser, the parser treats it as a
* single-character token and sets <code>ttype</code> field to the
* single-character token and sets {@code ttype} field to the
* character value.
*
* <p>Making a line terminator character "ordinary" may interfere
* with the ability of a <code>StreamTokenizer</code> to count
* lines. The <code>lineno</code> method may no longer reflect
* with the ability of a {@code StreamTokenizer} to count
* lines. The {@code lineno} method may no longer reflect
* the presence of such terminator characters in its line count.
*
* @param ch the character.
@ -361,9 +361,9 @@ public class StreamTokenizer {
* Specifies that matching pairs of this character delimit string
* constants in this tokenizer.
* <p>
* When the <code>nextToken</code> method encounters a string
* constant, the <code>ttype</code> field is set to the string
* delimiter and the <code>sval</code> field is set to the body of
* When the {@code nextToken} method encounters a string
* constant, the {@code ttype} field is set to the string
* delimiter and the {@code sval} field is set to the body of
* the string.
* <p>
* If a string quote character is encountered, then a string is
@ -371,7 +371,7 @@ public class StreamTokenizer {
* the string quote character, up to (but not including) the next
* occurrence of that same string quote character, or a line
* terminator, or end of file. The usual escape sequences such as
* <code>"&#92;n"</code> and <code>"&#92;t"</code> are recognized and
* {@code "\u005Cn"} and {@code "\u005Ct"} are recognized and
* converted to single characters as the string is parsed.
*
* <p>Any other attribute settings for the specified character are cleared.
@ -398,9 +398,9 @@ public class StreamTokenizer {
* <p>
* When the parser encounters a word token that has the format of a
* double precision floating-point number, it treats the token as a
* number rather than a word, by setting the <code>ttype</code>
* field to the value <code>TT_NUMBER</code> and putting the numeric
* value of the token into the <code>nval</code> field.
* number rather than a word, by setting the {@code ttype}
* field to the value {@code TT_NUMBER} and putting the numeric
* value of the token into the {@code nval} field.
*
* @see java.io.StreamTokenizer#nval
* @see java.io.StreamTokenizer#TT_NUMBER
@ -416,21 +416,21 @@ public class StreamTokenizer {
/**
* Determines whether or not ends of line are treated as tokens.
* If the flag argument is true, this tokenizer treats end of lines
* as tokens; the <code>nextToken</code> method returns
* <code>TT_EOL</code> and also sets the <code>ttype</code> field to
* as tokens; the {@code nextToken} method returns
* {@code TT_EOL} and also sets the {@code ttype} field to
* this value when an end of line is read.
* <p>
* A line is a sequence of characters ending with either a
* carriage-return character (<code>'&#92;r'</code>) or a newline
* character (<code>'&#92;n'</code>). In addition, a carriage-return
* carriage-return character ({@code '\u005Cr'}) or a newline
* character ({@code '\u005Cn'}). In addition, a carriage-return
* character followed immediately by a newline character is treated
* as a single end-of-line token.
* <p>
* If the <code>flag</code> is false, end-of-line characters are
* If the {@code flag} is false, end-of-line characters are
* treated as white space and serve only to separate tokens.
*
* @param flag <code>true</code> indicates that end-of-line characters
* are separate tokens; <code>false</code> indicates that
* @param flag {@code true} indicates that end-of-line characters
* are separate tokens; {@code false} indicates that
* end-of-line characters are white space.
* @see java.io.StreamTokenizer#nextToken()
* @see java.io.StreamTokenizer#ttype
@ -442,14 +442,14 @@ public class StreamTokenizer {
/**
* Determines whether or not the tokenizer recognizes C-style comments.
* If the flag argument is <code>true</code>, this stream tokenizer
* If the flag argument is {@code true}, this stream tokenizer
* recognizes C-style comments. All text between successive
* occurrences of <code>/*</code> and <code>*&#47;</code> are discarded.
* occurrences of {@code /*} and <code>*&#47;</code> are discarded.
* <p>
* If the flag argument is <code>false</code>, then C-style comments
* If the flag argument is {@code false}, then C-style comments
* are not treated specially.
*
* @param flag <code>true</code> indicates to recognize and ignore
* @param flag {@code true} indicates to recognize and ignore
* C-style comments.
*/
public void slashStarComments(boolean flag) {
@ -458,15 +458,15 @@ public class StreamTokenizer {
/**
* Determines whether or not the tokenizer recognizes C++-style comments.
* If the flag argument is <code>true</code>, this stream tokenizer
* If the flag argument is {@code true}, this stream tokenizer
* recognizes C++-style comments. Any occurrence of two consecutive
* slash characters (<code>'/'</code>) is treated as the beginning of
* slash characters ({@code '/'}) is treated as the beginning of
* a comment that extends to the end of the line.
* <p>
* If the flag argument is <code>false</code>, then C++-style
* If the flag argument is {@code false}, then C++-style
* comments are not treated specially.
*
* @param flag <code>true</code> indicates to recognize and ignore
* @param flag {@code true} indicates to recognize and ignore
* C++-style comments.
*/
public void slashSlashComments(boolean flag) {
@ -475,16 +475,16 @@ public class StreamTokenizer {
/**
* Determines whether or not word token are automatically lowercased.
* If the flag argument is <code>true</code>, then the value in the
* <code>sval</code> field is lowercased whenever a word token is
* returned (the <code>ttype</code> field has the
* value <code>TT_WORD</code> by the <code>nextToken</code> method
* If the flag argument is {@code true}, then the value in the
* {@code sval} field is lowercased whenever a word token is
* returned (the {@code ttype} field has the
* value {@code TT_WORD} by the {@code nextToken} method
* of this tokenizer.
* <p>
* If the flag argument is <code>false</code>, then the
* <code>sval</code> field is not modified.
* If the flag argument is {@code false}, then the
* {@code sval} field is not modified.
*
* @param fl <code>true</code> indicates that all word tokens should
* @param fl {@code true} indicates that all word tokens should
* be lowercased.
* @see java.io.StreamTokenizer#nextToken()
* @see java.io.StreamTokenizer#ttype
@ -506,9 +506,9 @@ public class StreamTokenizer {
/**
* Parses the next token from the input stream of this tokenizer.
* The type of the next token is returned in the <code>ttype</code>
* The type of the next token is returned in the {@code ttype}
* field. Additional information about the token may be in the
* <code>nval</code> field or the <code>sval</code> field of this
* {@code nval} field or the {@code sval} field of this
* tokenizer.
* <p>
* Typical clients of this
@ -516,7 +516,7 @@ public class StreamTokenizer {
* calling nextToken to parse successive tokens until TT_EOF
* is returned.
*
* @return the value of the <code>ttype</code> field.
* @return the value of the {@code ttype} field.
* @exception IOException if an I/O error occurs.
* @see java.io.StreamTokenizer#nval
* @see java.io.StreamTokenizer#sval
@ -752,10 +752,10 @@ public class StreamTokenizer {
}
/**
* Causes the next call to the <code>nextToken</code> method of this
* tokenizer to return the current value in the <code>ttype</code>
* field, and not to modify the value in the <code>nval</code> or
* <code>sval</code> field.
* Causes the next call to the {@code nextToken} method of this
* tokenizer to return the current value in the {@code ttype}
* field, and not to modify the value in the {@code nval} or
* {@code sval} field.
*
* @see java.io.StreamTokenizer#nextToken()
* @see java.io.StreamTokenizer#nval

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -91,10 +91,10 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* array is allocated with greater capacity. The new capacity is the
* larger of:
* <ul>
* <li>The <code>minimumCapacity</code> argument.
* <li>Twice the old capacity, plus <code>2</code>.
* <li>The {@code minimumCapacity} argument.
* <li>Twice the old capacity, plus {@code 2}.
* </ul>
* If the <code>minimumCapacity</code> argument is nonpositive, this
* If the {@code minimumCapacity} argument is nonpositive, this
* method takes no action and simply returns.
*
* @param minimumCapacity the minimum desired capacity.
@ -147,26 +147,26 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* Sets the length of the character sequence.
* The sequence is changed to a new character sequence
* whose length is specified by the argument. For every nonnegative
* index <i>k</i> less than <code>newLength</code>, the character at
* index <i>k</i> less than {@code newLength}, the character at
* index <i>k</i> in the new character sequence is the same as the
* character at index <i>k</i> in the old sequence if <i>k</i> is less
* than the length of the old character sequence; otherwise, it is the
* null character <code>'&#92;u0000'</code>.
* null character {@code '\u005Cu0000'}.
*
* In other words, if the <code>newLength</code> argument is less than
* In other words, if the {@code newLength} argument is less than
* the current length, the length is changed to the specified length.
* <p>
* If the <code>newLength</code> argument is greater than or equal
* If the {@code newLength} argument is greater than or equal
* to the current length, sufficient null characters
* (<code>'&#92;u0000'</code>) are appended so that
* length becomes the <code>newLength</code> argument.
* ({@code '\u005Cu0000'}) are appended so that
* length becomes the {@code newLength} argument.
* <p>
* The <code>newLength</code> argument must be greater than or equal
* to <code>0</code>.
* The {@code newLength} argument must be greater than or equal
* to {@code 0}.
*
* @param newLength the new length
* @throws IndexOutOfBoundsException if the
* <code>newLength</code> argument is negative.
* {@code newLength} argument is negative.
*/
public void setLength(int newLength) {
if (newLength < 0)
@ -182,21 +182,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
}
/**
* Returns the <code>char</code> value in this sequence at the specified index.
* The first <code>char</code> value is at index <code>0</code>, the next at index
* <code>1</code>, and so on, as in array indexing.
* Returns the {@code char} value in this sequence at the specified index.
* The first {@code char} value is at index {@code 0}, the next at index
* {@code 1}, and so on, as in array indexing.
* <p>
* The index argument must be greater than or equal to
* <code>0</code>, and less than the length of this sequence.
* {@code 0}, and less than the length of this sequence.
*
* <p>If the <code>char</code> value specified by the index is a
* <p>If the {@code char} value specified by the index is a
* <a href="Character.html#unicode">surrogate</a>, the surrogate
* value is returned.
*
* @param index the index of the desired <code>char</code> value.
* @return the <code>char</code> value at the specified index.
* @throws IndexOutOfBoundsException if <code>index</code> is
* negative or greater than or equal to <code>length()</code>.
* @param index the index of the desired {@code char} value.
* @return the {@code char} value at the specified index.
* @throws IndexOutOfBoundsException if {@code index} is
* negative or greater than or equal to {@code length()}.
*/
public char charAt(int index) {
if ((index < 0) || (index >= count))
@ -206,22 +206,22 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
/**
* Returns the character (Unicode code point) at the specified
* index. The index refers to <code>char</code> values
* (Unicode code units) and ranges from <code>0</code> to
* {@link #length()}<code> - 1</code>.
* index. The index refers to {@code char} values
* (Unicode code units) and ranges from {@code 0} to
* {@link #length()}{@code - 1}.
*
* <p> If the <code>char</code> value specified at the given index
* <p> If the {@code char} value specified at the given index
* is in the high-surrogate range, the following index is less
* than the length of this sequence, and the
* <code>char</code> value at the following index is in the
* {@code char} value at the following index is in the
* low-surrogate range, then the supplementary code point
* corresponding to this surrogate pair is returned. Otherwise,
* the <code>char</code> value at the given index is returned.
* the {@code char} value at the given index is returned.
*
* @param index the index to the <code>char</code> values
* @param index the index to the {@code char} values
* @return the code point value of the character at the
* <code>index</code>
* @exception IndexOutOfBoundsException if the <code>index</code>
* {@code index}
* @exception IndexOutOfBoundsException if the {@code index}
* argument is negative or not less than the length of this
* sequence.
*/
@ -234,22 +234,22 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
/**
* Returns the character (Unicode code point) before the specified
* index. The index refers to <code>char</code> values
* (Unicode code units) and ranges from <code>1</code> to {@link
* index. The index refers to {@code char} values
* (Unicode code units) and ranges from {@code 1} to {@link
* #length()}.
*
* <p> If the <code>char</code> value at <code>(index - 1)</code>
* is in the low-surrogate range, <code>(index - 2)</code> is not
* negative, and the <code>char</code> value at <code>(index -
* 2)</code> is in the high-surrogate range, then the
* <p> If the {@code char} value at {@code (index - 1)}
* is in the low-surrogate range, {@code (index - 2)} is not
* negative, and the {@code char} value at {@code (index -
* 2)} is in the high-surrogate range, then the
* supplementary code point value of the surrogate pair is
* returned. If the <code>char</code> value at <code>index -
* 1</code> is an unpaired low-surrogate or a high-surrogate, the
* returned. If the {@code char} value at {@code index -
* 1} is an unpaired low-surrogate or a high-surrogate, the
* surrogate value is returned.
*
* @param index the index following the code point that should be returned
* @return the Unicode code point value before the given index.
* @exception IndexOutOfBoundsException if the <code>index</code>
* @exception IndexOutOfBoundsException if the {@code index}
* argument is less than 1 or greater than the length
* of this sequence.
*/
@ -264,22 +264,22 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
/**
* Returns the number of Unicode code points in the specified text
* range of this sequence. The text range begins at the specified
* <code>beginIndex</code> and extends to the <code>char</code> at
* index <code>endIndex - 1</code>. Thus the length (in
* <code>char</code>s) of the text range is
* <code>endIndex-beginIndex</code>. Unpaired surrogates within
* {@code beginIndex} and extends to the {@code char} at
* index {@code endIndex - 1}. Thus the length (in
* {@code char}s) of the text range is
* {@code endIndex-beginIndex}. Unpaired surrogates within
* this sequence count as one code point each.
*
* @param beginIndex the index to the first <code>char</code> of
* @param beginIndex the index to the first {@code char} of
* the text range.
* @param endIndex the index after the last <code>char</code> of
* @param endIndex the index after the last {@code char} of
* the text range.
* @return the number of Unicode code points in the specified text
* range
* @exception IndexOutOfBoundsException if the
* <code>beginIndex</code> is negative, or <code>endIndex</code>
* {@code beginIndex} is negative, or {@code endIndex}
* is larger than the length of this sequence, or
* <code>beginIndex</code> is larger than <code>endIndex</code>.
* {@code beginIndex} is larger than {@code endIndex}.
*/
public int codePointCount(int beginIndex, int endIndex) {
if (beginIndex < 0 || endIndex > count || beginIndex > endIndex) {
@ -290,22 +290,22 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
/**
* Returns the index within this sequence that is offset from the
* given <code>index</code> by <code>codePointOffset</code> code
* given {@code index} by {@code codePointOffset} code
* points. Unpaired surrogates within the text range given by
* <code>index</code> and <code>codePointOffset</code> count as
* {@code index} and {@code codePointOffset} count as
* one code point each.
*
* @param index the index to be offset
* @param codePointOffset the offset in code points
* @return the index within this sequence
* @exception IndexOutOfBoundsException if <code>index</code>
* @exception IndexOutOfBoundsException if {@code index}
* is negative or larger then the length of this sequence,
* or if <code>codePointOffset</code> is positive and the subsequence
* starting with <code>index</code> has fewer than
* <code>codePointOffset</code> code points,
* or if <code>codePointOffset</code> is negative and the subsequence
* before <code>index</code> has fewer than the absolute value of
* <code>codePointOffset</code> code points.
* or if {@code codePointOffset} is positive and the subsequence
* starting with {@code index} has fewer than
* {@code codePointOffset} code points,
* or if {@code codePointOffset} is negative and the subsequence
* before {@code index} has fewer than the absolute value of
* {@code codePointOffset} code points.
*/
public int offsetByCodePoints(int index, int codePointOffset) {
if (index < 0 || index > count) {
@ -317,12 +317,12 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
/**
* Characters are copied from this sequence into the
* destination character array <code>dst</code>. The first character to
* be copied is at index <code>srcBegin</code>; the last character to
* be copied is at index <code>srcEnd-1</code>. The total number of
* characters to be copied is <code>srcEnd-srcBegin</code>. The
* characters are copied into the subarray of <code>dst</code> starting
* at index <code>dstBegin</code> and ending at index:
* destination character array {@code dst}. The first character to
* be copied is at index {@code srcBegin}; the last character to
* be copied is at index {@code srcEnd-1}. The total number of
* characters to be copied is {@code srcEnd-srcBegin}. The
* characters are copied into the subarray of {@code dst} starting
* at index {@code dstBegin} and ending at index:
* <p><blockquote><pre>
* dstbegin + (srcEnd-srcBegin) - 1
* </pre></blockquote>
@ -330,19 +330,19 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* @param srcBegin start copying at this offset.
* @param srcEnd stop copying at this offset.
* @param dst the array to copy the data into.
* @param dstBegin offset into <code>dst</code>.
* @throws NullPointerException if <code>dst</code> is
* <code>null</code>.
* @param dstBegin offset into {@code dst}.
* @throws NullPointerException if {@code dst} is
* {@code null}.
* @throws IndexOutOfBoundsException if any of the following is true:
* <ul>
* <li><code>srcBegin</code> is negative
* <li><code>dstBegin</code> is negative
* <li>the <code>srcBegin</code> argument is greater than
* the <code>srcEnd</code> argument.
* <li><code>srcEnd</code> is greater than
* <code>this.length()</code>.
* <li><code>dstBegin+srcEnd-srcBegin</code> is greater than
* <code>dst.length</code>
* <li>{@code srcBegin} is negative
* <li>{@code dstBegin} is negative
* <li>the {@code srcBegin} argument is greater than
* the {@code srcEnd} argument.
* <li>{@code srcEnd} is greater than
* {@code this.length()}.
* <li>{@code dstBegin+srcEnd-srcBegin} is greater than
* {@code dst.length}
* </ul>
*/
public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
@ -357,18 +357,18 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
}
/**
* The character at the specified index is set to <code>ch</code>. This
* The character at the specified index is set to {@code ch}. This
* sequence is altered to represent a new character sequence that is
* identical to the old character sequence, except that it contains the
* character <code>ch</code> at position <code>index</code>.
* character {@code ch} at position {@code index}.
* <p>
* The index argument must be greater than or equal to
* <code>0</code>, and less than the length of this sequence.
* {@code 0}, and less than the length of this sequence.
*
* @param index the index of the character to modify.
* @param ch the new character.
* @throws IndexOutOfBoundsException if <code>index</code> is
* negative or greater than or equal to <code>length()</code>.
* @throws IndexOutOfBoundsException if {@code index} is
* negative or greater than or equal to {@code length()}.
*/
public void setCharAt(int index, char ch) {
if ((index < 0) || (index >= count))
@ -741,21 +741,21 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
}
/**
* Removes the <code>char</code> at the specified position in this
* sequence. This sequence is shortened by one <code>char</code>.
* Removes the {@code char} at the specified position in this
* sequence. This sequence is shortened by one {@code char}.
*
* <p>Note: If the character at the given index is a supplementary
* character, this method does not remove the entire character. If
* correct handling of supplementary characters is required,
* determine the number of <code>char</code>s to remove by calling
* <code>Character.charCount(thisSequence.codePointAt(index))</code>,
* where <code>thisSequence</code> is this sequence.
* determine the number of {@code char}s to remove by calling
* {@code Character.charCount(thisSequence.codePointAt(index))},
* where {@code thisSequence} is this sequence.
*
* @param index Index of <code>char</code> to remove
* @param index Index of {@code char} to remove
* @return This object.
* @throws StringIndexOutOfBoundsException if the <code>index</code>
* @throws StringIndexOutOfBoundsException if the {@code index}
* is negative or greater than or equal to
* <code>length()</code>.
* {@code length()}.
*/
public AbstractStringBuilder deleteCharAt(int index) {
if ((index < 0) || (index >= count))
@ -767,12 +767,12 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
/**
* Replaces the characters in a substring of this sequence
* with characters in the specified <code>String</code>. The substring
* begins at the specified <code>start</code> and extends to the character
* at index <code>end - 1</code> or to the end of the
* with characters in the specified {@code String}. The substring
* begins at the specified {@code start} and extends to the character
* at index {@code end - 1} or to the end of the
* sequence if no such character exists. First the
* characters in the substring are removed and then the specified
* <code>String</code> is inserted at <code>start</code>. (This
* {@code String} is inserted at {@code start}. (This
* sequence will be lengthened to accommodate the
* specified String if necessary.)
*
@ -780,9 +780,9 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* @param end The ending index, exclusive.
* @param str String that will replace previous contents.
* @return This object.
* @throws StringIndexOutOfBoundsException if <code>start</code>
* is negative, greater than <code>length()</code>, or
* greater than <code>end</code>.
* @throws StringIndexOutOfBoundsException if {@code start}
* is negative, greater than {@code length()}, or
* greater than {@code end}.
*/
public AbstractStringBuilder replace(int start, int end, String str) {
if (start < 0)
@ -805,14 +805,14 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
}
/**
* Returns a new <code>String</code> that contains a subsequence of
* Returns a new {@code String} that contains a subsequence of
* characters currently contained in this character sequence. The
* substring begins at the specified index and extends to the end of
* this sequence.
*
* @param start The beginning index, inclusive.
* @return The new string.
* @throws StringIndexOutOfBoundsException if <code>start</code> is
* @throws StringIndexOutOfBoundsException if {@code start} is
* less than zero, or greater than the length of this object.
*/
public String substring(int start) {
@ -850,18 +850,18 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
}
/**
* Returns a new <code>String</code> that contains a subsequence of
* Returns a new {@code String} that contains a subsequence of
* characters currently contained in this sequence. The
* substring begins at the specified <code>start</code> and
* extends to the character at index <code>end - 1</code>.
* substring begins at the specified {@code start} and
* extends to the character at index {@code end - 1}.
*
* @param start The beginning index, inclusive.
* @param end The ending index, exclusive.
* @return The new string.
* @throws StringIndexOutOfBoundsException if <code>start</code>
* or <code>end</code> are negative or greater than
* <code>length()</code>, or <code>start</code> is
* greater than <code>end</code>.
* @throws StringIndexOutOfBoundsException if {@code start}
* or {@code end} are negative or greater than
* {@code length()}, or {@code start} is
* greater than {@code end}.
*/
public String substring(int start, int end) {
if (start < 0)
@ -1254,15 +1254,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* <blockquote><pre>
* this.toString().startsWith(str, <i>k</i>)
* </pre></blockquote>
* is <code>true</code>.
* is {@code true}.
*
* @param str any string.
* @return if the string argument occurs as a substring within this
* object, then the index of the first character of the first
* such substring is returned; if it does not occur as a
* substring, <code>-1</code> is returned.
* @throws java.lang.NullPointerException if <code>str</code> is
* <code>null</code>.
* substring, {@code -1} is returned.
* @throws java.lang.NullPointerException if {@code str} is
* {@code null}.
*/
public int indexOf(String str) {
return indexOf(str, 0);
@ -1282,8 +1282,8 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* @param fromIndex the index from which to start the search.
* @return the index within this string of the first occurrence of the
* specified substring, starting at the specified index.
* @throws java.lang.NullPointerException if <code>str</code> is
* <code>null</code>.
* @throws java.lang.NullPointerException if {@code str} is
* {@code null}.
*/
public int indexOf(String str, int fromIndex) {
return String.indexOf(value, 0, count,
@ -1293,7 +1293,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
/**
* Returns the index within this string of the rightmost occurrence
* of the specified substring. The rightmost empty string "" is
* considered to occur at the index value <code>this.length()</code>.
* considered to occur at the index value {@code this.length()}.
* The returned index is the largest value <i>k</i> such that
* <blockquote><pre>
* this.toString().startsWith(str, k)
@ -1304,9 +1304,9 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* @return if the string argument occurs one or more times as a substring
* within this object, then the index of the first character of
* the last such substring is returned. If it does not occur as
* a substring, <code>-1</code> is returned.
* @throws java.lang.NullPointerException if <code>str</code> is
* <code>null</code>.
* a substring, {@code -1} is returned.
* @throws java.lang.NullPointerException if {@code str} is
* {@code null}.
*/
public int lastIndexOf(String str) {
return lastIndexOf(str, count);
@ -1326,8 +1326,8 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* @param fromIndex the index to start the search from.
* @return the index within this sequence of the last occurrence of the
* specified substring.
* @throws java.lang.NullPointerException if <code>str</code> is
* <code>null</code>.
* @throws java.lang.NullPointerException if {@code str} is
* {@code null}.
*/
public int lastIndexOf(String str, int fromIndex) {
return String.lastIndexOf(value, 0, count,
@ -1342,8 +1342,8 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* is never reversed.
*
* Let <i>n</i> be the character length of this character sequence
* (not the length in <code>char</code> values) just prior to
* execution of the <code>reverse</code> method. Then the
* (not the length in {@code char} values) just prior to
* execution of the {@code reverse} method. Then the
* character at index <i>k</i> in the new character sequence is
* equal to the character at index <i>n-k-1</i> in the old
* character sequence.
@ -1351,7 +1351,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
* <p>Note that the reverse operation may result in producing
* surrogate pairs that were unpaired low-surrogates and
* high-surrogates before the operation. For example, reversing
* "&#92;uDC00&#92;uD800" produces "&#92;uD800&#92;uDC00" which is
* "\u005CuDC00\u005CuD800" produces "\u005CuD800\u005CuDC00" which is
* a valid surrogate pair.
*
* @return a reference to this object.
@ -1387,11 +1387,11 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
/**
* Returns a string representing the data in this sequence.
* A new <code>String</code> object is allocated and initialized to
* A new {@code String} object is allocated and initialized to
* contain the character sequence currently represented by this
* object. This <code>String</code> is then returned. Subsequent
* object. This {@code String} is then returned. Subsequent
* changes to this sequence do not affect the contents of the
* <code>String</code>.
* {@code String}.
*
* @return a string representation of this sequence of characters.
*/

View File

@ -110,8 +110,8 @@ public final class Byte extends Number implements Comparable<Byte> {
* determined by whether {@link java.lang.Character#digit(char,
* int)} returns a nonnegative value) except that the first
* character may be an ASCII minus sign {@code '-'}
* (<code>'&#92;u002D'</code>) to indicate a negative value or an
* ASCII plus sign {@code '+'} (<code>'&#92;u002B'</code>) to
* ({@code '\u005Cu002D'}) to indicate a negative value or an
* ASCII plus sign {@code '+'} ({@code '\u005Cu002B'}) to
* indicate a positive value. The resulting {@code byte} value is
* returned.
*
@ -127,8 +127,8 @@ public final class Byte extends Number implements Comparable<Byte> {
*
* <li> Any character of the string is not a digit of the
* specified radix, except that the first character may be a minus
* sign {@code '-'} (<code>'&#92;u002D'</code>) or plus sign
* {@code '+'} (<code>'&#92;u002B'</code>) provided that the
* sign {@code '-'} ({@code '\u005Cu002D'}) or plus sign
* {@code '+'} ({@code '\u005Cu002B'}) provided that the
* string is longer than length 1.
*
* <li> The value represented by the string is not a value of type
@ -157,9 +157,9 @@ public final class Byte extends Number implements Comparable<Byte> {
* Parses the string argument as a signed decimal {@code
* byte}. The characters in the string must all be decimal digits,
* except that the first character may be an ASCII minus sign
* {@code '-'} (<code>'&#92;u002D'</code>) to indicate a negative
* {@code '-'} ({@code '\u005Cu002D'}) to indicate a negative
* value or an ASCII plus sign {@code '+'}
* (<code>'&#92;u002B'</code>) to indicate a positive value. The
* ({@code '\u005Cu002B'}) to indicate a positive value. The
* resulting {@code byte} value is returned, exactly as if the
* argument and the radix 10 were given as arguments to the {@link
* #parseByte(java.lang.String, int)} method.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -140,7 +140,7 @@ public final class Double extends Number implements Comparable<Double> {
* <li>Otherwise, the result is a string that represents the sign and
* magnitude (absolute value) of the argument. If the sign is negative,
* the first character of the result is '{@code -}'
* (<code>'&#92;u002D'</code>); if the sign is positive, no sign character
* ({@code '\u005Cu002D'}); if the sign is positive, no sign character
* appears in the result. As for the magnitude <i>m</i>:
* <ul>
* <li>If <i>m</i> is infinity, it is represented by the characters
@ -156,7 +156,7 @@ public final class Double extends Number implements Comparable<Double> {
* <li>If <i>m</i> is greater than or equal to 10<sup>-3</sup> but less
* than 10<sup>7</sup>, then it is represented as the integer part of
* <i>m</i>, in decimal form with no leading zeroes, followed by
* '{@code .}' (<code>'&#92;u002E'</code>), followed by one or
* '{@code .}' ({@code '\u005Cu002E'}), followed by one or
* more decimal digits representing the fractional part of <i>m</i>.
*
* <li>If <i>m</i> is less than 10<sup>-3</sup> or greater than or
@ -168,9 +168,9 @@ public final class Double extends Number implements Comparable<Double> {
* 10<sup><i>n</i></sup> so that 1 &le; <i>a</i> {@literal <} 10. The
* magnitude is then represented as the integer part of <i>a</i>,
* as a single decimal digit, followed by '{@code .}'
* (<code>'&#92;u002E'</code>), followed by decimal digits
* ({@code '\u005Cu002E'}), followed by decimal digits
* representing the fractional part of <i>a</i>, followed by the
* letter '{@code E}' (<code>'&#92;u0045'</code>), followed
* letter '{@code E}' ({@code '\u005Cu0045'}), followed
* by a representation of <i>n</i> as a decimal integer, as
* produced by the method {@link Integer#toString(int)}.
* </ul>
@ -208,7 +208,7 @@ public final class Double extends Number implements Comparable<Double> {
* <li>Otherwise, the result is a string that represents the sign
* and magnitude of the argument. If the sign is negative, the
* first character of the result is '{@code -}'
* (<code>'&#92;u002D'</code>); if the sign is positive, no sign
* ({@code '\u005Cu002D'}); if the sign is positive, no sign
* character appears in the result. As for the magnitude <i>m</i>:
*
* <ul>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -138,7 +138,7 @@ public final class Float extends Number implements Comparable<Float> {
* <li>Otherwise, the result is a string that represents the sign and
* magnitude (absolute value) of the argument. If the sign is
* negative, the first character of the result is
* '{@code -}' (<code>'&#92;u002D'</code>); if the sign is
* '{@code -}' ({@code '\u005Cu002D'}); if the sign is
* positive, no sign character appears in the result. As for
* the magnitude <i>m</i>:
* <ul>
@ -154,7 +154,7 @@ public final class Float extends Number implements Comparable<Float> {
* less than 10<sup>7</sup>, then it is represented as the
* integer part of <i>m</i>, in decimal form with no leading
* zeroes, followed by '{@code .}'
* (<code>'&#92;u002E'</code>), followed by one or more
* ({@code '\u005Cu002E'}), followed by one or more
* decimal digits representing the fractional part of
* <i>m</i>.
* <li> If <i>m</i> is less than 10<sup>-3</sup> or greater than or
@ -166,10 +166,10 @@ public final class Float extends Number implements Comparable<Float> {
* 10<sup><i>n</i></sup> so that 1 &le; <i>a</i> {@literal <} 10.
* The magnitude is then represented as the integer part of
* <i>a</i>, as a single decimal digit, followed by
* '{@code .}' (<code>'&#92;u002E'</code>), followed by
* '{@code .}' ({@code '\u005Cu002E'}), followed by
* decimal digits representing the fractional part of
* <i>a</i>, followed by the letter '{@code E}'
* (<code>'&#92;u0045'</code>), followed by a representation
* ({@code '\u005Cu0045'}), followed by a representation
* of <i>n</i> as a decimal integer, as produced by the
* method {@link java.lang.Integer#toString(int)}.
*
@ -210,7 +210,7 @@ public final class Float extends Number implements Comparable<Float> {
* <li>Otherwise, the result is a string that represents the sign and
* magnitude (absolute value) of the argument. If the sign is negative,
* the first character of the result is '{@code -}'
* (<code>'&#92;u002D'</code>); if the sign is positive, no sign character
* ({@code '\u005Cu002D'}); if the sign is positive, no sign character
* appears in the result. As for the magnitude <i>m</i>:
*
* <ul>

View File

@ -93,13 +93,13 @@ public final class Integer extends Number implements Comparable<Integer> {
*
* <p>If the first argument is negative, the first element of the
* result is the ASCII minus character {@code '-'}
* (<code>'&#92;u002D'</code>). If the first argument is not
* ({@code '\u005Cu002D'}). If the first argument is not
* negative, no sign character appears in the result.
*
* <p>The remaining characters of the result represent the magnitude
* of the first argument. If the magnitude is zero, it is
* represented by a single zero character {@code '0'}
* (<code>'&#92;u0030'</code>); otherwise, the first character of
* ({@code '\u005Cu0030'}); otherwise, the first character of
* the representation of the magnitude will not be the zero
* character. The following ASCII characters are used as digits:
*
@ -107,9 +107,9 @@ public final class Integer extends Number implements Comparable<Integer> {
* {@code 0123456789abcdefghijklmnopqrstuvwxyz}
* </blockquote>
*
* These are <code>'&#92;u0030'</code> through
* <code>'&#92;u0039'</code> and <code>'&#92;u0061'</code> through
* <code>'&#92;u007A'</code>. If {@code radix} is
* These are {@code '\u005Cu0030'} through
* {@code '\u005Cu0039'} and {@code '\u005Cu0061'} through
* {@code '\u005Cu007A'}. If {@code radix} is
* <var>N</var>, then the first <var>N</var> of these characters
* are used as radix-<var>N</var> digits in the order shown. Thus,
* the digits for hexadecimal (radix 16) are
@ -170,7 +170,7 @@ public final class Integer extends Number implements Comparable<Integer> {
* value, no leading sign character is printed.
*
* <p>If the magnitude is zero, it is represented by a single zero
* character {@code '0'} (<code>'&#92;u0030'</code>); otherwise,
* character {@code '0'} ({@code '\u005Cu0030'}); otherwise,
* the first character of the representation of the magnitude will
* not be the zero character.
*
@ -203,7 +203,7 @@ public final class Integer extends Number implements Comparable<Integer> {
* Integer.parseUnsignedInt(s, 16)}.
*
* <p>If the unsigned magnitude is zero, it is represented by a
* single zero character {@code '0'} (<code>'&#92;u0030'</code>);
* single zero character {@code '0'} ({@code '\u005Cu0030'});
* otherwise, the first character of the representation of the
* unsigned magnitude will not be the zero character. The
* following characters are used as hexadecimal digits:
@ -212,9 +212,9 @@ public final class Integer extends Number implements Comparable<Integer> {
* {@code 0123456789abcdef}
* </blockquote>
*
* These are the characters <code>'&#92;u0030'</code> through
* <code>'&#92;u0039'</code> and <code>'&#92;u0061'</code> through
* <code>'&#92;u0066'</code>. If uppercase letters are
* These are the characters {@code '\u005Cu0030'} through
* {@code '\u005Cu0039'} and {@code '\u005Cu0061'} through
* {@code '\u005Cu0066'}. If uppercase letters are
* desired, the {@link java.lang.String#toUpperCase()} method may
* be called on the result:
*
@ -248,7 +248,7 @@ public final class Integer extends Number implements Comparable<Integer> {
* Integer.parseUnsignedInt(s, 8)}.
*
* <p>If the unsigned magnitude is zero, it is represented by a
* single zero character {@code '0'} (<code>'&#92;u0030'</code>);
* single zero character {@code '0'} ({@code '\u005Cu0030'});
* otherwise, the first character of the representation of the
* unsigned magnitude will not be the zero character. The
* following characters are used as octal digits:
@ -257,8 +257,8 @@ public final class Integer extends Number implements Comparable<Integer> {
* {@code 01234567}
* </blockquote>
*
* These are the characters <code>'&#92;u0030'</code> through
* <code>'&#92;u0037'</code>.
* These are the characters {@code '\u005Cu0030'} through
* {@code '\u005Cu0037'}.
*
* @param i an integer to be converted to a string.
* @return the string representation of the unsigned integer value
@ -286,11 +286,11 @@ public final class Integer extends Number implements Comparable<Integer> {
* Integer.parseUnsignedInt(s, 2)}.
*
* <p>If the unsigned magnitude is zero, it is represented by a
* single zero character {@code '0'} (<code>'&#92;u0030'</code>);
* single zero character {@code '0'} ({@code '\u005Cu0030'});
* otherwise, the first character of the representation of the
* unsigned magnitude will not be the zero character. The
* characters {@code '0'} (<code>'&#92;u0030'</code>) and {@code
* '1'} (<code>'&#92;u0031'</code>) are used as binary digits.
* characters {@code '0'} ({@code '\u005Cu0030'}) and {@code
* '1'} ({@code '\u005Cu0031'}) are used as binary digits.
*
* @param i an integer to be converted to a string.
* @return the string representation of the unsigned integer value
@ -461,9 +461,9 @@ public final class Integer extends Number implements Comparable<Integer> {
* must all be digits of the specified radix (as determined by
* whether {@link java.lang.Character#digit(char, int)} returns a
* nonnegative value), except that the first character may be an
* ASCII minus sign {@code '-'} (<code>'&#92;u002D'</code>) to
* ASCII minus sign {@code '-'} ({@code '\u005Cu002D'}) to
* indicate a negative value or an ASCII plus sign {@code '+'}
* (<code>'&#92;u002B'</code>) to indicate a positive value. The
* ({@code '\u005Cu002B'}) to indicate a positive value. The
* resulting integer value is returned.
*
* <p>An exception of type {@code NumberFormatException} is
@ -478,8 +478,8 @@ public final class Integer extends Number implements Comparable<Integer> {
*
* <li>Any character of the string is not a digit of the specified
* radix, except that the first character may be a minus sign
* {@code '-'} (<code>'&#92;u002D'</code>) or plus sign
* {@code '+'} (<code>'&#92;u002B'</code>) provided that the
* {@code '-'} ({@code '\u005Cu002D'}) or plus sign
* {@code '+'} ({@code '\u005Cu002B'}) provided that the
* string is longer than length 1.
*
* <li>The value represented by the string is not a value of type
@ -579,8 +579,8 @@ public final class Integer extends Number implements Comparable<Integer> {
* Parses the string argument as a signed decimal integer. The
* characters in the string must all be decimal digits, except
* that the first character may be an ASCII minus sign {@code '-'}
* (<code>'&#92;u002D'</code>) to indicate a negative value or an
* ASCII plus sign {@code '+'} (<code>'&#92;u002B'</code>) to
* ({@code '\u005Cu002D'}) to indicate a negative value or an
* ASCII plus sign {@code '+'} ({@code '\u005Cu002B'}) to
* indicate a positive value. The resulting integer value is
* returned, exactly as if the argument and the radix 10 were
* given as arguments to the {@link #parseInt(java.lang.String,
@ -606,7 +606,7 @@ public final class Integer extends Number implements Comparable<Integer> {
* specified radix (as determined by whether {@link
* java.lang.Character#digit(char, int)} returns a nonnegative
* value), except that the first character may be an ASCII plus
* sign {@code '+'} (<code>'&#92;u002B'</code>). The resulting
* sign {@code '+'} ({@code '\u005Cu002B'}). The resulting
* integer value is returned.
*
* <p>An exception of type {@code NumberFormatException} is
@ -621,7 +621,7 @@ public final class Integer extends Number implements Comparable<Integer> {
*
* <li>Any character of the string is not a digit of the specified
* radix, except that the first character may be a plus sign
* {@code '+'} (<code>'&#92;u002B'</code>) provided that the
* {@code '+'} ({@code '\u005Cu002B'}) provided that the
* string is longer than length 1.
*
* <li>The value represented by the string is larger than the
@ -676,7 +676,7 @@ public final class Integer extends Number implements Comparable<Integer> {
* Parses the string argument as an unsigned decimal integer. The
* characters in the string must all be decimal digits, except
* that the first character may be an an ASCII plus sign {@code
* '+'} (<code>'&#92;u002B'</code>). The resulting integer value
* '+'} ({@code '\u005Cu002B'}). The resulting integer value
* is returned, exactly as if the argument and the radix 10 were
* given as arguments to the {@link
* #parseUnsignedInt(java.lang.String, int)} method.

View File

@ -81,13 +81,13 @@ public final class Long extends Number implements Comparable<Long> {
*
* <p>If the first argument is negative, the first element of the
* result is the ASCII minus sign {@code '-'}
* (<code>'&#92;u002d'</code>). If the first argument is not
* ({@code '\u005Cu002d'}). If the first argument is not
* negative, no sign character appears in the result.
*
* <p>The remaining characters of the result represent the magnitude
* of the first argument. If the magnitude is zero, it is
* represented by a single zero character {@code '0'}
* (<code>'&#92;u0030'</code>); otherwise, the first character of
* ({@code '\u005Cu0030'}); otherwise, the first character of
* the representation of the magnitude will not be the zero
* character. The following ASCII characters are used as digits:
*
@ -95,9 +95,9 @@ public final class Long extends Number implements Comparable<Long> {
* {@code 0123456789abcdefghijklmnopqrstuvwxyz}
* </blockquote>
*
* These are <code>'&#92;u0030'</code> through
* <code>'&#92;u0039'</code> and <code>'&#92;u0061'</code> through
* <code>'&#92;u007a'</code>. If {@code radix} is
* These are {@code '\u005Cu0030'} through
* {@code '\u005Cu0039'} and {@code '\u005Cu0061'} through
* {@code '\u005Cu007a'}. If {@code radix} is
* <var>N</var>, then the first <var>N</var> of these characters
* are used as radix-<var>N</var> digits in the order shown. Thus,
* the digits for hexadecimal (radix 16) are
@ -154,7 +154,7 @@ public final class Long extends Number implements Comparable<Long> {
* value, no leading sign character is printed.
*
* <p>If the magnitude is zero, it is represented by a single zero
* character {@code '0'} (<code>'&#92;u0030'</code>); otherwise,
* character {@code '0'} ({@code '\u005Cu0030'}); otherwise,
* the first character of the representation of the magnitude will
* not be the zero character.
*
@ -239,7 +239,7 @@ public final class Long extends Number implements Comparable<Long> {
* 16)}.
*
* <p>If the unsigned magnitude is zero, it is represented by a
* single zero character {@code '0'} (<code>'&#92;u0030'</code>);
* single zero character {@code '0'} ({@code '\u005Cu0030'});
* otherwise, the first character of the representation of the
* unsigned magnitude will not be the zero character. The
* following characters are used as hexadecimal digits:
@ -248,9 +248,9 @@ public final class Long extends Number implements Comparable<Long> {
* {@code 0123456789abcdef}
* </blockquote>
*
* These are the characters <code>'&#92;u0030'</code> through
* <code>'&#92;u0039'</code> and <code>'&#92;u0061'</code> through
* <code>'&#92;u0066'</code>. If uppercase letters are desired,
* These are the characters {@code '\u005Cu0030'} through
* {@code '\u005Cu0039'} and {@code '\u005Cu0061'} through
* {@code '\u005Cu0066'}. If uppercase letters are desired,
* the {@link java.lang.String#toUpperCase()} method may be called
* on the result:
*
@ -286,7 +286,7 @@ public final class Long extends Number implements Comparable<Long> {
* 8)}.
*
* <p>If the unsigned magnitude is zero, it is represented by a
* single zero character {@code '0'} (<code>'&#92;u0030'</code>);
* single zero character {@code '0'} ({@code '\u005Cu0030'});
* otherwise, the first character of the representation of the
* unsigned magnitude will not be the zero character. The
* following characters are used as octal digits:
@ -295,8 +295,8 @@ public final class Long extends Number implements Comparable<Long> {
* {@code 01234567}
* </blockquote>
*
* These are the characters <code>'&#92;u0030'</code> through
* <code>'&#92;u0037'</code>.
* These are the characters {@code '\u005Cu0030'} through
* {@code '\u005Cu0037'}.
*
* @param i a {@code long} to be converted to a string.
* @return the string representation of the unsigned {@code long}
@ -325,11 +325,11 @@ public final class Long extends Number implements Comparable<Long> {
* 2)}.
*
* <p>If the unsigned magnitude is zero, it is represented by a
* single zero character {@code '0'} (<code>'&#92;u0030'</code>);
* single zero character {@code '0'} ({@code '\u005Cu0030'});
* otherwise, the first character of the representation of the
* unsigned magnitude will not be the zero character. The
* characters {@code '0'} (<code>'&#92;u0030'</code>) and {@code
* '1'} (<code>'&#92;u0031'</code>) are used as binary digits.
* characters {@code '0'} ({@code '\u005Cu0030'}) and {@code
* '1'} ({@code '\u005Cu0031'}) are used as binary digits.
*
* @param i a {@code long} to be converted to a string.
* @return the string representation of the unsigned {@code long}
@ -467,14 +467,14 @@ public final class Long extends Number implements Comparable<Long> {
* string must all be digits of the specified radix (as determined
* by whether {@link java.lang.Character#digit(char, int)} returns
* a nonnegative value), except that the first character may be an
* ASCII minus sign {@code '-'} (<code>'&#92;u002D'</code>) to
* ASCII minus sign {@code '-'} ({@code '\u005Cu002D'}) to
* indicate a negative value or an ASCII plus sign {@code '+'}
* (<code>'&#92;u002B'</code>) to indicate a positive value. The
* ({@code '\u005Cu002B'}) to indicate a positive value. The
* resulting {@code long} value is returned.
*
* <p>Note that neither the character {@code L}
* (<code>'&#92;u004C'</code>) nor {@code l}
* (<code>'&#92;u006C'</code>) is permitted to appear at the end
* ({@code '\u005Cu004C'}) nor {@code l}
* ({@code '\u005Cu006C'}) is permitted to appear at the end
* of the string as a type indicator, as would be permitted in
* Java programming language source code - except that either
* {@code L} or {@code l} may appear as a digit for a
@ -493,8 +493,8 @@ public final class Long extends Number implements Comparable<Long> {
*
* <li>Any character of the string is not a digit of the specified
* radix, except that the first character may be a minus sign
* {@code '-'} (<code>'&#92;u002d'</code>) or plus sign {@code
* '+'} (<code>'&#92;u002B'</code>) provided that the string is
* {@code '-'} ({@code '\u005Cu002d'}) or plus sign {@code
* '+'} ({@code '\u005Cu002B'}) provided that the string is
* longer than length 1.
*
* <li>The value represented by the string is not a value of type
@ -584,16 +584,16 @@ public final class Long extends Number implements Comparable<Long> {
* Parses the string argument as a signed decimal {@code long}.
* The characters in the string must all be decimal digits, except
* that the first character may be an ASCII minus sign {@code '-'}
* (<code>&#92;u002D'</code>) to indicate a negative value or an
* ASCII plus sign {@code '+'} (<code>'&#92;u002B'</code>) to
* ({@code \u005Cu002D'}) to indicate a negative value or an
* ASCII plus sign {@code '+'} ({@code '\u005Cu002B'}) to
* indicate a positive value. The resulting {@code long} value is
* returned, exactly as if the argument and the radix {@code 10}
* were given as arguments to the {@link
* #parseLong(java.lang.String, int)} method.
*
* <p>Note that neither the character {@code L}
* (<code>'&#92;u004C'</code>) nor {@code l}
* (<code>'&#92;u006C'</code>) is permitted to appear at the end
* ({@code '\u005Cu004C'}) nor {@code l}
* ({@code '\u005Cu006C'}) is permitted to appear at the end
* of the string as a type indicator, as would be permitted in
* Java programming language source code.
*
@ -618,7 +618,7 @@ public final class Long extends Number implements Comparable<Long> {
* specified radix (as determined by whether {@link
* java.lang.Character#digit(char, int)} returns a nonnegative
* value), except that the first character may be an ASCII plus
* sign {@code '+'} (<code>'&#92;u002B'</code>). The resulting
* sign {@code '+'} ({@code '\u005Cu002B'}). The resulting
* integer value is returned.
*
* <p>An exception of type {@code NumberFormatException} is
@ -633,7 +633,7 @@ public final class Long extends Number implements Comparable<Long> {
*
* <li>Any character of the string is not a digit of the specified
* radix, except that the first character may be a plus sign
* {@code '+'} (<code>'&#92;u002B'</code>) provided that the
* {@code '+'} ({@code '\u005Cu002B'}) provided that the
* string is longer than length 1.
*
* <li>The value represented by the string is larger than the
@ -707,7 +707,7 @@ public final class Long extends Number implements Comparable<Long> {
* Parses the string argument as an unsigned decimal {@code long}. The
* characters in the string must all be decimal digits, except
* that the first character may be an an ASCII plus sign {@code
* '+'} (<code>'&#92;u002B'</code>). The resulting integer value
* '+'} ({@code '\u005Cu002B'}). The resulting integer value
* is returned, exactly as if the argument and the radix 10 were
* given as arguments to the {@link
* #parseUnsignedLong(java.lang.String, int)} method.
@ -1148,8 +1148,8 @@ public final class Long extends Number implements Comparable<Long> {
* </ul>
*
* <p>Note that, in every case, neither {@code L}
* (<code>'&#92;u004C'</code>) nor {@code l}
* (<code>'&#92;u006C'</code>) is permitted to appear at the end
* ({@code '\u005Cu004C'}) nor {@code l}
* ({@code '\u005Cu006C'}) is permitted to appear at the end
* of the property value as a type indicator, as would be
* permitted in Java programming language source code.
*

View File

@ -80,8 +80,8 @@ public final class Short extends Number implements Comparable<Short> {
* determined by whether {@link java.lang.Character#digit(char,
* int)} returns a nonnegative value) except that the first
* character may be an ASCII minus sign {@code '-'}
* (<code>'&#92;u002D'</code>) to indicate a negative value or an
* ASCII plus sign {@code '+'} (<code>'&#92;u002B'</code>) to
* ({@code '\u005Cu002D'}) to indicate a negative value or an
* ASCII plus sign {@code '+'} ({@code '\u005Cu002B'}) to
* indicate a positive value. The resulting {@code short} value
* is returned.
*
@ -97,8 +97,8 @@ public final class Short extends Number implements Comparable<Short> {
*
* <li> Any character of the string is not a digit of the
* specified radix, except that the first character may be a minus
* sign {@code '-'} (<code>'&#92;u002D'</code>) or plus sign
* {@code '+'} (<code>'&#92;u002B'</code>) provided that the
* sign {@code '-'} ({@code '\u005Cu002D'}) or plus sign
* {@code '+'} ({@code '\u005Cu002B'}) provided that the
* string is longer than length 1.
*
* <li> The value represented by the string is not a value of type
@ -126,9 +126,9 @@ public final class Short extends Number implements Comparable<Short> {
* Parses the string argument as a signed decimal {@code
* short}. The characters in the string must all be decimal
* digits, except that the first character may be an ASCII minus
* sign {@code '-'} (<code>'&#92;u002D'</code>) to indicate a
* sign {@code '-'} ({@code '\u005Cu002D'}) to indicate a
* negative value or an ASCII plus sign {@code '+'}
* (<code>'&#92;u002B'</code>) to indicate a positive value. The
* ({@code '\u005Cu002B'}) to indicate a positive value. The
* resulting {@code short} value is returned, exactly as if the
* argument and the radix 10 were given as arguments to the {@link
* #parseShort(java.lang.String, int)} method.

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -37,8 +37,8 @@ import java.io.BufferedWriter;
import java.lang.reflect.*;
/**
* The <code>Properties</code> class represents a persistent set of
* properties. The <code>Properties</code> can be saved to a stream
* The {@code Properties} class represents a persistent set of
* properties. The {@code Properties} can be saved to a stream
* or loaded from a stream. Each key and its corresponding value in
* the property list is a string.
* <p>
@ -46,17 +46,17 @@ import java.lang.reflect.*;
* "defaults"; this second property list is searched if
* the property key is not found in the original property list.
* <p>
* Because <code>Properties</code> inherits from <code>Hashtable</code>, the
* <code>put</code> and <code>putAll</code> methods can be applied to a
* <code>Properties</code> object. Their use is strongly discouraged as they
* Because {@code Properties} inherits from {@code Hashtable}, the
* {@code put} and {@code putAll} methods can be applied to a
* {@code Properties} object. Their use is strongly discouraged as they
* allow the caller to insert entries whose keys or values are not
* <code>Strings</code>. The <code>setProperty</code> method should be used
* instead. If the <code>store</code> or <code>save</code> method is called
* on a "compromised" <code>Properties</code> object that contains a
* non-<code>String</code> key or value, the call will fail. Similarly,
* the call to the <code>propertyNames</code> or <code>list</code> method
* will fail if it is called on a "compromised" <code>Properties</code>
* object that contains a non-<code>String</code> key.
* {@code Strings}. The {@code setProperty} method should be used
* instead. If the {@code store} or {@code save} method is called
* on a "compromised" {@code Properties} object that contains a
* non-{@code String} key or value, the call will fail. Similarly,
* the call to the {@code propertyNames} or {@code list} method
* will fail if it is called on a "compromised" {@code Properties}
* object that contains a non-{@code String} key.
*
* <p>
* The {@link #load(java.io.Reader) load(Reader)} <tt>/</tt>
@ -146,15 +146,15 @@ class Properties extends Hashtable<Object,Object> {
}
/**
* Calls the <tt>Hashtable</tt> method <code>put</code>. Provided for
* Calls the <tt>Hashtable</tt> method {@code put}. Provided for
* parallelism with the <tt>getProperty</tt> method. Enforces use of
* strings for property keys and values. The value returned is the
* result of the <tt>Hashtable</tt> call to <code>put</code>.
* result of the <tt>Hashtable</tt> call to {@code put}.
*
* @param key the key to be placed into this property list.
* @param value the value corresponding to <tt>key</tt>.
* @return the previous value of the specified key in this property
* list, or <code>null</code> if it did not have one.
* list, or {@code null} if it did not have one.
* @see #getProperty
* @since 1.2
*/
@ -171,13 +171,13 @@ class Properties extends Hashtable<Object,Object> {
* kinds of line, <i>natural lines</i> and <i>logical lines</i>.
* A natural line is defined as a line of
* characters that is terminated either by a set of line terminator
* characters (<code>\n</code> or <code>\r</code> or <code>\r\n</code>)
* characters ({@code \n} or {@code \r} or {@code \r\n})
* or by the end of the stream. A natural line may be either a blank line,
* a comment line, or hold all or some of a key-element pair. A logical
* line holds all the data of a key-element pair, which may be spread
* out across several adjacent natural lines by escaping
* the line terminator sequence with a backslash character
* <code>\</code>. Note that a comment line cannot be extended
* {@code \}. Note that a comment line cannot be extended
* in this manner; every natural line that is a comment must have
* its own comment indicator, as described below. Lines are read from
* input until the end of the stream is reached.
@ -185,13 +185,13 @@ class Properties extends Hashtable<Object,Object> {
* <p>
* A natural line that contains only white space characters is
* considered blank and is ignored. A comment line has an ASCII
* <code>'#'</code> or <code>'!'</code> as its first non-white
* {@code '#'} or {@code '!'} as its first non-white
* space character; comment lines are also ignored and do not
* encode key-element information. In addition to line
* terminators, this format considers the characters space
* (<code>' '</code>, <code>'&#92;u0020'</code>), tab
* (<code>'\t'</code>, <code>'&#92;u0009'</code>), and form feed
* (<code>'\f'</code>, <code>'&#92;u000C'</code>) to be white
* ({@code ' '}, {@code '\u005Cu0020'}), tab
* ({@code '\t'}, {@code '\u005Cu0009'}), and form feed
* ({@code '\f'}, {@code '\u005Cu000C'}) to be white
* space.
*
* <p>
@ -215,31 +215,31 @@ class Properties extends Hashtable<Object,Object> {
* <p>
* The key contains all of the characters in the line starting
* with the first non-white space character and up to, but not
* including, the first unescaped <code>'='</code>,
* <code>':'</code>, or white space character other than a line
* including, the first unescaped {@code '='},
* {@code ':'}, or white space character other than a line
* terminator. All of these key termination characters may be
* included in the key by escaping them with a preceding backslash
* character; for example,<p>
*
* <code>\:\=</code><p>
* {@code \:\=}<p>
*
* would be the two-character key <code>":="</code>. Line
* terminator characters can be included using <code>\r</code> and
* <code>\n</code> escape sequences. Any white space after the
* would be the two-character key {@code ":="}. Line
* terminator characters can be included using {@code \r} and
* {@code \n} escape sequences. Any white space after the
* key is skipped; if the first non-white space character after
* the key is <code>'='</code> or <code>':'</code>, then it is
* the key is {@code '='} or {@code ':'}, then it is
* ignored and any white space characters after it are also
* skipped. All remaining characters on the line become part of
* the associated element string; if there are no remaining
* characters, the element is the empty string
* <code>&quot;&quot;</code>. Once the raw character sequences
* {@code ""}. Once the raw character sequences
* constituting the key and element are identified, escape
* processing is performed as described above.
*
* <p>
* As an example, each of the following three lines specifies the key
* <code>"Truth"</code> and the associated element value
* <code>"Beauty"</code>:
* {@code "Truth"} and the associated element value
* {@code "Beauty"}:
* <p>
* <pre>
* Truth = Beauty
@ -254,11 +254,11 @@ class Properties extends Hashtable<Object,Object> {
* cantaloupe, watermelon, \
* kiwi, mango
* </pre>
* The key is <code>"fruits"</code> and the associated element is:
* The key is {@code "fruits"} and the associated element is:
* <p>
* <pre>"apple, banana, pear, cantaloupe, watermelon, kiwi, mango"</pre>
* Note that a space appears before each <code>\</code> so that a space
* will appear after each comma in the final result; the <code>\</code>,
* Note that a space appears before each {@code \} so that a space
* will appear after each comma in the final result; the {@code \},
* line terminator, and leading white space on the continuation line are
* merely discarded and are <i>not</i> replaced by one or more other
* characters.
@ -267,8 +267,8 @@ class Properties extends Hashtable<Object,Object> {
* <p>
* <pre>cheeses
* </pre>
* specifies that the key is <code>"cheeses"</code> and the associated
* element is the empty string <code>""</code>.<p>
* specifies that the key is {@code "cheeses"} and the associated
* element is the empty string {@code ""}.<p>
* <p>
*
* <a name="unicodeescapes"></a>
@ -283,17 +283,17 @@ class Properties extends Hashtable<Object,Object> {
* <ul>
* <li> Octal escapes are not recognized.
*
* <li> The character sequence <code>\b</code> does <i>not</i>
* <li> The character sequence {@code \b} does <i>not</i>
* represent a backspace character.
*
* <li> The method does not treat a backslash character,
* <code>\</code>, before a non-valid escape character as an
* {@code \}, before a non-valid escape character as an
* error; the backslash is silently dropped. For example, in a
* Java string the sequence <code>"\z"</code> would cause a
* Java string the sequence {@code "\z"} would cause a
* compile time error. In contrast, this method silently drops
* the backslash. Therefore, this method treats the two character
* sequence <code>"\b"</code> as equivalent to the single
* character <code>'b'</code>.
* sequence {@code "\b"} as equivalent to the single
* character {@code 'b'}.
*
* <li> Escapes are not necessary for single and double quotes;
* however, by the rule above, single and double quote characters
@ -689,20 +689,20 @@ class Properties extends Hashtable<Object,Object> {
}
/**
* Calls the <code>store(OutputStream out, String comments)</code> method
* Calls the {@code store(OutputStream out, String comments)} method
* and suppresses IOExceptions that were thrown.
*
* @deprecated This method does not throw an IOException if an I/O error
* occurs while saving the property list. The preferred way to save a
* properties list is via the <code>store(OutputStream out,
* String comments)</code> method or the
* <code>storeToXML(OutputStream os, String comment)</code> method.
* properties list is via the {@code store(OutputStream out,
* String comments)} method or the
* {@code storeToXML(OutputStream os, String comment)} method.
*
* @param out an output stream.
* @param comments a description of the property list.
* @exception ClassCastException if this <code>Properties</code> object
* @exception ClassCastException if this {@code Properties} object
* contains any keys or values that are not
* <code>Strings</code>.
* {@code Strings}.
*/
@Deprecated
public void save(OutputStream out, String comments) {
@ -714,37 +714,37 @@ class Properties extends Hashtable<Object,Object> {
/**
* Writes this property list (key and element pairs) in this
* <code>Properties</code> table to the output character stream in a
* {@code Properties} table to the output character stream in a
* format suitable for using the {@link #load(java.io.Reader) load(Reader)}
* method.
* <p>
* Properties from the defaults table of this <code>Properties</code>
* Properties from the defaults table of this {@code Properties}
* table (if any) are <i>not</i> written out by this method.
* <p>
* If the comments argument is not null, then an ASCII <code>#</code>
* If the comments argument is not null, then an ASCII {@code #}
* character, the comments string, and a line separator are first written
* to the output stream. Thus, the <code>comments</code> can serve as an
* to the output stream. Thus, the {@code comments} can serve as an
* identifying comment. Any one of a line feed ('\n'), a carriage
* return ('\r'), or a carriage return followed immediately by a line feed
* in comments is replaced by a line separator generated by the <code>Writer</code>
* and if the next character in comments is not character <code>#</code> or
* character <code>!</code> then an ASCII <code>#</code> is written out
* in comments is replaced by a line separator generated by the {@code Writer}
* and if the next character in comments is not character {@code #} or
* character {@code !} then an ASCII {@code #} is written out
* after that line separator.
* <p>
* Next, a comment line is always written, consisting of an ASCII
* <code>#</code> character, the current date and time (as if produced
* by the <code>toString</code> method of <code>Date</code> for the
* current time), and a line separator as generated by the <code>Writer</code>.
* {@code #} character, the current date and time (as if produced
* by the {@code toString} method of {@code Date} for the
* current time), and a line separator as generated by the {@code Writer}.
* <p>
* Then every entry in this <code>Properties</code> table is
* Then every entry in this {@code Properties} table is
* written out, one per line. For each entry the key string is
* written, then an ASCII <code>=</code>, then the associated
* written, then an ASCII {@code =}, then the associated
* element string. For the key, all space characters are
* written with a preceding <code>\</code> character. For the
* written with a preceding {@code \} character. For the
* element, leading space characters, but not embedded or trailing
* space characters, are written with a preceding <code>\</code>
* character. The key and element characters <code>#</code>,
* <code>!</code>, <code>=</code>, and <code>:</code> are written
* space characters, are written with a preceding {@code \}
* character. The key and element characters {@code #},
* {@code !}, {@code =}, and {@code :} are written
* with a preceding backslash to ensure that they are properly loaded.
* <p>
* After the entries have been written, the output stream is flushed.
@ -755,9 +755,9 @@ class Properties extends Hashtable<Object,Object> {
* @param comments a description of the property list.
* @exception IOException if writing this property list to the specified
* output stream throws an <tt>IOException</tt>.
* @exception ClassCastException if this <code>Properties</code> object
* contains any keys or values that are not <code>Strings</code>.
* @exception NullPointerException if <code>writer</code> is null.
* @exception ClassCastException if this {@code Properties} object
* contains any keys or values that are not {@code Strings}.
* @exception NullPointerException if {@code writer} is null.
* @since 1.6
*/
public void store(Writer writer, String comments)
@ -771,11 +771,11 @@ class Properties extends Hashtable<Object,Object> {
/**
* Writes this property list (key and element pairs) in this
* <code>Properties</code> table to the output stream in a format suitable
* for loading into a <code>Properties</code> table using the
* {@code Properties} table to the output stream in a format suitable
* for loading into a {@code Properties} table using the
* {@link #load(InputStream) load(InputStream)} method.
* <p>
* Properties from the defaults table of this <code>Properties</code>
* Properties from the defaults table of this {@code Properties}
* table (if any) are <i>not</i> written out by this method.
* <p>
* This method outputs the comments, properties keys and values in
@ -786,12 +786,12 @@ class Properties extends Hashtable<Object,Object> {
* <li>The stream is written using the ISO 8859-1 character encoding.
*
* <li>Characters not in Latin-1 in the comments are written as
* <code>&#92;u</code><i>xxxx</i> for their appropriate unicode
* {@code \u005Cu}<i>xxxx</i> for their appropriate unicode
* hexadecimal value <i>xxxx</i>.
*
* <li>Characters less than <code>&#92;u0020</code> and characters greater
* than <code>&#92;u007E</code> in property keys or values are written
* as <code>&#92;u</code><i>xxxx</i> for the appropriate hexadecimal
* <li>Characters less than {@code \u005Cu0020} and characters greater
* than {@code \u005Cu007E} in property keys or values are written
* as {@code \u005Cu}<i>xxxx</i> for the appropriate hexadecimal
* value <i>xxxx</i>.
* </ul>
* <p>
@ -802,9 +802,9 @@ class Properties extends Hashtable<Object,Object> {
* @param comments a description of the property list.
* @exception IOException if writing this property list to the specified
* output stream throws an <tt>IOException</tt>.
* @exception ClassCastException if this <code>Properties</code> object
* contains any keys or values that are not <code>Strings</code>.
* @exception NullPointerException if <code>out</code> is null.
* @exception ClassCastException if this {@code Properties} object
* contains any keys or values that are not {@code Strings}.
* @exception NullPointerException if {@code out} is null.
* @since 1.2
*/
public void store(OutputStream out, String comments)
@ -857,7 +857,7 @@ class Properties extends Hashtable<Object,Object> {
* results in an <tt>IOException</tt>.
* @throws InvalidPropertiesFormatException Data on input stream does not
* constitute a valid XML document with the mandated document type.
* @throws NullPointerException if <code>in</code> is null.
* @throws NullPointerException if {@code in} is null.
* @see #storeToXML(OutputStream, String, String)
* @since 1.5
*/
@ -879,14 +879,14 @@ class Properties extends Hashtable<Object,Object> {
* <tt>props.storeToXML(os, comment, "UTF-8");</tt>.
*
* @param os the output stream on which to emit the XML document.
* @param comment a description of the property list, or <code>null</code>
* @param comment a description of the property list, or {@code null}
* if no comment is desired.
* @throws IOException if writing to the specified output stream
* results in an <tt>IOException</tt>.
* @throws NullPointerException if <code>os</code> is null.
* @throws ClassCastException if this <code>Properties</code> object
* @throws NullPointerException if {@code os} is null.
* @throws ClassCastException if this {@code Properties} object
* contains any keys or values that are not
* <code>Strings</code>.
* {@code Strings}.
* @see #loadFromXML(InputStream)
* @since 1.5
*/
@ -907,13 +907,13 @@ class Properties extends Hashtable<Object,Object> {
* &lt;!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"&gt;
* </pre>
*
*<p>If the specified comment is <code>null</code> then no comment
*<p>If the specified comment is {@code null} then no comment
* will be stored in the document.
*
* <p>The specified stream remains open after this method returns.
*
* @param os the output stream on which to emit the XML document.
* @param comment a description of the property list, or <code>null</code>
* @param comment a description of the property list, or {@code null}
* if no comment is desired.
* @param encoding the name of a supported
* <a href="../lang/package-summary.html#charenc">
@ -921,11 +921,11 @@ class Properties extends Hashtable<Object,Object> {
*
* @throws IOException if writing to the specified output stream
* results in an <tt>IOException</tt>.
* @throws NullPointerException if <code>os</code> is <code>null</code>,
* or if <code>encoding</code> is <code>null</code>.
* @throws ClassCastException if this <code>Properties</code> object
* @throws NullPointerException if {@code os} is {@code null},
* or if {@code encoding} is {@code null}.
* @throws ClassCastException if this {@code Properties} object
* contains any keys or values that are not
* <code>Strings</code>.
* {@code Strings}.
* @see #loadFromXML(InputStream)
* @since 1.5
*/
@ -941,7 +941,7 @@ class Properties extends Hashtable<Object,Object> {
* Searches for the property with the specified key in this property list.
* If the key is not found in this property list, the default property list,
* and its defaults, recursively, are then checked. The method returns
* <code>null</code> if the property is not found.
* {@code null} if the property is not found.
*
* @param key the property key.
* @return the value in this property list with the specified key value.