1 |
/* FloatBuffer.java -- |
/* FloatBuffer.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 |
|
|
42 |
* @since 1.4 |
* @since 1.4 |
43 |
*/ |
*/ |
44 |
public abstract class FloatBuffer extends Buffer |
public abstract class FloatBuffer extends Buffer |
45 |
implements Comparable |
implements Comparable<FloatBuffer> |
46 |
{ |
{ |
47 |
int array_offset; |
int array_offset; |
48 |
float[] backing_buffer; |
float[] backing_buffer; |
273 |
{ |
{ |
274 |
if (obj instanceof FloatBuffer) |
if (obj instanceof FloatBuffer) |
275 |
{ |
{ |
276 |
return compareTo (obj) == 0; |
return compareTo ((FloatBuffer) obj) == 0; |
277 |
} |
} |
278 |
|
|
279 |
return false; |
return false; |
285 |
* @exception ClassCastException If obj is not an object derived from |
* @exception ClassCastException If obj is not an object derived from |
286 |
* <code>FloatBuffer</code>. |
* <code>FloatBuffer</code>. |
287 |
*/ |
*/ |
288 |
public int compareTo (Object obj) |
public int compareTo (FloatBuffer other) |
289 |
{ |
{ |
|
FloatBuffer other = (FloatBuffer) obj; |
|
|
|
|
290 |
int num = Math.min(remaining(), other.remaining()); |
int num = Math.min(remaining(), other.remaining()); |
291 |
int pos_this = position(); |
int pos_this = position(); |
292 |
int pos_other = other.position(); |
int pos_other = other.position(); |