|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@ComponentSpecification public interface BasicUtil
This is the interface for a collection of utility functions for very general operations especially for dealing with Arrays.
BasicUtilImpl.getInstance()
,
Arrays
,
Array
,
ReflectionUtil
Field Summary | |
---|---|
static int[] |
EMPTY_INT_ARRAY
An empty int array. |
Method Summary | |
---|---|
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 . |
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 . |
Field Detail |
---|
static final int[] EMPTY_INT_ARRAY
Method Detail |
---|
boolean isEqual(Object o1, Object o2)
equal
to each other. In advance to Object.equals(Object)
the
objects may be null
.
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.isDeepEqual(Object, Object)
boolean isEqual(Object[] array1, Object[] array2)
equal
to each other. On arrays the
equals
-method only checks for identity. This
method checks that both arrays have the same length
and if so
that the objects contained in the arrays are
equal
. Additionally the given arrays may
be null
.
array1
- the first array to compare. It may be null
.array2
- the second array to compare. It may be null
.
true
if both arrays are null
or the first
is NOT null
and both arrays have the same
length
and equal
content, false
otherwise.boolean isDeepEqual(Object o1, Object o2)
equal
to each other. In advance to Object.equals(Object)
the
objects may be null
and arrays are
compared structural
recursively.
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.int findInArray(Object value, Object[] array, boolean checkEqual)
array
that equals (see checkEqual
) to the given
value
.
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
.int findInArray(Object value, Object array, boolean checkEqual)
array
that equals (see checkEqual
) to the given
value
.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
.
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
.boolean isInArray(Object value, Object[] array, boolean checkEqual)
array
contains an element
that equals (see checkEqual
) to the given value
.
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
.findInArray(Object, Object[], boolean)
boolean isInArray(Object value, Object array, boolean checkEqual)
array
contains an element
that equals (see checkEqual
) to the given value
.
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
.findInArray(Object, Object, boolean)
boolean compare(CharIterator charIterator1, CharIterator charIterator2)
CharIterator
instances char by char.
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |