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.
|
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, toXMLPropertyList
public 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 Z
textRepresentation
- 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()
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.public String toString()
toString
in class Object
Date.toString()
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.Copyright © 2019. All rights reserved.