@Test public void testHashCode() { Font theFont1 = new Font(Font.FontName.ARIAL, 22); Font theFont2 = new Font(Font.FontName.ARIAL, 22); assertEquals(theFont1.hashCode(), theFont2.hashCode()); assertFalse(theFont1.hashCode() == new Font(Font.FontName.VERDANA, 22).hashCode()); }
@Override public int hashCode() { return name.hashCode(); }
Font implements Distributable { @Override public int hashCode() { return name.hashCode(); } }
Font implements Distributable { @Override public int hashCode() { return name.hashCode(); } Font(FontName aFontName, int aSize); }
Font implements Distributable { @Override public int hashCode() { return name.hashCode(); } Font(FontName aFontName, int aSize); @Override boolean equals(Object o); @Override int hashCode(); Font changeSize(int aSize); Font changeName(FontName aName); @Override Map<String, Object> serialize(); static Font deserialize(Map<String, Object> aSerializedData); }
Font implements Distributable { @Override public int hashCode() { return name.hashCode(); } Font(FontName aFontName, int aSize); @Override boolean equals(Object o); @Override int hashCode(); Font changeSize(int aSize); Font changeName(FontName aName); @Override Map<String, Object> serialize(); static Font deserialize(Map<String, Object> aSerializedData); static final Font DEFAULT_FONT; final FontName name; final int size; }