Compares two columns given by their names.

@param objA  The name of the first column
@param objB  The name of the second column
@return
@see         java.util.Comparator#compare(java.lang.Object, java.lang.Object)
5824
public int compare(Object objA, Object objB)
    {
        String idAStr = _table.getColumn((String)objA).getProperty("id");
        String idBStr = _table.getColumn((String)objB).getProperty("id");
        int idA;
        int idB;

        try {
            idA = Integer.parseInt(idAStr);
        }
        catch (Exception ex) {
            return 1;
        }
        try {
            idB = Integer.parseInt(idBStr);
        }
        catch (Exception ex) {
            return -1;
        }
        return idA < idB ? -1 : (idA > idB ? 1 : 0);
    }
1314066
public boolean eq(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (this._getUsefulClass() != obj.getClass())
            return false;
        
        Model<?> other = (Model<?>) obj;
        Table tableinfo = this.table();
        Set<Entry<String, Object>> attrsEntrySet = this._getAttrsEntrySet();
        for (Entry<String, Object> entry : attrsEntrySet) {
            String key = entry.getKey();
            Object value = entry.getValue();
            Class<?> clazz = tableinfo.getColumnType(key);
            if (clazz == Float.class) {
            } else if (clazz == Double.class) {
            } else if (clazz == Model.class) {
            } else {
                if (value == null) {
                    if (other.get(key) != null)
                        return false;
                } else if (!value.equals(other.get(key)))
                    return false;
            }
        }
        return true;		
	}
361844
public static int compareTierNames(String a, String b) {
    int aValue = getTierRankValue(a);
    int bValue = getTierRankValue(b);
    if (aValue == bValue) {
      return a.compareTo(b);
    }
    return aValue - bValue;
  }
1084361
public int compareTo(Object that) {
        if (that instanceof GroovyDoc) {
            return name.compareTo(((GroovyDoc) that).name());
        } else {
            throw new ClassCastException(String.format("Cannot compare object of type %s.", that.getClass()));
        }
    }
1289156
public static boolean areObjectsEqual(Object obj1, Object obj2) {
        boolean equal = false;
        if(obj1 == null && obj2 == null) {
            equal = true;
        } else {
            if(obj1 != null) {
                if(obj1.equals(obj2)) {
                    equal = true;
                }
            }
        }
        return equal;
    }
1245598
@Override
    public void visitCode(Code obj) {
        try {
            userValues = new HashMap<>();
            loops = new HashMap<>();
            isInstanceMethod = !getMethod().isStatic();
            super.visitCode(obj);
        } finally {
            userValues = null;
            loops = null;
        }
    }
1035904
public final static boolean objectEquals(Object a, Object b) {
        return a == null ?
                b == null ? true : false :
                    b == null ? false : a.equals(b);
    }
209326
public static void print(final Object obj)
	{
		System.out.println(getInstance(obj.getClass()).serialise(obj));
	}
21298
public int compare(Class toType_a, Class toType_b) {
        TypeDesc from = mFrom;
        TypeDesc a = TypeDesc.forClass(toType_a);
        TypeDesc b = TypeDesc.forClass(toType_b);

        if (from == a) {
            if (from == b) {
                return 0;
            }
            return -1;
        } else if (from == b) {
            return 1;
        }

        int result = compare(from, a, b);
        if (result != 0) {
            return result;
        }

        if (from.isPrimitive()) {
            // Try boxing.
            if (from.toObjectType() != null) {
                from = from.toObjectType();
                return compare(from, a, b);
            }
        } else {
            // Try unboxing.
            if (from.toPrimitiveType() != null) {
                from = from.toPrimitiveType();
                result = compare(from, a, b);
                if (result != 0) {
                    return result;
                }
                // Try boxing back up. Test by unboxing 'to' types.
                if (!toType_a.isPrimitive() && a.toPrimitiveType() != null) {
                    a = a.toPrimitiveType();
                }
                if (!toType_b.isPrimitive() && b.toPrimitiveType() != null) {
                    b = b.toPrimitiveType();
                }
                return compare(from, a, b);
            }
        }

        return 0;
    }
33335
public static boolean nullSafeEquals(final Object obj1, final Object obj2) {
        return ((obj1 == null && obj2 == null)
                || (obj1 != null && obj2 != null && obj1.equals(obj2)));
    }
