commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Neidhart <thomas.neidh...@gmail.com>
Subject Re: svn commit: r1351852 - in /commons/proper/collections/trunk/src: main/java/org/apache/commons/collections/buffer/ test/java/org/apache/commons/collections/buffer/
Date Wed, 20 Jun 2012 17:19:33 GMT
On 06/20/2012 12:19 AM, sebb wrote:
> On 19 June 2012 22:05,  <tn@apache.org> wrote:
>> Author: tn
>> Date: Tue Jun 19 21:05:48 2012
>> New Revision: 1351852
>>
>> URL: http://svn.apache.org/viewvc?rev=1351852&view=rev
>> Log:
>> [COLLECTIONS-399] Added get(index) method to BoundedFifoBuffer.
>>
>> Modified:
>>    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/buffer/BoundedFifoBuffer.java
>>    commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/buffer/TestBoundedFifoBuffer.java
>>    commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/buffer/TestCircularFifoBuffer.java
>>
>> Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/buffer/BoundedFifoBuffer.java
>> URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/buffer/BoundedFifoBuffer.java?rev=1351852&r1=1351851&r2=1351852&view=diff
>> ==============================================================================
>> --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/buffer/BoundedFifoBuffer.java
(original)
>> +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/buffer/BoundedFifoBuffer.java
Tue Jun 19 21:05:48 2012
>> @@ -131,7 +131,7 @@ public class BoundedFifoBuffer<E> extend
>>      * Write the buffer out using a custom routine.
>>      *
>>      * @param out  the output stream
>> -     * @throws IOException
>> +     * @throws IOException if an I/O error occurs while writing to the output stream
>>      */
>>     private void writeObject(ObjectOutputStream out) throws IOException {
>>         out.defaultWriteObject();
>> @@ -145,8 +145,8 @@ public class BoundedFifoBuffer<E> extend
>>      * Read the buffer in using a custom routine.
>>      *
>>      * @param in  the input stream
>> -     * @throws IOException
>> -     * @throws ClassNotFoundException
>> +     * @throws IOException if an I/O error occurs while writing to the output stream
>> +     * @throws ClassNotFoundException if the class of a serialized object can not
be found
>>      */
>>     @SuppressWarnings("unchecked")
>>     private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
>> @@ -270,6 +270,22 @@ public class BoundedFifoBuffer<E> extend
>>     }
>>
>>     /**
>> +     * Returns the element at the specified position in this buffer.
>> +     *
>> +     * @param index the position of the element in the buffer
>> +     * @return the element at position {@code index}
>> +     * @throws NoSuchElementException if the requested position is outside the range
[0, size)
>> +     */
>> +    public E get(int index) {
>> +        if (index < 0 || index >= size()) {
>> +            throw new NoSuchElementException();
> 
> It would be helpful to show the values of index and size().

done. Thanks for looking at it.

Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message