Logo Search packages:      
Sourcecode: cacao-oj6 version File versions

int java::nio::LongBuffer::compareTo ( LongBuffer  that  )  [inline]

Compares this buffer to another.

Two long buffers are compared by comparing their sequences of remaining elements lexicographically, without regard to the starting position of each sequence within its corresponding buffer.

A long buffer is not comparable to any other type of object.

A negative integer, zero, or a positive integer as this buffer is less than, equal to, or greater than the given buffer

Definition at line 1143 of file LongBuffer.java.

References get().

        int n = this.position() + Math.min(this.remaining(), that.remaining());
        for (int i = this.position(), j = that.position(); i < n; i++, j++) {
            long v1 = this.get(i);
            long v2 = that.get(j);
            if (v1 == v2)
            if ((v1 != v1) && (v2 != v2))       // For float and double
            if (v1 < v2)
                return -1;
            return +1;
        return this.remaining() - that.remaining();

Generated by  Doxygen 1.6.0   Back to index