Example usage for java.lang Object equals

List of usage examples for java.lang Object equals

Introduction

In this page you can find the example usage for java.lang Object equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:Main.java

private static TreePath find(JTree tree, TreePath parent, Object[] nodes, int depth) {
    TreeNode node = (TreeNode) parent.getLastPathComponent();
    Object o = node;

    if (o.equals(nodes[depth])) {
        if (depth == nodes.length - 1) {
            return parent;
        }/*from  ww  w  .  j  av a 2  s  .  com*/
        if (node.getChildCount() >= 0) {
            for (Enumeration e = node.children(); e.hasMoreElements();) {
                TreeNode n = (TreeNode) e.nextElement();
                TreePath path = parent.pathByAddingChild(n);
                TreePath result = find(tree, path, nodes, depth + 1);
                if (result != null) {
                    return result;
                }
            }
        }
    }
    return null;
}

From source file:Main.java

public static boolean performEquals(Object obj1, Object obj2) {
    if (obj1.equals(obj2))
        return true;
    return false;
}

From source file:Main.java

public static boolean isNvl(Object obj) {
    if (null == obj || obj.equals("")) {
        return Boolean.TRUE;
    }/*  www  . j  ava2s . c  o m*/
    return Boolean.FALSE;
}

From source file:Main.java

public static int cardinality(Object obj, Collection coll) {
    int i = 0;/*from www . j a  v a 2  s  .c om*/
    for (Object o : coll) {
        if (o.equals(obj)) {
            i++;
        }
    }
    return i;
}

From source file:Main.java

private static boolean isNull(Object object) {
    if (object == null || object.equals("")) {
        return true;
    }/*from w  ww .j  av  a  2s .co m*/
    return false;
}

From source file:Main.java

public static Object[] removeElement(Object[] array, Object element) {
    Object[] newArray = new Object[array.length - 1];
    int index = 0;
    for (Object entry : array) {
        if (!entry.equals(element)) {
            newArray[index++] = entry;/*from  w w w  .  j  ava 2s.com*/
        }
    }
    return newArray;
}

From source file:Main.java

public static String isNull_String(Object response) {
    if (response == null | response.equals(null))
        return "";
    else//from  w ww  . j  a  v  a  2  s .  c  om
        return response.toString().trim();
}

From source file:Main.java

public static int isNull_Int(Object response) {
    if (response == null || response.equals(null))
        return -1;
    else//from   ww w  .  ja v  a  2  s.  co m
        return Integer.parseInt(response.toString().trim());

}

From source file:Main.java

public static String nvl(Object obj, String def) {
    return obj == null || obj.equals("null") || obj.equals("") ? def : obj.toString();
}

From source file:Main.java

public static boolean isNotNullAndEmpty(Object param) {

    if (null != param && !param.equals("") && !param.equals("null")) {
        return true;
    }/*w  w  w.  j  a  v  a 2  s  . c  om*/

    return false;

}