< prev index next >

src/java.desktop/share/classes/java/awt/DisplayMode.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 140,149 **** --- 140,150 ---- } /** * {@inheritDoc} */ + @Override public boolean equals(Object dm) { if (dm instanceof DisplayMode) { return equals((DisplayMode)dm); } else { return false;
*** 151,161 **** --- 152,172 ---- } /** * {@inheritDoc} */ + @Override public int hashCode() { return getWidth() + getHeight() + getBitDepth() * 7 + getRefreshRate() * 13; } + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return getWidth() + "x" + getHeight() + + (getBitDepth() > 0 ? "x" + getBitDepth() + "bpp": "") + + "@" + getRefreshRate() + "Hz"; + } }
< prev index next >