--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.databoard.primitives;
+
+public class MutableString implements java.io.Serializable, Comparable<String>, CharSequence {
+
+ private static final long serialVersionUID = 1L;
+
+ public String value;
+
+ public MutableString() {}
+
+ public MutableString(String value) { this.value = value; }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String newValue) {
+ this.value = newValue;
+ }
+
+ @Override
+ public int compareTo(String o) {
+ return value.compareTo(o);
+ }
+
+ @Override
+ public int hashCode() {
+ return value.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) return false;\r
+ if (obj == this) return true;\r
+ \r
+ return value.equals(obj);
+ }
+
+ @Override
+ public String toString() {
+ return value;
+ }
+
+ @Override
+ public char charAt(int index) {
+ return value.charAt(index);
+ }
+
+ @Override
+ public int length() {
+ return value.length();
+ }
+
+ @Override
+ public CharSequence subSequence(int start, int end) {
+ return value.subSequence(start, end);
+ }
+
+}
+