Added volume to client plus other fixes
[stereo.git] / DAAPLib / src / util / node / StringNode.java
blob1741b0bf5474a9b5b682841d1e09c210628b2bcb
1 package util.node;
3 import java.io.UnsupportedEncodingException;
5 public class StringNode extends Node {
6 private final String value;
7 private final byte[] bytes;
9 public StringNode(int code, String value) throws UnsupportedEncodingException {
10 super(code);
11 this.value = (value != null)?value:"";
12 this.bytes = value.getBytes("UTF-8");
15 public String toString() {
16 return "<" + super.toString() + " value=\"" + value + "\" />";
19 public String getValue() {
20 return value;
23 public byte[] getBytes() {
24 return bytes;
27 @Override
28 public int visit(Visitor visitor) {
29 return visitor.visitStringNode(this);