Skip to content
Snippets Groups Projects
Commit 3b254acf authored by Markus Alexander Kuppe's avatar Markus Alexander Kuppe
Browse files

Add method to print an unquoted StringValue.

[Refactor][TLC]
parent 103a1218
No related branches found
No related tags found
No related merge requests found
......@@ -119,6 +119,8 @@ public interface IValue extends Comparable<Object> {
String toString(String delim);
String toUnquotedString();
default boolean isAtom() {
if (this instanceof ModelValue || this instanceof IntValue || this instanceof StringValue
|| this instanceof BoolValue) {
......@@ -133,4 +135,5 @@ public interface IValue extends Comparable<Object> {
default boolean mutates() {
return true;
}
}
\ No newline at end of file
......@@ -280,6 +280,12 @@ public class StringValue extends Value {
}
}
/* Same as toString. */
@Override
public final String toUnquotedString() {
return PrintVersion(this.val.toString());
}
public static IValue createFrom(final IValueInputStream vos) throws IOException {
final UniqueString str = UniqueString.read(vos.getInputStream());
final IValue res = new StringValue(str);
......
......@@ -316,6 +316,12 @@ public abstract class Value implements ValueConstants, Serializable, IValue {
return toStringImpl("", false);
}
/* Same as toString. */
@Override
public String toUnquotedString() {
return toString();
}
@Override
public final String toString(final String delim) {
return toStringImpl(delim, true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment