| Modifier and Type | Field and Description |
|---|---|
| public static final int | BOOLEAN
Indicates that the number's value is boolean. |
| private boolean | |
| private double | |
| private static final String | |
| public static final int | INTEGER
Indicates that the number's value is an integer. |
| private long | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| public static final int | REAL
Indicates that the number's value is a real number. |
| private static final String | |
| private int | type
Holds the current type of this number |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public | NSNumber(byte[]
The binary representation of this number. bytes, int The type of number. type)Creates a new NSNumber instance from its binary representation. |
| public | NSNumber(byte[]
An array of bytes containing the binary representation of the number. bytes, final int The position in the array at which the number is stored. startIndex, final int The position in the array at which the number's data ends. endIndex, final int The type of number type)Creates a new NSNumber instance from its binary representation. |
| public | |
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the value is true or non-zero and not Double.NaN; otherwise, false.Gets this instance's boolean value. |
| public NSNumber | clone()
Implements abstract com. Creates and returns a deep copy of this instance. |
| public int | compareTo(NSObject o)
Implements java. Compares this object with the specified object for order. |
| public double | |
| public boolean | Returns: Whether the objects are equal in terms of numeric value and type.The object to compare to. obj)Overrides java. Checks whether the other object is a NSNumber of the same value. |
| public float | |
| private String | |
| public int | |
| public int | |
| public boolean | Returns: Whether the number's value is a boolean.Gets a value indicating whether the value of this NSNumber is a boolean. |
| public boolean | Returns: Whether the number's value is an integer.Gets a value indicating whether the value of this NSNumber is an integer. |
| public boolean | Returns: Whether the number's value is a real number.Gets a value indicating whether the value of this NSNumber is a real number. |
| public long | |
| public String | Returns: The human-readable string representation of this number. "+infinity" is returned for the positive infinity value (1 / 0). "-infinity" is returned for the negative infinity value (-1 / 0). "nan" is returned if the value is invalid (i.e. not a number).Gets this instance's value expressed as a human-readable string. |
| private void | |
| protected void | toASCII(StringBuilder ascii, int level)
Implements abstract com. Generates the ASCII representation of this object. |
| protected void | toASCIIGnuStep(StringBuilder ascii, int level)
Implements abstract com. Generates the ASCII representation of this object in the GnuStep format. |
| pack-priv void | toBinary(BinaryPropertyListWriter out)
Implements abstract com. Generates the binary representation of the object. |
| public Object | toJavaObject()
Implements abstract com. Converts this NSObject into an equivalent object of the Java Runtime Environment. |
| public String | |
| pack-priv void | toXML(StringBuilder xml, int level)
Implements abstract com. Generates the XML representation of the object (without XML headers or enclosing plist-tags). |
| public int |
| BOOLEAN | back to summary |
|---|---|
| public static final int BOOLEAN Indicates that the number's value is boolean. | |
| boolValue | back to summary |
|---|---|
| private boolean boolValue | |
| doubleValue | back to summary |
|---|---|
| private double doubleValue | |
| FALSE_SYMBOL | back to summary |
|---|---|
| private static final String FALSE_SYMBOL | |
| INTEGER | back to summary |
|---|---|
| public static final int INTEGER Indicates that the number's value is an integer.
The number is stored as a Java | |
| longValue | back to summary |
|---|---|
| private long longValue | |
| NAN_SYMBOL | back to summary |
|---|---|
| private static final String NAN_SYMBOL | |
| NEGATIVE_INFINITY_SYMBOL | back to summary |
|---|---|
| private static final String NEGATIVE_INFINITY_SYMBOL | |
| NO_SYMOBL | back to summary |
|---|---|
| private static final String NO_SYMOBL | |
| POSTIIVE_INFINITY_SYMBOL | back to summary |
|---|---|
| private static final String POSTIIVE_INFINITY_SYMBOL | |
| REAL | back to summary |
|---|---|
| public static final int REAL Indicates that the number's value is a real number.
The number is stored as a Java | |
| TRUE_SYMBOL | back to summary |
|---|---|
| private static final String TRUE_SYMBOL | |
| type | back to summary |
|---|---|
| private int type Holds the current type of this number | |
| YES_SYMBOL | back to summary |
|---|---|
| private static final String YES_SYMBOL | |
| NSNumber | back to summary |
|---|---|
| public NSNumber(byte[] bytes, int type) Creates a new NSNumber instance from its binary representation. | |
| NSNumber | back to summary |
|---|---|
| public NSNumber(byte[] bytes, final int startIndex, final int endIndex, final int type) Creates a new NSNumber instance from its binary representation. | |
| NSNumber | back to summary |
|---|---|
| public NSNumber(String text) Create a NSNumber instance from its textual representation.
| |
| NSNumber | back to summary |
|---|---|
| public NSNumber(int i) Creates a new NSNumber instance with the specified value.
| |
| NSNumber | back to summary |
|---|---|
| public NSNumber(long l) Creates a new NSNumber instance with the specified value.
| |
| NSNumber | back to summary |
|---|---|
| public NSNumber(double d) Creates a new NSNumber instance with the specified value.
| |
| NSNumber | back to summary |
|---|---|
| public NSNumber(boolean b) Creates a new NSNumber instance with the specified value.
| |
| boolValue | back to summary |
|---|---|
| public boolean boolValue() Gets this instance's boolean value.
| |
| clone | back to summary |
|---|---|
| public NSNumber clone() Implements abstract com. Doc from com. Creates and returns a deep copy of this instance.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(NSObject o) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| doubleValue | back to summary |
|---|---|
| public double doubleValue() Gets this instance's
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Checks whether the other object is a NSNumber of the same value. | |
| floatValue | back to summary |
|---|---|
| public float floatValue() Gets this instance's Warning Possible loss of precision if the value is outside the float range.
| |
| getRealStringRepresentation | back to summary |
|---|---|
| private String getRealStringRepresentation() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| intValue | back to summary |
|---|---|
| public int intValue() Gets this instance's integer value. Note Even though the number's type might be INTEGER it can be larger than a Java int. Use intValue() only if you are certain that it contains a number from the int range. Otherwise the value might be inaccurate.
| |
| isBoolean | back to summary |
|---|---|
| public boolean isBoolean() Gets a value indicating whether the value of this NSNumber is a boolean.
| |
| isInteger | back to summary |
|---|---|
| public boolean isInteger() Gets a value indicating whether the value of this NSNumber is an integer.
| |
| isReal | back to summary |
|---|---|
| public boolean isReal() Gets a value indicating whether the value of this NSNumber is a real number.
| |
| longValue | back to summary |
|---|---|
| public long longValue() Gets this instance's long integer value.
| |
| stringValue | back to summary |
|---|---|
| public String stringValue() Gets this instance's value expressed as a human-readable string.
| |
| throwIfIntegerValueNotAvailable | back to summary |
|---|---|
| private void throwIfIntegerValueNotAvailable() | |
| toASCII | back to summary |
|---|---|
| protected void toASCII(StringBuilder ascii, int level) Implements abstract com. Doc from com. Generates the ASCII representation of this object. The generated ASCII representation does not end with a newline. Complies with the Old-Style ASCII Property Lists definition.
| |
| toASCIIGnuStep | back to summary |
|---|---|
| protected void toASCIIGnuStep(StringBuilder ascii, int level) Implements abstract com. Doc from com. Generates the ASCII representation of this object in the GnuStep format. The generated ASCII representation does not end with a newline.
| |
| toBinary | back to summary |
|---|---|
| pack-priv void toBinary(BinaryPropertyListWriter out) throws IOException Implements abstract com. Doc from com. Generates the binary representation of the object.
| |
| toJavaObject | back to summary |
|---|---|
| public Object toJavaObject() Implements abstract com. Doc from com. Converts this NSObject into an equivalent object of the Java Runtime Environment.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| toXML | back to summary |
|---|---|
| pack-priv void toXML(StringBuilder xml, int level) Implements abstract com. Doc from com. Generates the XML representation of the object (without XML headers or enclosing plist-tags).
| |
| type | back to summary |
|---|---|
| public int type() Gets the type of this instance's value. | |