|
9 | 9 | import java.util.List; |
10 | 10 | import java.util.Map; |
11 | 11 | import java.util.Set; |
| 12 | +import java.util.stream.Collectors; |
12 | 13 | import javax.swing.JTable; |
13 | 14 | import javax.swing.table.DefaultTableCellRenderer; |
14 | 15 | import javax.swing.table.DefaultTableModel; |
@@ -120,7 +121,11 @@ public void setIntValue(Integer value, String item, int... index){ |
120 | 121 | } |
121 | 122 | } |
122 | 123 | } |
123 | | - |
| 124 | + |
| 125 | + public void setIntValueByHash(Integer value, int column, long hash) { |
| 126 | + this.entries.getItemByHash(hash).setValue(column, value); |
| 127 | + } |
| 128 | + |
124 | 129 | public void setDoubleValue(Double value, String item, int... index){ |
125 | 130 | if(this.entries.hasItem(index)==false){ |
126 | 131 | if(DEBUG_MODE>0) System.out.println( "[IndexedTable] ---> error.. entry does not exist"); |
@@ -166,6 +171,18 @@ public double getDoubleValueByHash(String item, long hash) { |
166 | 171 | return 0; |
167 | 172 | } |
168 | 173 |
|
| 174 | + public List<Number> getValuesByHash(long hash) { |
| 175 | + return this.entries.getItemByHash(hash).entryValues; |
| 176 | + } |
| 177 | + |
| 178 | + public List<Integer> getIntegersByHash(long hash) { |
| 179 | + return getValuesByHash(hash).stream().map(x -> x.intValue()).collect(Collectors.toList()); |
| 180 | + } |
| 181 | + |
| 182 | + public List<Double> getDoublesByHash(long hash) { |
| 183 | + return getValuesByHash(hash).stream().map(x -> x.doubleValue()).collect(Collectors.toList()); |
| 184 | + } |
| 185 | + |
169 | 186 | public int getIntValue(String item, int... index){ |
170 | 187 | if(this.entries.hasItem(index)==false){ |
171 | 188 | if(DEBUG_MODE>0) System.out.println( "[IndexedTable] ---> error.. entry does not exist"); |
|
0 commit comments