|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.lang.base.BasicUtilImpl
@Singleton @Named public class BasicUtilImpl
This is the implementation of the BasicUtil interface.
getInstance()| Field Summary | |
|---|---|
private static BasicUtil |
instance
|
| Fields inherited from interface net.sf.mmm.util.lang.api.BasicUtil |
|---|
EMPTY_INT_ARRAY |
| Constructor Summary | |
|---|---|
BasicUtilImpl()
The constructor. |
|
| 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. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static BasicUtil instance
getInstance()| Constructor Detail |
|---|
public BasicUtilImpl()
| Method Detail |
|---|
public static BasicUtil getInstance()
BasicUtilImpl.getInstance() methods and
construct new instances via the container-framework of your choice (like
plexus, pico, springframework, etc.). To wire up the dependent components
everything is properly annotated using common-annotations (JSR-250). If
your container does NOT support this, you should consider using a better
one.
public boolean isEqual(Object o1,
Object o2)
equal to each other. In advance to Object.equals(Object) the
objects may be null.
isEqual in interface BasicUtilo1 - 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)
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.
isEqual in interface BasicUtilarray1 - 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.
public 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.
isDeepEqual in interface BasicUtilo1 - 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)
array that equals (see checkEqual) to the given
value.
findInArray in interface BasicUtilvalue - 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)
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 BasicUtilvalue - 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)
array contains an element
that equals (see checkEqual) to the given value.
isInArray in interface BasicUtilvalue - 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)
array contains an element
that equals (see checkEqual) to the given value.
isInArray in interface BasicUtilvalue - 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)
CharIterator instances char by char.
compare in interface BasicUtilcharIterator1 - is the first CharIterator.charIterator2 - is the second CharIterator.
true if both CharIterators 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 | |||||||||