Package org.djutils.base
Class MutableShort
java.lang.Object
org.djutils.base.MutableShort
A simple version of a mutable short with get() and set(short) functions.
 
Copyright (c) 2023-2025 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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoiddec()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.booleanshortget()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.toString()
- 
Constructor Details- 
MutableShortpublic MutableShort(short value) Initialize the mutable short with a value.- Parameters:
- value- the initial value of the mutable short
 
 
- 
- 
Method Details- 
setpublic void set(short newValue) set the mutable short to a new value.- Parameters:
- newValue- the new value of the mutable short
 
- 
getpublic short get()- Returns:
- the current value of the mutable short
 
- 
incpublic void inc(short increment) Increment the modifiable short with a value.- Parameters:
- increment- the value to increment the modifiable short with
 
- 
incpublic void inc()Increment the modifiable short with 1.
- 
decpublic void dec(short decrement) Decrement the modifiable short with a value.- Parameters:
- decrement- the value to decrement the modifiable short with
 
- 
decpublic void dec()Decrement the modifiable short with 1.
- 
mulpublic void mul(short multiplier) Increment the modifiable short with a value.- Parameters:
- multiplier- the value to multiply the modifiable short with
 
- 
divpublic void div(short divisor) Divide the modifiable short by a value.- Parameters:
- divisor- the value to divide the modifiable short by
 
- 
hashCodepublic int hashCode()
- 
equals
- 
toString
 
-