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

int java::nio::LongBuffer::hashCode (  )  [inline]

Returns the current hash code of this buffer.

The hash code of a long buffer depends only upon its remaining elements; that is, upon the elements from position() up to, and including, the element at limit() - 1.

Because buffer hash codes are content-dependent, it is inadvisable to use buffers as keys in hash maps or similar data structures unless it is known that their contents will not change.

Returns:
The current hash code of this buffer

Definition at line 1077 of file LongBuffer.java.

                          {
        int h = 1;
        int p = position();
        for (int i = limit() - 1; i >= p; i--)
            h = 31 * h + (int)get(i);
        return h;
    }


Generated by  Doxygen 1.6.0   Back to index