public class NSDate extends NSObject
| Constructor and Description |
|---|
NSDate(byte[] bytes)
Creates a date from its binary representation.
|
NSDate(byte[] bytes,
int startIndex,
int endIndex)
Creates a date from its binary representation.
|
NSDate(Date d)
Creates a NSDate from a Java Date
|
NSDate(String textRepresentation)
Parses a date from its textual representation.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
toBinary(BinaryPropertyListWriter out)
Generates the binary representation of the object.
|
String |
toString()
Generates a string representation of the date.
|
fromJavaObject, toJavaObject, toJavaObject, toXMLPropertyListpublic NSDate(byte[] bytes)
bytes - The date bytespublic NSDate(byte[] bytes,
int startIndex,
int endIndex)
bytes - byte array with all informationstartIndex - int with the starting index of the dateendIndex - int with the end index of the datepublic NSDate(String textRepresentation) throws ParseException
yyyy-MM-dd'T'HH:mm:ss'Z'textRepresentation - The textual representation of the date (ISO 8601 format)ParseException - When the date could not be parsed, i.e. it does not match the expected pattern.public NSDate(Date d)
d - The datepublic Date getDate()
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.public String toString()
toString in class ObjectDate.toString()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.Copyright © 2017. All Rights Reserved.