final Entry<Integer, JsonElement> next = it.next();
return new Entry<String, JsonElement>() {
@Override
public String getKey() {
EfficientString es = EfficientString.get(next.getKey());
return es.toString();
}
@Override
public JsonElement getValue() {
return next.getValue();
}
@Override
public JsonElement setValue(JsonElement value) {
throw new UnsupportedOperationException("immutable entry");
}
};
}
@Override
public void remove() {
it.remove();
}
};
}
@Override
public boolean remove(Object o) {
throw new UnsupportedOperationException("entry set is immutable");
}
@Override
public boolean removeAll(Collection<?> c) {
throw new UnsupportedOperationException("entry set is immutable");
}
@Override
public boolean retainAll(Collection<?> c) {
throw new UnsupportedOperationException("entry set is immutable");
}
@Override
public int size() {
return entrySet.size();
}
@Override
public Object[] toArray() {
@SuppressWarnings("unchecked")
Entry<String, JsonElement>[] result = new Entry[entrySet.size()];
int i = 0;
for (final Entry<Integer, JsonElement> e : entrySet) {
result[i] = new Entry<String, JsonElement>() {
@Override
public String getKey() {
EfficientString es = EfficientString.get(e.getKey());
return es.toString();
}
@Override
public JsonElement getValue() {
return e.getValue();