Aracılığıyla paylaş


Long Class

Definition

The Long class wraps a value of the primitive type long in an object.

[Android.Runtime.Register("java/lang/Long", DoNotGenerateAcw=true)]
public sealed class Long : Java.Lang.Number, IConvertible, IDisposable, Java.Interop.IJavaPeerable, Java.Lang.IComparable
[<Android.Runtime.Register("java/lang/Long", DoNotGenerateAcw=true)>]
type Long = class
    inherit Number
    interface IConvertible
    interface IComparable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
Attributes
Implements

Remarks

Java documentation for java.lang.Long.

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

Long(Int64)

Constructs a newly allocated Long object that represents the specified long argument.

Long(String)

Constructs a newly allocated Long object that represents the long value indicated by the String parameter.

Fields

Bytes

The number of bytes used to represent a long value in two's complement binary form.

MaxValue

A constant holding the maximum value a long can have, 2<sup>63</sup>-1.

MinValue

A constant holding the minimum value a long can have, -2<sup>63</sup>.

Size

The number of bits used to represent a long value in two's complement binary form.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
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 Class instance representing the primitive type long.

Methods

BitCount(Int64)

Returns the number of one-bits in the two's complement binary representation of the specified long value.

ByteValue()

Returns the value of the specified number as a byte.

(Inherited from Number)
Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Compare(Int64, Int64)

Compares two long values numerically.

CompareTo(Long)

Compares two Long objects numerically.

CompareUnsigned(Int64, Int64)

Compares two long values numerically treating the values as unsigned.

Decode(String)

Decodes a String into a Long.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
DivideUnsigned(Int64, Int64)

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 Long as a double after a widening primitive conversion.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
FloatValue()

Returns the value of this Long as a float after a widening primitive conversion.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetLong(String)

Determines the long value of the system property with the specified name.

GetLong(String, Int64)

Determines the long value of the system property with the specified name.

GetLong(String, Long)

Returns the long value of the system property with the specified name.

HashCode(Int64)

Returns a hash code for a long value; compatible with Long.hashCode().

HighestOneBit(Int64)

Returns a long value with at most a single one-bit, in the position of the highest-order ("leftmost") one-bit in the specified long value.

IntValue()

Returns the value of this Long as an int after a narrowing primitive conversion.

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 Long as a long value.

LowestOneBit(Int64)

Returns a long value with at most a single one-bit, in the position of the lowest-order ("rightmost") one-bit in the specified long value.

Max(Int64, Int64)

Returns the greater of two long values as if by calling Math#max(long, long) Math.max.

Min(Int64, Int64)

Returns the smaller of two long values as if by calling Math#min(long, long) Math.min.

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(Int64)

Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified long value.

NumberOfTrailingZeros(Int64)

Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specified long value.

ParseLong(ICharSequence, Int32, Int32, Int32)

Parses the CharSequence argument as a signed long in the specified radix, beginning at the specified beginIndex and extending to endIndex - 1.

ParseLong(String)

Parses the string argument as a signed decimal long.

ParseLong(String, Int32)

Parses the string argument as a signed long in the radix specified by the second argument.

ParseLong(String, Int32, Int32, Int32)

Parses the CharSequence argument as a signed long in the specified radix, beginning at the specified beginIndex and extending to endIndex - 1.

ParseUnsignedLong(ICharSequence, Int32, Int32, Int32)

Parses the CharSequence argument as an unsigned long in the specified radix, beginning at the specified beginIndex and extending to endIndex - 1.

ParseUnsignedLong(String)

Parses the string argument as an unsigned decimal long.

ParseUnsignedLong(String, Int32)

Parses the string argument as an unsigned long in the radix specified by the second argument.

ParseUnsignedLong(String, Int32, Int32, Int32)

Parses the CharSequence argument as an unsigned long in the specified radix, beginning at the specified beginIndex and extending to endIndex - 1.

RemainderUnsigned(Int64, Int64)

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(Int64)

Returns the value obtained by reversing the order of the bits in the two's complement binary representation of the specified long value.

ReverseBytes(Int64)

Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified long value.

RotateLeft(Int64, Int32)

Returns the value obtained by rotating the two's complement binary representation of the specified long value left by the specified number of bits.

RotateRight(Int64, Int32)

Returns the value obtained by rotating the two's complement binary representation of the specified long value right by the specified number of bits.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ShortValue()

Returns the value of the specified number as a short.

(Inherited from Number)
Signum(Int64)

Returns the signum function of the specified long value.

Sum(Int64, Int64)

Adds two long values together as per the + operator.

ToArray<T>() (Inherited from Object)
ToBinaryString(Int64)

Returns a string representation of the long argument as an unsigned integer in base&nbsp;2.

ToHexString(Int64)

Returns a string representation of the long argument as an unsigned integer in base&nbsp;16.

ToOctalString(Int64)

Returns a string representation of the long argument as an unsigned integer in base&nbsp;8.

ToString()

Returns a string representation of the object.

(Inherited from Object)
ToString(Int64)

Returns a String object representing the specified long.

ToString(Int64, Int32)

Returns a string representation of the first argument in the radix specified by the second argument.

ToUnsignedString(Int64)

Returns a string representation of the argument as an unsigned decimal value.

ToUnsignedString(Int64, Int32)

Returns a string representation of the first argument as an unsigned integer value in the radix specified by the second argument.

UnregisterFromRuntime() (Inherited from Object)
ValueOf(Int64)

Returns a Long instance representing the specified long value.

ValueOf(String)

Returns a Long object holding the value of the specified String.

ValueOf(String, Int32)

Returns a Long object holding the value extracted from the specified String when parsed with the radix given by the second argument.

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)

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, 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)

Operators

Explicit(Long to Int64)

Explicit Interface Implementations

IComparable.CompareTo(Object)
IConvertible.GetTypeCode()
IConvertible.ToBoolean(IFormatProvider)
IConvertible.ToByte(IFormatProvider)
IConvertible.ToChar(IFormatProvider)
IConvertible.ToDateTime(IFormatProvider)
IConvertible.ToDecimal(IFormatProvider)
IConvertible.ToDouble(IFormatProvider)
IConvertible.ToInt16(IFormatProvider)
IConvertible.ToInt32(IFormatProvider)
IConvertible.ToInt64(IFormatProvider)
IConvertible.ToSByte(IFormatProvider)
IConvertible.ToSingle(IFormatProvider)
IConvertible.ToString(IFormatProvider)
IConvertible.ToType(Type, IFormatProvider)
IConvertible.ToUInt16(IFormatProvider)
IConvertible.ToUInt32(IFormatProvider)
IConvertible.ToUInt64(IFormatProvider)
IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to