public class NSDate extends NSObject
| Constructor and Description |
|---|
NSDate(byte[] bytes)
Creates new NSDate instance from its binary representation.
|
NSDate(byte[] bytes,
int startIndex,
int endIndex)
Creates a new NSDate instance from its binary representation.
|
NSDate(Date d)
Creates a new NSDate instance.
|
NSDate(String textRepresentation)
Creates a new NSDate instance from is textual representation.
|
| Modifier and Type | Method and Description |
|---|---|
NSDate |
clone()
Creates and returns a deep copy of this instance.
|
int |
compareTo(NSObject o) |
boolean |
equals(Object obj) |
Date |
getDate()
Gets the date.
|
int |
hashCode() |
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.
|
Object |
toJavaObject()
Converts this NSObject into an equivalent object of the Java Runtime Environment.
|
String |
toString()
Generates a string representation of the date.
|
fromJavaObject, getLocationInformation, indent, toJavaObject, toXMLPropertyListpublic NSDate(byte[] bytes)
bytes - The binary date representation.public NSDate(byte[] bytes,
int startIndex,
int endIndex)
bytes - The byte array containing the date data.startIndex - The index within the array at which the date data begins.endIndex - The index within the array at which the data date ends.public NSDate(String textRepresentation) throws ParseException
yyyy-MM-dd'T'HH:mm:ss'Z'
For ASCII property lists: yyyy-MM-dd HH:mm:ss ZtextRepresentation - The textual representation of the date.ParseException - If the date could not be parsed, i.e. it does not match the expected pattern.public NSDate(Date d)
d - The date.public Date getDate()
public NSDate clone()
NSObjectpublic String toString()
toString in class ObjectDate.toString()public Object toJavaObject()
NSObjectNSArray objects are converted to arrays.NSDictionary objects are converted to objects extending the Map class.NSSet objects are converted to objects extending the Set class.NSNumber objects are converted to primitive number values (int, long, double or boolean).NSString objects are converted to String objects.NSData objects are converted to byte arrays.NSDate objects are converted to Date objects.UID objects are converted to byte arrays.toJavaObject in class NSObjectpublic int compareTo(NSObject o)
protected void toASCII(StringBuilder ascii, int level)
NSObjectascii - The StringBuilder onto which the ASCII representation is appended.level - The indentation level of the object.protected void toASCIIGnuStep(StringBuilder ascii, int level)
NSObjectascii - The StringBuilder onto which the ASCII representation is appended.level - The indentation level of the object.Copyright © 2024. All rights reserved.