1071505
function objCompare(rootObj, objAry) {
    var aryLen = objAry.length;
    // var rootStr = JSON.stringify(rootObj);
    var matchNum = 0;
    for (var i = 0; i < aryLen; i++) {
        // var compareStr = JSON.stringify(objAry[i]);
        var compareObj = objAry[i];
        matchNum += rootObj == compareObj ? 1 : 0;
    }
    return matchNum > 0 ? true : false;
}
166993
public CompareResult compare(final Object pvObject1, final Object pvObject2) {
		CompareResult[] lvCompareResults = null;
		lvCompareResults = compareIntern(pvObject1, pvObject2, true);
		CompareResult lvResult = (lvCompareResults == null ? null : lvCompareResults[0]);
		return lvResult;
	}
1196339
@Override
	public int compareTo(StructureName o) {
		if ( this.equals(o))
			return 0;

		String pdb1 = null;
		String pdb2 = null;
		try {
			pdb1 = this.getPdbId();
		} catch (StructureException e) {}
		try {
			pdb2 = this.getPdbId();
		} catch (StructureException e) {}

		int comp = 0;

		// Sort those with PDBIDs before those without
		if( pdb1 == null ) {
			if( pdb2 != null) {
				return 1; // this > o
			}
			// both null
		} else if( pdb2 == null){
			return -1; // this < o
		} else {
			// neither null
			comp = pdb1.compareTo(pdb2);
		}
		if( comp != 0 ) {
			return comp;
		}

		// break tie with full identifiers
		pdb1 = this.getIdentifier();
		pdb2 = o.getIdentifier();

		// Throws NPE for nulls
		return pdb1.compareTo(pdb2);
	}
854348
@Override
	@Pure
	public int indexOf(Object obj) {
		if (this.clazz.isInstance(obj)) {
			return this.grid.indexOf(this.clazz.cast(obj));
		}
		return -1;
	}
542364
@Then("^I check that table '(.+?)' is iqual to$")
    public void comparetable(String tableName, DataTable dataTable) throws Exception {
        Statement myStatement = null;
        java.sql.ResultSet rs = null;

        //from postgres table
        List<String> sqlTable = new ArrayList<String>();
        List<String> sqlTableAux = new ArrayList<String>();
        //from Cucumber Datatable
        List<String> tablePattern = new ArrayList<String>();
        //comparison is by lists of string
        tablePattern = dataTable.asList(String.class);


        Connection myConnection = this.commonspec.getConnection();
        String query = "SELECT * FROM " + tableName + " order by " + "id" + ";";
        try {
            myStatement = myConnection.createStatement();
            rs = myStatement.executeQuery(query);

            //takes column names and culumn count
            ResultSetMetaData resultSetMetaData = rs.getMetaData();
            int count = resultSetMetaData.getColumnCount();
            for (int i = 1; i <= count; i++) {
                sqlTable.add(resultSetMetaData.getColumnName(i).toString());
            }

            //takes column names and culumn count
            while (rs.next()) {
                for (int i = 1; i <= count; i++) {
                    //aux list without column names
                    sqlTableAux.add(rs.getObject(i).toString());
                }
            }
            sqlTable.addAll(sqlTableAux);

            assertThat(sqlTable).as("Not equal elements!").isEqualTo(tablePattern);
            rs.close();
            myStatement.close();
        } catch (Exception e) {
            e.printStackTrace();
            assertThat(rs).as("There are no table " + tableName).isNotNull();
        }
    }
1236324
@Override
    public int compareTo(ComparableMethod rhs) {
        if (rhs instanceof MethodDescriptor) {
            return FieldOrMethodDescriptor.compareTo(this, (MethodDescriptor) rhs);
        }

        if (rhs instanceof XMethod) {
            return XFactory.compare((XMethod) this, (XMethod) rhs);
        }

        throw new ClassCastException("Can't compare a " + this.getClass().getName() + " to a " + rhs.getClass().getName());
    }
472577
@Override
    public int compareTo(ComparableField rhs) {
        if (rhs instanceof FieldDescriptor) {
            return FieldOrMethodDescriptor.compareTo(this, (FieldDescriptor) rhs);
        }

        if (rhs instanceof XField) {
            return XFactory.compare((XField) this, (XField) rhs);
        }

        throw new ClassCastException("Can't compare a " + this.getClass().getName() + " to a " + rhs.getClass().getName());
    }