/[classpath]/classpath/java/lang/String.java
ViewVC logotype

Diff of /classpath/java/lang/String.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.57 by saugart, Sat Jun 12 02:29:46 2004 UTC revision 1.58 by mkoch, Thu Jul 22 08:43:44 2004 UTC
# Line 70  import java.util.regex.Pattern; Line 70  import java.util.regex.Pattern;
70   * literal in the object stream.   * literal in the object stream.
71   *   *
72   * @author Paul N. Fisher   * @author Paul N. Fisher
73   * @author Eric Blake <ebb9@email.byu.edu>   * @author Eric Blake (ebb9@email.byu.edu)
74   * @author Per Bothner <bothner@cygnus.com>   * @author Per Bothner (bothner@cygnus.com)
75   * @since 1.0   * @since 1.0
76   * @status updated to 1.4; but could use better data sharing via offset field   * @status updated to 1.4; but could use better data sharing via offset field
77   */   */
# Line 223  public final class String implements Ser Line 223  public final class String implements Ser
223     * @param count the number of characters from data to copy     * @param count the number of characters from data to copy
224     * @throws NullPointerException if data is null     * @throws NullPointerException if data is null
225     * @throws IndexOutOfBoundsException if (offset &lt; 0 || count &lt; 0     * @throws IndexOutOfBoundsException if (offset &lt; 0 || count &lt; 0
226     *         || offset + count > data.length)     *         || offset + count &gt; data.length)
227     *         (while unspecified, this is a StringIndexOutOfBoundsException)     *         (while unspecified, this is a StringIndexOutOfBoundsException)
228     */     */
229    public String(char[] data, int offset, int count)    public String(char[] data, int offset, int count)
# Line 237  public final class String implements Ser Line 237  public final class String implements Ser
237     * corresponding byte b, is created in the new String as if by performing:     * corresponding byte b, is created in the new String as if by performing:
238     *     *
239     * <pre>     * <pre>
240     * c = (char) (((hibyte & 0xff) << 8) | (b & 0xff))     * c = (char) (((hibyte &amp; 0xff) &lt;&lt; 8) | (b &amp; 0xff))
241     * </pre>     * </pre>
242     *     *
243     * @param ascii array of integer values     * @param ascii array of integer values
# Line 246  public final class String implements Ser Line 246  public final class String implements Ser
246     * @param count the number of characters from ascii to copy     * @param count the number of characters from ascii to copy
247     * @throws NullPointerException if ascii is null     * @throws NullPointerException if ascii is null
248     * @throws IndexOutOfBoundsException if (offset &lt; 0 || count &lt; 0     * @throws IndexOutOfBoundsException if (offset &lt; 0 || count &lt; 0
249     *         || offset + count > ascii.length)     *         || offset + count &gt; ascii.length)
250     *         (while unspecified, this is a StringIndexOutOfBoundsException)     *         (while unspecified, this is a StringIndexOutOfBoundsException)
251     * @see #String(byte[])     * @see #String(byte[])
252     * @see #String(byte[], String)     * @see #String(byte[], String)
# Line 274  public final class String implements Ser Line 274  public final class String implements Ser
274     * as if by performing:     * as if by performing:
275     *     *
276     * <pre>     * <pre>
277     * c = (char) (((hibyte & 0xff) << 8) | (b & 0xff))     * c = (char) (((hibyte &amp; 0xff) &lt;&lt; 8) | (b &amp; 0xff))
278     * </pre>     * </pre>
279     *     *
280     * @param ascii array of integer values     * @param ascii array of integer values
# Line 788  public final class String implements Ser Line 788  public final class String implements Ser
788     * @param ignoreCase true if case should be ignored in comparision     * @param ignoreCase true if case should be ignored in comparision
789     * @param toffset index to start comparison at for this String     * @param toffset index to start comparison at for this String
790     * @param other String to compare region to this String     * @param other String to compare region to this String
791     * @param ooffset index to start comparison at for other     * @param oofset index to start comparison at for other
792     * @param len number of characters to compare     * @param len number of characters to compare
793     * @return true if regions match, false otherwise     * @return true if regions match, false otherwise
794     * @throws NullPointerException if other is null     * @throws NullPointerException if other is null
# Line 1034  public final class String implements Ser Line 1034  public final class String implements Ser
1034     * Creates a substring of this String, starting at a specified index     * Creates a substring of this String, starting at a specified index
1035     * and ending at one character before a specified index.     * and ending at one character before a specified index.
1036     *     *
1037     * @param beginIndex index to start substring (inclusive, base 0)     * @param begin index to start substring (inclusive, base 0)
1038     * @param endIndex index to end at (exclusive)     * @param end index to end at (exclusive)
1039     * @return new String which is a substring of this String     * @return new String which is a substring of this String
1040     * @throws IndexOutOfBoundsException if begin &lt; 0 || end &gt; length()     * @throws IndexOutOfBoundsException if begin &lt; 0 || end &gt; length()
1041     *         || begin > end (while unspecified, this is a     *         || begin &gt; end (while unspecified, this is a
1042     *         StringIndexOutOfBoundsException)     *         StringIndexOutOfBoundsException)
1043     */     */
1044    public String substring(int beginIndex, int endIndex)    public String substring(int beginIndex, int endIndex)
# Line 1056  public final class String implements Ser Line 1056  public final class String implements Ser
1056    /**    /**
1057     * Creates a substring of this String, starting at a specified index     * Creates a substring of this String, starting at a specified index
1058     * and ending at one character before a specified index. This behaves like     * and ending at one character before a specified index. This behaves like
1059     * <code>substring(beginIndex, endIndex)</code>.     * <code>substring(begin, end)</code>.
1060     *     *
1061     * @param beginIndex index to start substring (inclusive, base 0)     * @param begin index to start substring (inclusive, base 0)
1062     * @param endIndex index to end at (exclusive)     * @param end index to end at (exclusive)
1063     * @return new String which is a substring of this String     * @return new String which is a substring of this String
1064     * @throws IndexOutOfBoundsException if begin &lt; 0 || end &gt; length()     * @throws IndexOutOfBoundsException if begin &lt; 0 || end &gt; length()
1065     *         || begin > end     *         || begin &gt; end
1066     * @since 1.4     * @since 1.4
1067     */     */
1068    public CharSequence subSequence(int beginIndex, int endIndex)    public CharSequence subSequence(int begin, int end)
1069    {    {
1070      return substring(beginIndex, endIndex);      return substring(begin, end);
1071    }    }
1072    
1073    /**    /**
# Line 1470  public final class String implements Ser Line 1470  public final class String implements Ser
1470     * @return String containing the chars from data[offset..offset+count]     * @return String containing the chars from data[offset..offset+count]
1471     * @throws NullPointerException if data is null     * @throws NullPointerException if data is null
1472     * @throws IndexOutOfBoundsException if (offset &lt; 0 || count &lt; 0     * @throws IndexOutOfBoundsException if (offset &lt; 0 || count &lt; 0
1473     *         || offset + count > data.length)     *         || offset + count &gt; data.length)
1474     *         (while unspecified, this is a StringIndexOutOfBoundsException)     *         (while unspecified, this is a StringIndexOutOfBoundsException)
1475     * @see #String(char[], int, int)     * @see #String(char[], int, int)
1476     */     */
# Line 1490  public final class String implements Ser Line 1490  public final class String implements Ser
1490     * @return String containing the chars from data[offset..offset+count]     * @return String containing the chars from data[offset..offset+count]
1491     * @throws NullPointerException if data is null     * @throws NullPointerException if data is null
1492     * @throws IndexOutOfBoundsException if (offset &lt; 0 || count &lt; 0     * @throws IndexOutOfBoundsException if (offset &lt; 0 || count &lt; 0
1493     *         || offset + count > data.length)     *         || offset + count &gt; data.length)
1494     *         (while unspecified, this is a StringIndexOutOfBoundsException)     *         (while unspecified, this is a StringIndexOutOfBoundsException)
1495     * @see #String(char[], int, int)     * @see #String(char[], int, int)
1496     */     */
# Line 1511  public final class String implements Ser Line 1511  public final class String implements Ser
1511     */     */
1512    public static String copyValueOf(char[] data)    public static String copyValueOf(char[] data)
1513    {    {
1514      return new String(data, 0, data.length, false);      return copyValueOf (data, 0, data.length);
1515    }    }
1516    
1517    /**    /**
# Line 1671  public final class String implements Ser Line 1671  public final class String implements Ser
1671    
1672      return value;      return value;
1673    }    }
1674  } // class String  }

Legend:
Removed from v.1.57  
changed lines
  Added in v.1.58

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26