Package org.djutils.base
Class MutableBoolean
- java.lang.Object
-
- org.djutils.base.MutableBoolean
-
public class MutableBoolean extends Object
A simple version of a mutable boolean with get() and set(boolean) 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 MutableBoolean(boolean value)Initialize the mutable boolean with a value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)voidflip()Flip the value of modifiable boolean.booleanget()inthashCode()voidset(boolean newValue)set the mutable boolean to a new value.StringtoString()
-
-
-
Method Detail
-
set
public void set(boolean newValue)
set the mutable boolean to a new value.- Parameters:
newValue- boolean; the new value of the mutable boolean
-
get
public boolean get()
- Returns:
- boolean; the current value of the mutable boolean
-
flip
public void flip()
Flip the value of modifiable boolean.
-
-