Aracılığıyla paylaş


Boolean Class

Definition

The Boolean class wraps a value of the primitive type boolean in an object.

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

Remarks

The Boolean class wraps a value of the primitive type boolean in an object. An object of type Boolean contains a single field whose type is boolean.

In addition, this class provides many methods for converting a boolean to a String and a String to a boolean, as well as other constants and methods useful when dealing with a boolean.

<!-- 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. -->

Added in 1.0.

Java documentation for java.lang.Boolean.

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

Boolean(Boolean)

Allocates a Boolean object representing the value argument.

Boolean(String)

Allocates a Boolean object representing the value true if the string argument is not null and is equal, ignoring case, to the string "true".

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
False

The Boolean object corresponding to the primitive value false.

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 Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
True

The Boolean object corresponding to the primitive value true.

Type

The Class object representing the primitive type boolean.

Methods

BooleanValue()

Returns the value of this Boolean object as a boolean primitive.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Compare(Boolean, Boolean)

Compares two boolean values.

CompareTo(Boolean)

Compares this Boolean instance with another.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

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

(Inherited from Object)
GetBoolean(String)

Returns true if and only if the system property named by the argument exists and is equal to, ignoring case, the string "true".

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
HashCode(Boolean)

Returns a hash code for a boolean value; compatible with Boolean.hashCode().

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)
LogicalAnd(Boolean, Boolean)

Returns the result of applying the logical AND operator to the specified boolean operands.

LogicalOr(Boolean, Boolean)

Returns the result of applying the logical OR operator to the specified boolean operands.

LogicalXor(Boolean, Boolean)

Returns the result of applying the logical XOR operator to the specified boolean operands.

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)
ParseBoolean(String)

Parses the string argument as a boolean.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
ToString(Boolean)

Returns a String object representing the specified boolean.

UnregisterFromRuntime() (Inherited from Object)
ValueOf(Boolean)

Returns a Boolean instance representing the specified boolean value.

ValueOf(String)

Returns a Boolean with a value represented by the specified string.

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(Boolean to Boolean)

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