@Override public int getColumnCount() { if (columnCount > -1) { return columnCount; } if (gazetteerListFiltered == null) { return 0; } columnCount = 1; // read all the features maps to find the biggest one for (Object object : gazetteerListFiltered) { GazetteerNode node = (GazetteerNode) object; Map<String,Object> map = node.getFeatureMap(); if (map != null && columnCount < 2*map.size()+1) { columnCount = 2*map.size() + 1; } } return columnCount; }
@Override public Object getValueAt(int row, int column) { GazetteerNode node = gazetteerListFiltered.get(row); if (column == 0) { return node.getEntry(); } else { Map<String,Object> featureMap = node.getFeatureMap(); if (featureMap == null || featureMap.size()*2 < column) { return ""; } List<String> features = new ArrayList<String>(featureMap.keySet()); int featureCount = (column + (column % 2)) / 2; if (column % 2 == 1) { return features.get(featureCount-1); } else { return featureMap.get(features.get(featureCount-1)); } } }
GazetteerNode node = (GazetteerNode) object; boolean match = false; Map<String,Object> map = node.getFeatureMap(); if (map != null && !onlyValueCheckBox.isSelected()) { for (String key : map.keySet()) {
if(entry.length() > 0) { result.append(entry); Map<String,Object> featureMap = node.getFeatureMap(); if(featureMap != null && (featureMap.size() > 0)) { result.append(node.featureMapToString(featureMap));
public void addEmptyFeatureColumns() { // find the first row fully filled with value if (getColumnCount() == 1) { GazetteerNode node = gazetteerListFiltered.get(0); Map<String, Object> map = new HashMap<String, Object>(); // add a couple of rows map.put("", ""); node.setFeatureMap(map); } else { for (Object object : gazetteerListFiltered) { GazetteerNode node = (GazetteerNode) object; Map<String,Object> map = node.getFeatureMap(); if (map != null && (2*map.size()+1) == getColumnCount()) { map.put("", ""); break; } } } for (Object object : gazetteerList) { GazetteerNode node = (GazetteerNode) object; node.setSeparator(linearDefinition.getSeparator()); } }
entry = gazNode.getEntry(); Map<String,Object> features = gazNode.getFeatureMap(); if (features == null) { lookup = defaultLookup;