commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [csv] CSVRecord and Map<String, String>
Date Tue, 21 Jan 2014 13:44:33 GMT
On Tue, Jan 21, 2014 at 8:22 AM, Emmanuel Bourg <ebourg@apache.org> wrote:

> Le 21/01/2014 14:04, Gary Gregory a écrit :
>
> > - CSVRecord implements Map<String, String>
> > - CSVRecord implements Map<String, String> but read-only
>
> -1
>
> > - CSVRecord implements toMap() -> Map<String, String> (a plain HashMap)
>
> +0 (that's fine if the map is a copy of the record)
>

That's what the current impl does: a new HashMap with String keys and
String values. Since Strings are immutable, they do not need to be a
'copy'. Unless I misunderstand you.

Gary


> > - CSVRecord implements toMap() -> Map<String, String> (a read-only
> HashMap)
>
> +1
>
> Emmanuel Bourg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message