Skip to content

Commit

Permalink
Implement toString on proxy classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
melontini committed May 9, 2024
1 parent 4453bdd commit 80e5a97
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ protected EvaluationValue get(int index) {
};
}

@Override
public String toString() {
StringJoiner joiner = new StringJoiner(", ", "[", "]");
for (int i = 0; i < size; i++) {
joiner.add(String.valueOf(function.apply(i)));
}
return joiner.toString();
}

@Override
public EvaluationValue get(int index) {
return ProxyMap.convert(this.function.apply(index));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ public EvaluationValue get(Object key) {
if (!(key instanceof String s)) return EvaluationValue.nullValue();
return convert(compound.get(s));
}

@Override
public String toString() {
return String.valueOf(compound);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ public EvaluationValue get(Object key) {
}
return EvaluationValue.nullValue();
}

@Override
public String toString() {
return String.valueOf(state.getEntries());
}
}

0 comments on commit 80e5a97

Please sign in to comment.