@Test public void testEquals() { assertEquals(new BasicValue(null), BasicValue.UNINITIALIZED_VALUE); assertEquals(new BasicValue(Type.INT_TYPE), BasicValue.INT_VALUE); assertEquals(BasicValue.INT_VALUE, BasicValue.INT_VALUE); assertNotEquals(new Object(), BasicValue.INT_VALUE); }
@Override public boolean equals(final Object value) { if (value == this) { return true; } else if (value instanceof BasicValue) { if (type == null) { return ((BasicValue) value).type == null; } else { return type.equals(((BasicValue) value).type); } } else { return false; } }
BasicValue implements Value { @Override public boolean equals(final Object value) { if (value == this) { return true; } else if (value instanceof BasicValue) { if (type == null) { return ((BasicValue) value).type == null; } else { return type.equals(((BasicValue) value).type); } } else { return false; } } }
BasicValue implements Value { @Override public boolean equals(final Object value) { if (value == this) { return true; } else if (value instanceof BasicValue) { if (type == null) { return ((BasicValue) value).type == null; } else { return type.equals(((BasicValue) value).type); } } else { return false; } } BasicValue(final Type type); }
BasicValue implements Value { @Override public boolean equals(final Object value) { if (value == this) { return true; } else if (value instanceof BasicValue) { if (type == null) { return ((BasicValue) value).type == null; } else { return type.equals(((BasicValue) value).type); } } else { return false; } } BasicValue(final Type type); Type getType(); @Override int getSize(); boolean isReference(); @Override boolean equals(final Object value); @Override int hashCode(); @Override String toString(); }
BasicValue implements Value { @Override public boolean equals(final Object value) { if (value == this) { return true; } else if (value instanceof BasicValue) { if (type == null) { return ((BasicValue) value).type == null; } else { return type.equals(((BasicValue) value).type); } } else { return false; } } BasicValue(final Type type); Type getType(); @Override int getSize(); boolean isReference(); @Override boolean equals(final Object value); @Override int hashCode(); @Override String toString(); static final BasicValue UNINITIALIZED_VALUE; static final BasicValue INT_VALUE; static final BasicValue FLOAT_VALUE; static final BasicValue LONG_VALUE; static final BasicValue DOUBLE_VALUE; static final BasicValue REFERENCE_VALUE; static final BasicValue RETURNADDRESS_VALUE; }