biz.neustar.wpm.api
Interface CSVTable


public interface CSVTable

An object that represents a CSV table of data. A CSV table must have a header row which contains labels for each column in the CSV table. Values must be comma separated and, optionally, quoted using double quotes (ex ").


Method Summary
 java.util.Map<java.lang.String,java.lang.String> get(int i)
          Returns the specified row (zero-indexed) from the CSV table.
 java.util.Map<java.lang.String,java.lang.String> random()
          Returns a random row in the CSV table.
 int size()
          Returns the total number of rows in the CSV file, minus the header row.
 

Method Detail

size

int size()
Returns the total number of rows in the CSV file, minus the header row.

Returns:
the number of values in the CSV

random

java.util.Map<java.lang.String,java.lang.String> random()
Returns a random row in the CSV table. The returned map is a key/value pair of the CSV headers (which comes from the first row) as the key and the random row's data as the values.

Returns:
the map containing the values of the random row.

get

java.util.Map<java.lang.String,java.lang.String> get(int i)
Returns the specified row (zero-indexed) from the CSV table. The returned map is a key/value pair of the CSV headers (which comes from the first row) as the key and the random row's data as the values.

Parameters:
i - the index of the CSV table, where 0 is the first row after the header row.
Returns:
the map containing the values of the random row.

Copyright © 2014 Neustar, Inc. All Rights Reserved.