public class NSDateComponentsFormatter extends NSFormatter
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
NSDateComponentsFormatter(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
static NSDateComponentsFormatter |
alloc() |
static NSDateComponentsFormatter |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
long |
allowedUnits()
Bitmask of units to include.
|
boolean |
allowsFractionalUnits()
Choose whether non-integer units should be used to handle display of values that can't be exactly represented with the allowed units.
|
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
NSCalendar |
calendar()
Specifies the locale and calendar to use for formatting date components that do not themselves have calendars.
|
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
boolean |
collapsesLargestUnit()
Choose whether to express largest units just above the threshold for the next lowest unit as a larger quantity of the lower unit.
|
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
long |
formattingContext()
Not yet supported.
|
boolean |
getObjectValueForStringErrorDescription(org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> obj,
java.lang.String string,
org.moe.natj.general.ptr.Ptr<NSString> error)
NSDateComponentsFormatter currently only implements formatting, not parsing.
|
static long |
hash_static() |
boolean |
includesApproximationPhrase()
Choose whether to indicate that the allowed units/insignificant units choices lead to inexact results.
|
boolean |
includesTimeRemainingPhrase()
Choose whether to produce strings like "35 minutes remaining".
|
NSDateComponentsFormatter |
init() |
NSDateComponentsFormatter |
initWithCoder(NSCoder coder)
NS_DESIGNATED_INITIALIZER
|
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
static java.lang.String |
localizedStringFromDateComponentsUnitsStyle(NSDateComponents components,
long unitsStyle) |
long |
maximumUnitCount()
Choose whether or not, and at which point, to round small units in large values to zero.
|
static NSDateComponentsFormatter |
new_objc() |
NSDate |
referenceDate()
Where units have variable length (number of days in a month, number of hours in a day, etc...), NSDateComponentsFormatter will calculate as though counting from the date specified by the referenceDate in the appropriate calendar.
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
void |
setAllowedUnits(long value)
Bitmask of units to include.
|
void |
setAllowsFractionalUnits(boolean value)
Choose whether non-integer units should be used to handle display of values that can't be exactly represented with the allowed units.
|
void |
setCalendar(NSCalendar value)
Specifies the locale and calendar to use for formatting date components that do not themselves have calendars.
|
void |
setCollapsesLargestUnit(boolean value)
Choose whether to express largest units just above the threshold for the next lowest unit as a larger quantity of the lower unit.
|
void |
setFormattingContext(long value)
Not yet supported.
|
void |
setIncludesApproximationPhrase(boolean value)
Choose whether to indicate that the allowed units/insignificant units choices lead to inexact results.
|
void |
setIncludesTimeRemainingPhrase(boolean value)
Choose whether to produce strings like "35 minutes remaining".
|
void |
setMaximumUnitCount(long value)
Choose whether or not, and at which point, to round small units in large values to zero.
|
void |
setReferenceDate(NSDate value)
Where units have variable length (number of days in a month, number of hours in a day, etc...), NSDateComponentsFormatter will calculate as though counting from the date specified by the referenceDate in the appropriate calendar.
|
void |
setUnitsStyle(long value)
Choose how to indicate units.
|
static void |
setVersion_static(long aVersion) |
void |
setZeroFormattingBehavior(long value)
Bitmask specifying how to handle zeros in units.
|
java.lang.String |
stringForObjectValue(java.lang.Object obj)
'obj' must be an instance of NSDateComponents.
|
java.lang.String |
stringFromDateComponents(NSDateComponents components)
Convenience method for formatting an NSDateComponents object.
|
java.lang.String |
stringFromDateToDate(NSDate startDate,
NSDate endDate)
Normally, NSDateComponentsFormatter will calculate as though counting from referenceDate (e.g.
|
java.lang.String |
stringFromTimeInterval(double ti)
Convenience method for formatting a number of seconds.
|
static org.moe.natj.objc.Class |
superclass_static() |
long |
unitsStyle()
Choose how to indicate units.
|
static long |
version_static() |
long |
zeroFormattingBehavior()
Bitmask specifying how to handle zeros in units.
|
attributedStringForObjectValueWithDefaultAttributes, copyWithZone, editingStringForObjectValue, encodeWithCoder, isPartialStringValidNewEditingStringErrorDescription, isPartialStringValidProposedSelectedRangeOriginalStringOriginalSelectedRangeErrorDescriptionaccessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeyprotected NSDateComponentsFormatter(org.moe.natj.general.Pointer peer)
public static boolean accessInstanceVariablesDirectly()
public static NSDateComponentsFormatter alloc()
public static NSDateComponentsFormatter allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public static long hash_static()
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static java.lang.String localizedStringFromDateComponentsUnitsStyle(NSDateComponents components, long unitsStyle)
public static NSDateComponentsFormatter new_objc()
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()
public long allowedUnits()
Allowed units are:
NSCalendarUnitYear NSCalendarUnitMonth NSCalendarUnitWeekOfMonth (used to mean "quantity of weeks") NSCalendarUnitDay NSCalendarUnitHour NSCalendarUnitMinute NSCalendarUnitSecond
Specifying any other NSCalendarUnits will result in an exception.
public boolean allowsFractionalUnits()
public NSCalendar calendar()
public boolean collapsesLargestUnit()
public long formattingContext()
public boolean getObjectValueForStringErrorDescription(org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> obj,
java.lang.String string,
org.moe.natj.general.ptr.Ptr<NSString> error)
getObjectValueForStringErrorDescription in class NSFormatterpublic boolean includesApproximationPhrase()
public boolean includesTimeRemainingPhrase()
public NSDateComponentsFormatter init()
init in class NSFormatterpublic NSDateComponentsFormatter initWithCoder(NSCoder coder)
NSCodinginitWithCoder in interface NSCodinginitWithCoder in class NSFormatterpublic long maximumUnitCount()
Default is 0, which is interpreted as unlimited.
public void setAllowedUnits(long value)
Allowed units are:
NSCalendarUnitYear NSCalendarUnitMonth NSCalendarUnitWeekOfMonth (used to mean "quantity of weeks") NSCalendarUnitDay NSCalendarUnitHour NSCalendarUnitMinute NSCalendarUnitSecond
Specifying any other NSCalendarUnits will result in an exception.
public void setAllowsFractionalUnits(boolean value)
public void setCalendar(NSCalendar value)
public void setCollapsesLargestUnit(boolean value)
public void setFormattingContext(long value)
public void setIncludesApproximationPhrase(boolean value)
public void setIncludesTimeRemainingPhrase(boolean value)
public void setMaximumUnitCount(long value)
Default is 0, which is interpreted as unlimited.
public void setUnitsStyle(long value)
public void setZeroFormattingBehavior(long value)
If the combination of zero formatting behavior and style would lead to ambiguous date formats (for example, 1:10 meaning 1 hour, 10 seconds), NSDateComponentsFormatter will throw an exception.
public java.lang.String stringForObjectValue(java.lang.Object obj)
stringForObjectValue in class NSFormatterpublic java.lang.String stringFromDateToDate(NSDate startDate, NSDate endDate)
See 'allowedUnits' for how the default set of allowed units differs from -stringFromDateComponents:.
Note that this is still formatting the quantity of time between the dates, not the pair of dates itself. For strings like "Feb 22nd - Feb 28th", use NSDateIntervalFormatter.
public java.lang.String stringFromDateComponents(NSDateComponents components)
public java.lang.String stringFromTimeInterval(double ti)
public long unitsStyle()
public long zeroFormattingBehavior()
If the combination of zero formatting behavior and style would lead to ambiguous date formats (for example, 1:10 meaning 1 hour, 10 seconds), NSDateComponentsFormatter will throw an exception.
public NSDate referenceDate()
public void setReferenceDate(NSDate value)