1 /*******************************************************************************
2 * Copyright (c) 2010 Association for Decentralized Information Management in
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.databoard.primitives;
14 public class MutableString implements java.io.Serializable, Comparable<String>, CharSequence {
16 private static final long serialVersionUID = 1L;
20 public MutableString() {}
22 public MutableString(String value) { this.value = value; }
24 public String getValue() {
28 public void setValue(String newValue) {
29 this.value = newValue;
33 public int compareTo(String o) {
34 return value.compareTo(o);
38 public int hashCode() {
39 return value.hashCode();
43 public boolean equals(Object obj) {
44 if (obj == null) return false;
45 if (obj == this) return true;
47 return value.equals(obj);
51 public String toString() {
56 public char charAt(int index) {
57 return value.charAt(index);
62 return value.length();
66 public CharSequence subSequence(int start, int end) {
67 return value.subSequence(start, end);