Package org.intermine.model
Class StringConstructor
- java.lang.Object
-
- org.intermine.model.StringConstructor
-
- All Implemented Interfaces:
java.lang.CharSequence
public class StringConstructor extends java.lang.Object implements java.lang.CharSequenceA CharSequence object representing a String constructed out of a sequence of other Strings. This object does not copy any of the string data - rather, it stores pointers to the original Strings it was constructed with.
-
-
Constructor Summary
Constructors Constructor Description StringConstructor()Main constructor - creates an empty object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringConstructorappend(boolean b)Appends a boolean onto the end of this object.StringConstructorappend(double d)Appends a double onto the end of this object.StringConstructorappend(float f)Appends a float onto the end of this object.StringConstructorappend(int i)Appends an int onto the end of this object.StringConstructorappend(long l)Appends a long onto the end of this object.StringConstructorappend(java.lang.Object o)Appends an Object onto the end of this object.StringConstructorappend(java.lang.String string)Appends a String onto the end of this object.charcharAt(int index)java.util.Collection<java.lang.String>getStrings()Returns a Collection containing the Strings that form this object, in the correct order.intlength()java.lang.CharSequencesubSequence(int start, int end)java.lang.StringtoString()Returns the String that this object represents - note that this method should be avoided, because it defeats the purpose of keeping the constituent Strings separate in the first place.
-
-
-
Method Detail
-
append
public StringConstructor append(java.lang.String string)
Appends a String onto the end of this object.- Parameters:
string- the String- Returns:
- this
-
append
public StringConstructor append(java.lang.Object o)
Appends an Object onto the end of this object.- Parameters:
o- an Object- Returns:
- this
-
append
public StringConstructor append(boolean b)
Appends a boolean onto the end of this object.- Parameters:
b- a boolean- Returns:
- this
-
append
public StringConstructor append(int i)
Appends an int onto the end of this object.- Parameters:
i- an int- Returns:
- this
-
append
public StringConstructor append(long l)
Appends a long onto the end of this object.- Parameters:
l- a long- Returns:
- this
-
append
public StringConstructor append(float f)
Appends a float onto the end of this object.- Parameters:
f- a float- Returns:
- this
-
append
public StringConstructor append(double d)
Appends a double onto the end of this object.- Parameters:
d- a double- Returns:
- this
-
length
public int length()
- Specified by:
lengthin interfacejava.lang.CharSequence
-
toString
public java.lang.String toString()
Returns the String that this object represents - note that this method should be avoided, because it defeats the purpose of keeping the constituent Strings separate in the first place.- Specified by:
toStringin interfacejava.lang.CharSequence- Overrides:
toStringin classjava.lang.Object- Returns:
- a String
-
charAt
public char charAt(int index)
- Specified by:
charAtin interfacejava.lang.CharSequence
-
subSequence
public java.lang.CharSequence subSequence(int start, int end)- Specified by:
subSequencein interfacejava.lang.CharSequence
-
getStrings
public java.util.Collection<java.lang.String> getStrings()
Returns a Collection containing the Strings that form this object, in the correct order.- Returns:
- a Collection of Strings
-
-