public String getString(String featureID) { String string = getCachedStringForFeature(featureID); if (string != null) { return string; } Feature feature = findFeature(featureID); if (feature != null) { String value = feature.getString(getElement()); getMapFeatureID2CachedValue().put(featureID, value); return value; } return null; }
/** * look at all the data in the column of the featurecollection, and find the largest string! * * @param fc features to look at * @param attributeNumber which of the column to test. */ int findMaxStringLength(FeatureCollection fc, int attributeNumber) { int l; int maxlen = 0; Feature f; for (Iterator i = fc.iterator(); i.hasNext(); ) { f = (Feature) i.next(); l = f.getString(attributeNumber).length(); if (l > maxlen) { maxlen = l; } } return maxlen; }