public class BasicUtilImpl extends Object implements BasicUtil
BasicUtil
interface.getInstance()
Modifier and Type | Field and Description |
---|---|
private static BasicUtil |
instance |
EMPTY_INT_ARRAY
Constructor and Description |
---|
BasicUtilImpl()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
compare(CharIterator charIterator1,
CharIterator charIterator2)
This method compares the given
CharIterator instances char by char. |
int |
findInArray(Object value,
Object[] array,
boolean checkEqual)
This method returns the index of the first element in the given
array that equals (see
checkEqual ) to the given value . |
int |
findInArray(Object value,
Object array,
boolean checkEqual)
This method returns the index of the first element in the given
array that equals (see
checkEqual ) to the given value . |
static BasicUtil |
getInstance()
This method gets the singleton instance of this
BasicUtilImpl . |
boolean |
isDeepEqual(Object o1,
Object o2)
This method checks if two given objects are
equal to each other. |
boolean |
isEqual(Object[] array1,
Object[] array2)
This method checks if two given arrays are structurally
equal to each
other. |
boolean |
isEqual(Object o1,
Object o2)
This method checks if two given objects are
equal to each other. |
boolean |
isInArray(Object value,
Object[] array,
boolean checkEqual)
This method determines if the given
array contains an element that equals (see checkEqual
) to the given value . |
boolean |
isInArray(Object value,
Object array,
boolean checkEqual)
This method determines if the given
array contains an element that equals (see checkEqual
) to the given value . |
private static BasicUtil instance
public static BasicUtil getInstance()
BasicUtilImpl
. Cdi.GET_INSTANCE
before using.public boolean isEqual(Object o1, Object o2)
BasicUtil
equal
to each other. In advance
to Object.equals(Object)
the objects may be null
.isEqual
in interface BasicUtil
o1
- the first object to compare. It may be null
.o2
- the second object to compare. It may be null
.true
if both objects are null
or the first is NOT null
and
o1.equals(o2)
, false
otherwise.BasicUtil.isDeepEqual(Object, Object)
public boolean isEqual(Object[] array1, Object[] array2)
BasicUtil
public boolean isDeepEqual(Object o1, Object o2)
BasicUtil
equal
to each other. In advance
to Object.equals(Object)
the objects may be null
and arrays are
compared structural
recursively.isDeepEqual
in interface BasicUtil
o1
- the first object to compare. It may be null
.o2
- the second object to compare. It may be null
.true
if both objects are null
or the first is NOT null
and
o1.equals(o2)
, false
otherwise.public int findInArray(Object value, Object[] array, boolean checkEqual)
BasicUtil
array
that equals (see
checkEqual
) to the given value
.findInArray
in interface BasicUtil
value
- is the value to check. It may be null
.array
- is the array to check.checkEqual
- - if true
the value
only needs to be equal
to an element, if false
it needs to be the same (==
).-1
if value
is NOT contained in array
.public int findInArray(Object value, Object array, boolean checkEqual)
BasicUtil
array
that equals (see
checkEqual
) to the given value
. BasicUtil.findInArray(Object, Object[], boolean)
this method also works for
primitive
arrays (such as int[]
). In such case you need to supply the
according object-type
for value
.findInArray
in interface BasicUtil
value
- is the value to check. It may be null
.array
- is the array to check.checkEqual
- - if true
the value
only needs to be equal
to an element, if false
it needs to be the same (==
).-1
if value
is NOT contained in array
.public boolean isInArray(Object value, Object[] array, boolean checkEqual)
BasicUtil
array
contains an element that equals (see checkEqual
) to the given value
.isInArray
in interface BasicUtil
value
- is the value to check. It may be null
.array
- is the array to check.checkEqual
- - if true
the value
only needs to be equal
to an element, if false
it needs to be the same (==
).true
if the array
contains value
.BasicUtil.findInArray(Object, Object[], boolean)
public boolean isInArray(Object value, Object array, boolean checkEqual)
BasicUtil
array
contains an element that equals (see checkEqual
) to the given value
.isInArray
in interface BasicUtil
value
- is the value to check. It may be null
.array
- is the array to check.checkEqual
- - if true
the value
only needs to be equal
to an element, if false
it needs to be the same (==
).true
if the array
contains value
.BasicUtil.findInArray(Object, Object, boolean)
public boolean compare(CharIterator charIterator1, CharIterator charIterator2)
BasicUtil
CharIterator
instances char by char.compare
in interface BasicUtil
charIterator1
- is the first CharIterator
.charIterator2
- is the second CharIterator
.true
if both CharIterator
s produced the same next
chars until both ended at the same time, false
otherwise.Copyright © 2001–2016 mmm-Team. All rights reserved.