/** * Compares the specified object to this StyleRange and answer if the two * are similar. The object must be an instance of StyleRange and have the * same field values for except for start and length. * * @param style * the object to compare with this object * @return true if the objects are similar, false otherwise */ public boolean similarTo(StyleRange style) { if (!super.equals(style)) return false; if (this.fontStyle != style.fontStyle) return false; return true; }
/** * Returns an integer hash code for the receiver. Any two objects that * return <code>true</code> when passed to <code>equals</code> must return * the same value for this method. * * @return the receiver's hash * * @see #equals(Object) */ @Override public int hashCode() { return super.hashCode() ^ this.fontStyle; }
buffer.append("normal"); //$NON-NLS-1$ String str = super.toString(); int index = str.indexOf('{'); str = str.substring(index + 1);
buffer.append("normal"); //$NON-NLS-1$ String str = super.toString(); int index = str.indexOf('{'); str = str.substring(index + 1);
/** * Returns an integer hash code for the receiver. Any two objects that * return <code>true</code> when passed to <code>equals</code> must return * the same value for this method. * * @return the receiver's hash * * @see #equals(Object) */ @Override public int hashCode() { return super.hashCode() ^ this.fontStyle; }
/** * Compares the specified object to this StyleRange and answer if the two * are similar. The object must be an instance of StyleRange and have the * same field values for except for start and length. * * @param style * the object to compare with this object * @return true if the objects are similar, false otherwise */ public boolean similarTo(StyleRange style) { if (!super.equals(style)) return false; if (this.fontStyle != style.fontStyle) return false; return true; }