You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Benedikt Ritter <br...@apache.org> on 2013/03/20 20:53:56 UTC
Re: svn commit: r1459020 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVRecord.java
2013/3/20 <br...@apache.org>
> Author: britter
> Date: Wed Mar 20 19:52:27 2013
> New Revision: 1459020
>
> URL: http://svn.apache.org/r1459020
> Log:
> Add missing JavaDoc
>
> Modified:
>
> commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVRecord.java
>
> Modified:
> commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVRecord.java
> URL:
> http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVRecord.java?rev=1459020&r1=1459019&r2=1459020&view=diff
>
> ==============================================================================
> ---
> commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVRecord.java
> (original)
> +++
> commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVRecord.java
> Wed Mar 20 19:52:27 2013
> @@ -23,7 +23,7 @@ import java.util.Iterator;
> import java.util.Map;
>
> /**
> - * A CSV record
> + * A CSV record parsed from a CSV file.
> *
> * @version $Id$
> */
> @@ -103,6 +103,11 @@ public class CSVRecord implements Serial
> return isMapped(name) && mapping.get(name).intValue() <
> values.length;
> }
>
> + /**
> + * Returns an iterator over the values of this record.
> + *
> + * @return an iterator over the values of this record.
> + */
>
I had no better idea how to comment this. Any suggestions how to make this
less redundant?
> public Iterator<String> iterator() {
> return Arrays.asList(values).iterator();
> }
> @@ -111,16 +116,29 @@ public class CSVRecord implements Serial
> return values;
> }
>
> + /**
> + * Returns the comment for this record, if any.
> + *
> + * @return the comment for this record, or null if no comment for this
> + * record is available.
> + */
> public String getComment() {
> return comment;
> }
>
> + /**
> + * Returns the number of this record in the parsed CSV file.
> + *
> + * @return the number of this record.
> + */
> public long getRecordNumber() {
> return recordNumber;
> }
>
> /**
> * Returns the number of values in this record.
> + *
> + * @return the number of values.
> */
> public int size() {
> return values.length;
>
>
>
Re: svn commit: r1459020 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVRecord.java
Posted by Christian Grobmeier <gr...@gmail.com>.
>> On Wed, Mar 20, 2013 at 8:53 PM, Benedikt Ritter <br...@apache.org>
>> wrote:
>> >> + /**
>> >> + * Returns an iterator over the values of this record.
> Iterable<T>.iterator() doc is:
>
> "Returns an iterator over a set of elements of type T."
>
> I thought it would be nice to tweak this a bit to match a CSVRecord. But
> you're right every programmer should know what a iterator is and does.
If not, then the javadocs don't help.
>> BTW, I love this post from our fellow Torsten Curdt, who is not often
>> seen here (unfortunately):
>> http://vafer.org/blog/20050323095453/
>
> Unfortunately I haven't seen commits for commons from you in a long time
> either ;-)
12 days is already long? ;-)
http://svn.apache.org/viewvc/commons/proper/ognl/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: svn commit: r1459020 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVRecord.java
Posted by Benedikt Ritter <br...@apache.org>.
2013/3/20 Christian Grobmeier <gr...@gmail.com>
> On Wed, Mar 20, 2013 at 8:53 PM, Benedikt Ritter <br...@apache.org>
> wrote:
> >> + /**
> >> + * Returns an iterator over the values of this record.
> >> + *
> >> + * @return an iterator over the values of this record.
> >> + */
> >>
> >
> > I had no better idea how to comment this. Any suggestions how to make
> this
> > less redundant?
>
> If you ask me, delete it. A method called iterator() is already docs
> enough.
>
Iterable<T>.iterator() doc is:
"Returns an iterator over a set of elements of type T."
I thought it would be nice to tweak this a bit to match a CSVRecord. But
you're right every programmer should know what a iterator is and does.
>
> BTW, I love this post from our fellow Torsten Curdt, who is not often
> seen here (unfortunately):
> http://vafer.org/blog/20050323095453/
Unfortunately I haven't seen commits for commons from you in a long time
either ;-)
>
>
> I know people want it because of checkstyle, but actually this docs
> are not giving me anything.
>
>
>
> --
> http://www.grobmeier.de
> https://www.timeandbill.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
--
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter
Re: svn commit: r1459020 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVRecord.java
Posted by Christian Grobmeier <gr...@gmail.com>.
On Wed, Mar 20, 2013 at 8:53 PM, Benedikt Ritter <br...@apache.org> wrote:
>> + /**
>> + * Returns an iterator over the values of this record.
>> + *
>> + * @return an iterator over the values of this record.
>> + */
>>
>
> I had no better idea how to comment this. Any suggestions how to make this
> less redundant?
If you ask me, delete it. A method called iterator() is already docs enough.
BTW, I love this post from our fellow Torsten Curdt, who is not often
seen here (unfortunately):
http://vafer.org/blog/20050323095453/
I know people want it because of checkstyle, but actually this docs
are not giving me anything.
--
http://www.grobmeier.de
https://www.timeandbill.de
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org