Class NSDate

All Implemented Interfaces:
Cloneable, Comparable<NSObject>

public class NSDate extends NSObject
The NSDate class wraps a date.
Author:
Daniel Dreibrodt
See Also:
  • Constructor Details

    • NSDate

      public NSDate(byte[] bytes)
      Creates new NSDate instance from its binary representation.
      Parameters:
      bytes - The binary date representation.
    • NSDate

      public NSDate(byte[] bytes, int startIndex, int endIndex)
      Creates a new NSDate instance from its binary representation.
      Parameters:
      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.
    • NSDate

      public NSDate(String textRepresentation) throws ParseException
      Creates a new NSDate instance from is textual representation. The textual representation must adhere to one of the following patterns. For XML property lists: yyyy-MM-dd'T'HH:mm:ss'Z' For ASCII property lists: yyyy-MM-dd HH:mm:ss Z
      Parameters:
      textRepresentation - The textual representation of the date.
      Throws:
      ParseException - If the date could not be parsed, i.e. it does not match the expected pattern.
    • NSDate

      public NSDate(Date d)
      Creates a new NSDate instance.
      Parameters:
      d - The date.
  • Method Details

    • getDate

      public Date getDate()
      Gets the date.
      Returns:
      The date.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public NSDate clone()
      Description copied from class: NSObject
      Creates and returns a deep copy of this instance.
      Specified by:
      clone in class NSObject
      Returns:
      A clone of this instance.
    • toString

      public String toString()
      Generates a string representation of the date.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the date.
      See Also:
    • toJavaObject

      public Object toJavaObject()
      Description copied from class: NSObject
      Converts this NSObject into an equivalent object of the Java Runtime Environment.
      • NSArray 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.
      Specified by:
      toJavaObject in class NSObject
      Returns:
      A native java object representing this NSObject's value.
    • compareTo

      public int compareTo(NSObject o)
    • toASCII

      protected void toASCII(StringBuilder ascii, int level)
    • toASCIIGnuStep

      protected void toASCIIGnuStep(StringBuilder ascii, int level)