Select values out of tuple given a Fields selector Note that this function can throw a NullPointerException if the fields in selector are not found in the index. @param selector Fields to select @param tuple tuple to select from
(Fields selector, List<Object> tuple)
| 53 | * @param tuple tuple to select from |
| 54 | */ |
| 55 | public List<Object> select(Fields selector, List<Object> tuple) { |
| 56 | List<Object> ret = new ArrayList<>(selector.size()); |
| 57 | for (String s : selector) { |
| 58 | ret.add(tuple.get(fieldIndex(s))); |
| 59 | } |
| 60 | return ret; |
| 61 | } |
| 62 | |
| 63 | public List<String> toList() { |
| 64 | return new ArrayList<>(fields); |