public class NSString extends NSObject implements Comparable<Object>
| Constructor and Description |
|---|
NSString(byte[] bytes,
int startIndex,
int endIndex,
String encoding)
Creates an NSString from its binary representation.
|
NSString(byte[] bytes,
String encoding)
Creates an NSString from its binary representation.
|
NSString(String string)
Creates a NSString from a string.
|
| 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.
|
int |
compareTo(Object o) |
boolean |
equals(Object obj) |
String |
getContent()
Gets this strings content.
|
int |
hashCode() |
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 contents of this string.
|
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()
The textual representation of this NSString.
|
fromJavaObject, toJavaObject, toJavaObject, toXMLPropertyListpublic NSString(byte[] bytes,
String encoding)
throws UnsupportedEncodingException
bytes - The binary representation.encoding - The encoding of the binary representation, the name of a supported 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 - The binary representation.startIndex - int with the index where to start (offset)endIndex - int with the index where to stop reading (offset + string length)encoding - The encoding of the binary representation, the name of a supported charset.UnsupportedEncodingException - When the given encoding is not supported by the JRE.String.String(byte[], String)public NSString(String string)
string - The string that will be contained in the NSString.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 String toString()
public void toBinary(BinaryPropertyListWriter out) throws IOException
NSObjectout - The output stream to serialize the object to.IOException - When an IO error occurs while writing to the stream or the object structure contains
data that cannot be saved.protected void toASCII(StringBuilder ascii, int level)
NSObjectprotected void toASCIIGnuStep(StringBuilder ascii, int level)
NSObjecttoASCIIGnuStep in class NSObjectascii - 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 © 2017. All Rights Reserved.