Class NumberMultiplier
The NumberMultiplier entry processor is used to multiply a property value of a Byte, Int16, Int32, Int64, Single, Double, BigInteger and BigDecimal type.
Inherited Members
Namespace: Tangosol.Util.Processor
Assembly: Coherence.dll
Syntax
public class NumberMultiplier : PropertyProcessor, IEntryProcessor, IPortableObject
Constructors
NumberMultiplier()
Default constructor.
Declaration
public NumberMultiplier()
NumberMultiplier(string, object, bool)
Construct an NumberMultiplier processor that will multiply a property value by a specified factor, returning either the old or the new value as specified.
Declaration
public NumberMultiplier(string name, object numInc, bool postIncrement)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The property name. |
| object | numInc | The object representing the magnitude and sign of the multiplier. |
| bool | postIncrement | Pass true to return the value as it was before it was multiplied, or pass false to return the value as it is after it is multiplied. |
Remarks
The .NET type of the original property value will dictate the way the specified factor is interpreted. For example, applying a factor of Double(0.5) to a property value of Int32(4) will result in a new property value of Int32(2).
If the original property value is null, the .NET type of
the numFactor parameter will dictate the .NET type of the new
value.
NumberMultiplier(PropertyManipulator, object, bool)
Construct an NumberMultiplier processor that will increment a property value by a specified amount, returning either the old or the new value as specified.
Declaration
public NumberMultiplier(PropertyManipulator manipulator, object numInc, bool postIncrement)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyManipulator | manipulator | The PropertyManipulator; could be |
| object | numInc | The object representing the magnitude and sign of the multiplier. |
| bool | postIncrement | Pass true to return the value as it was before it was multiplied, or pass false to return the value as it is after it is multiplied. |
Remarks
The .NET type of the original property value will dictate the way the specified factor is interpreted. For example, applying a factor of Double(0.5) to a property value of Int32(4) will result in a new property value of Int32(2).
If the original property value is null, the .NET type of
the numFactor parameter will dictate the .NET type of the new
value.
Properties
Description
Returns this PropertyProcessor's description.
Declaration
protected override string Description { get; }
Property Value
| Type | Description |
|---|---|
| string | This PropertyProcessor's description. |
Overrides
Methods
Process(IInvocableCacheEntry)
Process an IInvocableCacheEntry.
Declaration
public override object Process(IInvocableCacheEntry entry)
Parameters
| Type | Name | Description |
|---|---|---|
| IInvocableCacheEntry | entry | The IInvocableCacheEntry to process. |
Returns
| Type | Description |
|---|---|
| object | The result of the processing, if any. |
Overrides
ReadExternal(IPofReader)
Restore the contents of a user type instance by reading its state using the specified IPofReader object.
Declaration
public override void ReadExternal(IPofReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| IPofReader | reader | The IPofReader from which to read the object's state. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| IOException | If an I/O error occurs. |
WriteExternal(IPofWriter)
Save the contents of a POF user type instance by writing its state using the specified IPofWriter object.
Declaration
public override void WriteExternal(IPofWriter writer)
Parameters
| Type | Name | Description |
|---|---|---|
| IPofWriter | writer | The IPofWriter to which to write the object's state. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| IOException | If an I/O error occurs. |