Integer Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The Integer
class wraps a value of the primitive type
int
in an object.
[Android.Runtime.Register("java/lang/Integer", DoNotGenerateAcw=true)]
public sealed class Integer : Java.Lang.Number, IConvertible, IDisposable, Java.Interop.IJavaPeerable, Java.Lang.IComparable
[<Android.Runtime.Register("java/lang/Integer", DoNotGenerateAcw=true)>]
type Integer = class
inherit Number
interface IConvertible
interface IComparable
interface IJavaObject
interface IDisposable
interface IJavaPeerable
- Inheritance
- Attributes
- Implements
Remarks
The Integer
class wraps a value of the primitive type int
in an object. An object of type Integer
contains a single field whose type is int
.
In addition, this class provides several methods for converting an int
to a String
and a String
to an int
, as well as other constants and methods useful when dealing with an int
.
<!-- Android-removed: paragraph on ValueBased
This is a value-based class; programmers should treat instances that are #equals(Object) equal as interchangeable and should not use instances for synchronization, or unpredictable behavior may occur. For example, in a future release, synchronization may fail. -->
Implementation note: The implementations of the "bit twiddling" methods (such as #highestOneBit(int) highestOneBit
and #numberOfTrailingZeros(int) numberOfTrailingZeros
) are based on material from Henry S. Warren, Jr.'s Hacker's Delight, (Addison Wesley, 2002).
Added in 1.0.
Java documentation for java.lang.Integer
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Constructors
Integer(Int32) |
Constructs a newly allocated |
Integer(String) |
Constructs a newly allocated |
Fields
Bytes |
The number of bytes used to represent an |
MaxValue |
A constant holding the maximum value an |
MinValue |
A constant holding the minimum value an |
Size |
The number of bits used to represent an |
Properties
Class |
Returns the runtime class of this |
Handle |
The handle to the underlying Android instance. (Inherited from Object) |
JniIdentityHashCode | (Inherited from Object) |
JniPeerMembers | |
PeerReference | (Inherited from Object) |
ThresholdClass |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. (Inherited from Number) |
ThresholdType |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. (Inherited from Number) |
Type |
The |
Methods
BitCount(Int32) |
Returns the number of one-bits in the two's complement binary
representation of the specified |
ByteValue() |
Returns the value of the specified number as a |
Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
Compare(Int32, Int32) |
Compares two |
CompareTo(Integer) |
Compares two |
CompareUnsigned(Int32, Int32) |
Compares two |
Decode(String) |
Decodes a |
Dispose() | (Inherited from Object) |
Dispose(Boolean) | (Inherited from Object) |
DivideUnsigned(Int32, Int32) |
Returns the unsigned quotient of dividing the first argument by the second where each argument and the result is interpreted as an unsigned value. |
DoubleValue() |
Returns the value of this |
Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
FloatValue() |
Returns the value of this |
GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
GetInteger(String, Int32) |
Determines the integer value of the system property with the specified name. |
GetInteger(String, Integer) |
Returns the integer value of the system property with the specified name. |
GetInteger(String) |
Determines the integer value of the system property with the specified name. |
HashCode(Int32) |
Returns a hash code for an |
HighestOneBit(Int32) |
Returns an |
IntValue() |
Returns the value of this |
JavaFinalize() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
LongValue() |
Returns the value of this |
LowestOneBit(Int32) |
Returns an |
Max(Int32, Int32) |
Returns the greater of two |
Min(Int32, Int32) |
Returns the smaller of two |
Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
NumberOfLeadingZeros(Int32) |
Returns the number of zero bits preceding the highest-order
("leftmost") one-bit in the two's complement binary representation
of the specified |
NumberOfTrailingZeros(Int32) |
Returns the number of zero bits following the lowest-order ("rightmost")
one-bit in the two's complement binary representation of the specified
|
ParseInt(ICharSequence, Int32, Int32, Int32) |
Parses the |
ParseInt(String, Int32, Int32, Int32) |
Parses the |
ParseInt(String, Int32) |
Parses the string argument as a signed integer in the radix specified by the second argument. |
ParseInt(String) |
Parses the string argument as a signed decimal integer. |
ParseUnsignedInt(ICharSequence, Int32, Int32, Int32) |
Parses the |
ParseUnsignedInt(String, Int32, Int32, Int32) |
Parses the |
ParseUnsignedInt(String, Int32) |
Parses the string argument as an unsigned integer in the radix specified by the second argument. |
ParseUnsignedInt(String) |
Parses the string argument as an unsigned decimal integer. |
RemainderUnsigned(Int32, Int32) |
Returns the unsigned remainder from dividing the first argument by the second where each argument and the result is interpreted as an unsigned value. |
Reverse(Int32) |
Returns the value obtained by reversing the order of the bits in the
two's complement binary representation of the specified |
ReverseBytes(Int32) |
Returns the value obtained by reversing the order of the bytes in the
two's complement representation of the specified |
RotateLeft(Int32, Int32) |
Returns the value obtained by rotating the two's complement binary
representation of the specified |
RotateRight(Int32, Int32) |
Returns the value obtained by rotating the two's complement binary
representation of the specified |
SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
ShortValue() |
Returns the value of the specified number as a |
Signum(Int32) |
Returns the signum function of the specified |
Sum(Int32, Int32) |
Adds two integers together as per the + operator. |
ToArray<T>() | (Inherited from Object) |
ToBinaryString(Int32) |
Returns a string representation of the integer argument as an unsigned integer in base 2. |
ToHexString(Int32) |
Returns a string representation of the integer argument as an unsigned integer in base 16. |
ToOctalString(Int32) |
Returns a string representation of the integer argument as an unsigned integer in base 8. |
ToString() |
Returns a string representation of the object. (Inherited from Object) |
ToString(Int32, Int32) |
Returns a string representation of the first argument in the radix specified by the second argument. |
ToString(Int32) |
Returns a |
ToUnsignedLong(Int32) |
Converts the argument to a |
ToUnsignedString(Int32, Int32) |
Returns a string representation of the first argument as an unsigned integer value in the radix specified by the second argument. |
ToUnsignedString(Int32) |
Returns a string representation of the argument as an unsigned decimal value. |
UnregisterFromRuntime() | (Inherited from Object) |
ValueOf(Int32) |
Returns an |
ValueOf(String, Int32) |
Returns an |
ValueOf(String) |
Returns an |
Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Operators
Explicit(Integer to Int32) |
Explicit Interface Implementations
Extension Methods
JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
JavaCast<TResult>(IJavaObject) | |
GetJniTypeName(IJavaPeerable) |