/[classpath]/classpath/java/nio/ByteBuffer.java
ViewVC logotype

Diff of /classpath/java/nio/ByteBuffer.java

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

revision 1.21.2.3 by gnu_andrew, Sat Jan 15 17:01:56 2005 UTC revision 1.21.2.4 by tromey, Wed Apr 20 20:30:00 2005 UTC
# Line 1  Line 1 
1  /* ByteBuffer.java --  /* ByteBuffer.java --
2     Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.     Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 42  package java.nio; Line 42  package java.nio;
42   * @since 1.4   * @since 1.4
43   */   */
44  public abstract class ByteBuffer extends Buffer  public abstract class ByteBuffer extends Buffer
45    implements Comparable    implements Comparable<ByteBuffer>
46  {  {
47    ByteOrder endian = ByteOrder.BIG_ENDIAN;    ByteOrder endian = ByteOrder.BIG_ENDIAN;
48    
# Line 290  public abstract class ByteBuffer extends Line 290  public abstract class ByteBuffer extends
290    {    {
291      if (obj instanceof ByteBuffer)      if (obj instanceof ByteBuffer)
292        {        {
293          return compareTo (obj) == 0;          return compareTo ((ByteBuffer) obj) == 0;
294        }        }
295    
296      return false;      return false;
# Line 302  public abstract class ByteBuffer extends Line 302  public abstract class ByteBuffer extends
302     * @exception ClassCastException If obj is not an object derived from     * @exception ClassCastException If obj is not an object derived from
303     * <code>ByteBuffer</code>.     * <code>ByteBuffer</code>.
304     */     */
305    public int compareTo (Object obj)    public int compareTo (ByteBuffer other)
306    {    {
     ByteBuffer other = (ByteBuffer) obj;  
   
307      int num = Math.min(remaining(), other.remaining());      int num = Math.min(remaining(), other.remaining());
308      int pos_this = position();      int pos_this = position();
309      int pos_other = other.position();      int pos_other = other.position();

Legend:
Removed from v.1.21.2.3  
changed lines
  Added in v.1.21.2.4

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