boolean (Object component, Object key, Object value) { Object[] previous = (Object[]) component; for (Object[] entry = previous; entry != null; entry = (Object[]) entry[2]) { if (entry[0] == key) { if (value != null) { // set the row's value Object oldvalue = entry[1]; entry[1] = value; return !value.equals(oldvalue); } else { // remove the row previous[2] = entry[2]; entry[2] = null; return true; } } previous = entry; } if (value != null) { // append a new row previous[2] = new Object[] { key, value, null }; return true; } return false; }