/** * Tests whether this color scheme is the same as another color scheme. * * @param otherScheme The color scheme to compare to. * @return <code>true</code> if this color scheme and * <code>otherScheme</code> are the same scheme; * <code>false</code> otherwise. */ @Override public boolean equals(Object otherScheme) { // No need for null check; instanceof takes care of this for us, // i.e. "if (!(null instanceof Foo))" evaluates to "true". if (!(otherScheme instanceof SyntaxScheme)) { return false; } Style[] otherSchemes = ((SyntaxScheme)otherScheme).styles; int length = styles.length; for (int i=0; i<length; i++) { if (styles[i]==null) { if (otherSchemes[i]!=null) { return false; } } else if (!styles[i].equals(otherSchemes[i])) { return false; } } return true; }
/** * Tests whether this color scheme is the same as another color scheme. * * @param otherScheme The color scheme to compare to. * @return <code>true</code> if this color scheme and * <code>otherScheme</code> are the same scheme; * <code>false</code> otherwise. */ @Override public boolean equals(Object otherScheme) { // No need for null check; instanceof takes care of this for us, // i.e. "if (!(null instanceof Foo))" evaluates to "true". if (!(otherScheme instanceof SyntaxScheme)) { return false; } Style[] otherSchemes = ((SyntaxScheme)otherScheme).styles; int length = styles.length; for (int i=0; i<length; i++) { if (styles[i]==null) { if (otherSchemes[i]!=null) { return false; } } else if (!styles[i].equals(otherSchemes[i])) { return false; } } return true; }
/** * Tests whether this color scheme is the same as another color scheme. * * @param otherScheme The color scheme to compare to. * @return <code>true</code> if this color scheme and * <code>otherScheme</code> are the same scheme; * <code>false</code> otherwise. */ public boolean equals(Object otherScheme) { // No need for null check; instanceof takes care of this for us, // i.e. "if (!(null instanceof Foo))" evaluates to "true". if (!(otherScheme instanceof SyntaxScheme)) { return false; } Style[] otherSchemes = ((SyntaxScheme)otherScheme).styles; int length = styles.length; for (int i=0; i<length; i++) { if (styles[i]==null) { if (otherSchemes[i]!=null) { return false; } } else if (!styles[i].equals(otherSchemes[i])) { return false; } } return true; }
/** * Tests whether this color scheme is the same as another color scheme. * * @param otherScheme The color scheme to compare to. * @return <code>true</code> if this color scheme and * <code>otherScheme</code> are the same scheme; * <code>false</code> otherwise. */ public boolean equals(Object otherScheme) { // No need for null check; instanceof takes care of this for us, // i.e. "if (!(null instanceof Foo))" evaluates to "true". if (!(otherScheme instanceof SyntaxScheme)) { return false; } Style[] otherSchemes = ((SyntaxScheme)otherScheme).styles; int length = styles.length; for (int i=0; i<length; i++) { if (styles[i]==null) { if (otherSchemes[i]!=null) { return false; } } else if (!styles[i].equals(otherSchemes[i])) { return false; } } return true; }