CSVRecordMap implements Map<String, String> {
    CSVRecordMap(CSVRecord record) {
    }
}

Use the Map implementation to access the record in a Map-like way, use the CSVRecord instance to access the record in a List-like way.

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 1/16/2014 1:04 AM, Gary Gregory wrote:
Maybe we _should_ revisit splitting the record class. Now, we have the
following slots:

CSVRecord:
comment : String
mapping : Map<String, Integer>
recordNumber : long
values : String[]

If we take out mapping and put in it a subclass, that reduces the "size" of
the plain record by 25%:

CSVRecord:
comment : String
recordNumber : long
values : String[]

CSVRecordMap extends CSVRecord
mapping : Map<String, Integer>

or:

CSVRecordMap extends CSVRecord implements Map<String, String>
mapping : Map<String, Integer>


Thoughts?

Gary


On Wed, Jan 15, 2014 at 11:22 AM, Emmanuel Bourg <ebo...@apache.org> wrote:

Le 15/01/2014 07:17, Benedikt Ritter a écrit :
A wrapper of some kind like Adrian suggested sounds like the way to go
here. Maybe we could have something like:

Map<String, String> map = CSVRecordUtils.toMap(record);

I had something like that in mind too, but I would rather use
record.toMap() and avoid exposing a new class.

Emmanuel Bourg


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





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

Reply via email to