Short 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 Short class wraps a value of primitive type short in an object.
[Android.Runtime.Register("java/lang/Short", DoNotGenerateAcw=true)]
public sealed class Short : Java.Lang.Number, IDisposable, Java.Lang.IComparable
[<Android.Runtime.Register("java/lang/Short", DoNotGenerateAcw=true)>]
type Short = class
inherit Number
interface IComparable
interface IJavaObject
interface IDisposable
interface IJavaPeerable
- Inheritance
- Attributes
- Implements
Remarks
The Short class wraps a value of primitive type short in an object. An object of type Short contains a single field whose type is short.
In addition, this class provides several methods for converting a short to a String and a String to a short, as well as other constants and methods useful when dealing with a short.
<!-- 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.1.
Java documentation for java.lang.Short.
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
| Name | Description |
|---|---|
| Short(Int16) |
Constructs a newly allocated |
| Short(String) |
Constructs a newly allocated |
Fields
| Name | Description |
|---|---|
| Bytes |
The number of bytes used to represent a |
| MaxValue |
A constant holding the maximum value a |
| MinValue |
A constant holding the minimum value a |
| Size |
The number of bits used to represent a |
Properties
| Name | Description |
|---|---|
| Class |
Returns the runtime class of this |
| Handle |
The handle to the underlying Android instance. (Inherited from Object) |
| JniIdentityHashCode |
Gets the identity hash code assigned to this Java peer by the interop runtime. (Inherited from Object) |
| JniManagedPeerState | (Inherited from JavaObject) |
| JniPeerMembers |
Gets the JNI metadata used to invoke members of this Java peer. |
| PeerReference |
Gets the JNI object reference for this Java peer. (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
| Name | Description |
|---|---|
| ByteValue() |
Returns the value of the specified number as a |
| Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
| Compare(Int16, Int16) |
Compares two |
| CompareTo(Short) |
Compares two |
| CompareUnsigned(Int16, Int16) |
Compares two |
| Construct(JniObjectReference, JniObjectReferenceOptions) | (Inherited from JavaObject) |
| Decode(String) |
Decodes a |
| Dispose() |
Releases the resources held by this Java peer. (Inherited from Object) |
| Dispose(Boolean) |
Releases the resources held by this Java peer. (Inherited from Object) |
| DisposeUnlessReferenced() | (Inherited from JavaObject) |
| DoubleValue() |
Returns the value of this |
| Equals(Object) | (Inherited from JavaObject) |
| 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) |
| HashCode(Int16) |
Returns a hash code for a |
| 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 |
| 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) |
| ParseShort(String, Int32) |
Parses the string argument as a signed |
| ParseShort(String) |
Parses the string argument as a signed decimal |
| ReverseBytes(Int16) |
Returns the value obtained by reversing the order of the bytes in the
two's complement representation of the specified |
| SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
| SetPeerReference(JniObjectReference, JniObjectReferenceOptions) | (Inherited from JavaObject) |
| ShortValue() |
Returns the value of the specified number as a |
| ToArray<T>() |
Creates a managed array from this Java array wrapper. (Inherited from Object) |
| ToString() |
Returns a string representation of the object. (Inherited from Object) |
| ToString(Int16) |
Returns a new |
| ToUnsignedInt(Int16) |
Converts the argument to an |
| ToUnsignedLong(Int16) |
Converts the argument to a |
| UnregisterFromRuntime() |
Unregisters this Java peer from the interop runtime. (Inherited from Object) |
| ValueOf(Int16) |
Returns a |
| ValueOf(String, Int32) |
Returns a |
| ValueOf(String) |
Returns a |
| 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
| Name | Description |
|---|---|
| Explicit(Short to Int16) |
Converts the specified |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IComparable.CompareTo(Object) |
Compares this value with the specified object for ordering. |
| IJavaPeerable.Disposed() | (Inherited from JavaObject) |
| IJavaPeerable.Finalized() | (Inherited from JavaObject) |
| IJavaPeerable.JniObjectReferenceControlBlock | (Inherited from JavaObject) |
| IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from JavaObject) |
| IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from JavaObject) |
| IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from JavaObject) |
| IJavaPeerable.UnregisterFromRuntime() | |
Extension Methods
| Name | Description |
|---|---|
| GetJniTypeName(IJavaPeerable) |
Gets the JNI name of the type of the instance |
| JavaAs<TResult>(IJavaPeerable) |
Try to coerce |
| JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
| JavaCast<TResult>(IJavaObject) | |
| TryJavaCast<TResult>(IJavaPeerable, TResult) |
Try to coerce |