Package org.djutils.base
Class MutableShort
- java.lang.Object
-
- org.djutils.base.MutableShort
-
public class MutableShort extends Object
A simple version of a mutable short with get() and set(short) functions.Copyright (c) 2023-2023 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html.
- Author:
- Alexander Verbraeck
-
-
Constructor Summary
Constructors Constructor Description MutableShort(short value)Initialize the mutable short with a value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddec()Decrement the modifiable short with 1.voiddec(short decrement)Decrement the modifiable short with a value.voiddiv(short divisor)Divide the modifiable short by a value.booleanequals(Object obj)shortget()inthashCode()voidinc()Increment the modifiable short with 1.voidinc(short increment)Increment the modifiable short with a value.voidmul(short multiplier)Increment the modifiable short with a value.voidset(short newValue)set the mutable short to a new value.StringtoString()
-
-
-
Method Detail
-
set
public void set(short newValue)
set the mutable short to a new value.- Parameters:
newValue- short; the new value of the mutable short
-
get
public short get()
- Returns:
- short; the current value of the mutable short
-
inc
public void inc(short increment)
Increment the modifiable short with a value.- Parameters:
increment- short; the value to increment the modifiable short with
-
inc
public void inc()
Increment the modifiable short with 1.
-
dec
public void dec(short decrement)
Decrement the modifiable short with a value.- Parameters:
decrement- short; the value to decrement the modifiable short with
-
dec
public void dec()
Decrement the modifiable short with 1.
-
mul
public void mul(short multiplier)
Increment the modifiable short with a value.- Parameters:
multiplier- short; the value to multiply the modifiable short with
-
div
public void div(short divisor)
Divide the modifiable short by a value.- Parameters:
divisor- short; the value to divide the modifiable short by
-
-