public class NSString extends NSObject implements Comparable<Object>
Constructor and Description |
---|
NSString(byte[] bytes,
int startIndex,
int endIndex,
String encoding)
Creates a new NSString instance from its binary representation.
|
NSString(byte[] bytes,
String encoding)
Creates a new NSString instance from its binary representation.
|
NSString(String string)
Creates a new NSString instance with the specified content.
|
Modifier and Type | Method and Description |
---|---|
void |
append(NSString s)
Appends a string to this string.
|
void |
append(String s)
Appends a string to this string.
|
boolean |
boolValue()
Gets the boolean value of this string.
|
NSString |
clone()
Creates and returns a deep copy of this instance.
|
int |
compareTo(Object o) |
double |
doubleValue()
Gets the floating-point value (double precision) of this string.
|
boolean |
equals(Object obj) |
float |
floatValue()
Gets the floating-point value of this string.
|
String |
getContent()
Gets the string content of this instance.
|
int |
hashCode() |
int |
intValue()
Gets the integer value of this string.
|
void |
prepend(NSString s)
Prepends a string to this string.
|
void |
prepend(String s)
Prepends a string to this string.
|
void |
setContent(String c)
Sets the string content of this instance.
|
protected void |
toASCII(StringBuilder ascii,
int level)
Generates the ASCII representation of this object.
|
protected void |
toASCIIGnuStep(StringBuilder ascii,
int level)
Generates the ASCII representation of this object in the GnuStep format.
|
void |
toBinary(BinaryPropertyListWriter out)
Generates the binary representation of the object.
|
String |
toString() |
fromJavaObject, toJavaObject, toJavaObject, toXMLPropertyList
public NSString(byte[] bytes, String encoding) throws UnsupportedEncodingException
bytes
- The binary representation.encoding
- The string encoding (name of the charset).UnsupportedEncodingException
- When the given encoding is not supported by the JRE.String.String(byte[], String)
public NSString(byte[] bytes, int startIndex, int endIndex, String encoding) throws UnsupportedEncodingException
bytes
- An array containing the binary representation of the string.startIndex
- The offset inside the array at which the string data starts.endIndex
- The offset inside the array at which the string data ends.encoding
- The string encoding (name of the charset).UnsupportedEncodingException
- When the given encoding is not supported by the JRE.String.String(byte[], int, int, String)
public NSString(String string)
string
- The string that will be contained in the NSString.public int intValue()
public float floatValue()
public double doubleValue()
public boolean boolValue()
public String getContent()
public void setContent(String c)
c
- The new content of this string object.public void append(NSString s)
s
- The string to append.public void append(String s)
s
- The string to append.public void prepend(String s)
s
- The string to prepend.public void prepend(NSString s)
s
- The string to prepend.public NSString clone()
NSObject
public void toBinary(BinaryPropertyListWriter out) throws IOException
NSObject
out
- The output stream to serialize the object to.IOException
- If an I/O error occurs while writing to the stream or the object structure contains
data that cannot be saved.protected void toASCII(StringBuilder ascii, int level)
NSObject
toASCII
in class NSObject
ascii
- The StringBuilder
onto which the ASCII representation is appended.level
- The indentation level of the object.protected void toASCIIGnuStep(StringBuilder ascii, int level)
NSObject
toASCIIGnuStep
in class NSObject
ascii
- The StringBuilder
onto which the ASCII representation is appended.level
- The indentation level of the object.public int compareTo(Object o)
compareTo
in interface Comparable<Object>
Copyright © 2018. All rights reserved.