// Attributes
// ------------------------------------------------------------------------
- private StringDeclaration declaration;
+ private StringDeclaration fDeclaration;
- private StringBuilder string;
+ private String fString;
// ------------------------------------------------------------------------
// Constructors
IDefinitionScope definitionScope, String fieldName) {
super(definitionScope, fieldName);
- this.declaration = declaration;
+ fDeclaration = declaration;
- string = new StringBuilder();
+ fString = ""; //$NON-NLS-1$
}
// ------------------------------------------------------------------------
@Override
public StringDeclaration getDeclaration() {
- return declaration;
+ return fDeclaration;
}
/**
* the declaration
*/
public void setDeclaration(StringDeclaration declaration) {
- this.declaration = declaration;
+ fDeclaration = declaration;
}
/**
- * Gets the string
- *
- * @return the stringbuilder
- */
- public StringBuilder getString() {
- return string;
- }
-
- /**
- * Sets a stringbuilder for the definition
+ * Gets the string (value)
*
- * @param string
- * the stringbuilder
+ * @return the string
*/
- public void setString(StringBuilder string) {
- this.string = string;
+ public String getValue() {
+ return fString;
}
/**
- * Gets the string (value)
+ * Sets the string (value)
*
- * @return the string
+ * @param str the string
*/
- public String getValue() {
- return string.toString();
+ public void setValue(String str) {
+ fString = str;
}
// ------------------------------------------------------------------------
@Override
public void read(BitBuffer input) throws CTFReaderException {
/* Offset the buffer position wrt the current alignment */
- alignRead(input, this.declaration);
- string.setLength(0);
- char c = (char) input.getInt(8, false);
+ alignRead(input, fDeclaration);
+
+ StringBuilder sb = new StringBuilder();
+ char c = (char) input.get(8, false);
while (c != 0) {
- string.append(c);
- c = (char) input.getInt(8, false);
+ sb.append(c);
+ c = (char) input.get(8, false);
}
+ fString = sb.toString();
}
@Override