public final class MutableChar extends Object implements Comparable<MutableChar>, Mutable
Note: it's copied from Apache Commons Lang developed at The Apache Software Foundation (http://www.apache.org/), or under the Apache License 2.0. The methods copied from other products/frameworks may be modified in this class.
A mutablechar wrapper.
Note that as MutableChar does not extend Char, it is not treated by String.format as a Char parameter.
MutableChar is NOT thread-safe.
Char| Modifier and Type | Method and Description |
|---|---|
void |
add(char operand)
Adds a value to the value of this instance.
|
char |
addAndGet(char delta)
Adds the given value to the current value.
|
int |
compareTo(MutableChar other)
Compares this mutable to another in ascending order.
|
void |
decrement()
Decrements the value.
|
char |
decrementAndGet()
Decrements by one the current value.
|
boolean |
equals(Object obj)
Compares this object to the specified object.
|
char |
getAndAdd(char delta)
Adds the given value to the current value.
|
char |
getAndDecrement()
Decrements by one the current value.
|
char |
getAndIncrement()
Increments by one the current value.
|
char |
getAndSet(char value)
Gets the and set.
|
char |
getValue()
Deprecated.
replace by
value(). |
int |
hashCode()
Returns a suitable hash code for this mutable.
|
void |
increment()
Increments the value.
|
char |
incrementAndGet()
Increments by one the current value.
|
static MutableChar |
of(char value) |
char |
setAndGet(char value)
Sets the and get.
|
<E extends Exception> |
setIf(char newValue,
Throwables.CharBiPredicate<E> predicate)
Deprecated.
|
<E extends Exception> |
setIf(char newValue,
Throwables.CharPredicate<E> predicate)
Set with the specified new value and returns
true if predicate returns true. |
void |
setValue(char value)
Sets the value.
|
void |
subtract(char operand)
Subtracts a value from the value of this instance.
|
String |
toString()
Returns the String value of this mutable.
|
char |
value() |
public static MutableChar of(char value)
value - public char value()
@Deprecated public char getValue()
value().public void setValue(char value)
public char getAndSet(char value)
value - public char setAndGet(char value)
value - public <E extends Exception> boolean setIf(char newValue, Throwables.CharPredicate<E> predicate) throws E extends Exception
true if predicate returns true.
Otherwise just return false without setting the value to new value.E - newValue - predicate - - test the current value.E - the eE extends Exception@Deprecated public <E extends Exception> boolean setIf(char newValue, Throwables.CharBiPredicate<E> predicate) throws E extends Exception
true if predicate returns true.
Otherwise just return false without setting the value to new value.E - newValue - predicate - the first parameter is the current value, the second parameter is the new value.E - the eE extends Exceptionpublic void increment()
public void decrement()
public void add(char operand)
public void subtract(char operand)
public final char getAndIncrement()
public final char getAndDecrement()
public final char incrementAndGet()
public final char decrementAndGet()
public final char getAndAdd(char delta)
delta - the value to addpublic final char addAndGet(char delta)
delta - the value to addpublic int compareTo(MutableChar other)
compareTo in interface Comparable<MutableChar>public boolean equals(Object obj)
true if and only if the argument is
not null and is a MutableChar object that contains the same char value
as this object.
obj the object to compare with, null returns falsepublic int hashCode()
Copyright © 2021. All rights reserved.