org.eclipse.swt.graphics.Color.hashCode()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.eclipse.swt.graphics.Color.hashCode()方法的一些代码示例,展示了Color.hashCode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Color.hashCode()方法的具体详情如下:
包路径:org.eclipse.swt.graphics.Color
类名称:Color
方法名:hashCode

Color.hashCode介绍

[英]Returns an integer hash code for the receiver. Any two objects that return true when passed to equals must return the same value for this method.
[中]返回接收器的整数哈希代码。当传递给equals时返回true的任何两个对象必须为此方法返回相同的值。

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

@Override
public int hashCode() {
   if (fHashCode == 0) {
     int multiplier= 37; // some prime
     fHashCode= 13; // some random value
     fHashCode= multiplier * fHashCode + (font == null ? 0 : font.hashCode());
     fHashCode= multiplier * fHashCode + (background == null ? 0 : background.hashCode());
     fHashCode= multiplier * fHashCode + (foreground == null ? 0 : foreground.hashCode());
     fHashCode= multiplier * fHashCode + style;
   }
   return fHashCode;
 }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

@Override
public int hashCode() {
   if (fHashCode == 0) {
     int multiplier= 37; // some prime
     fHashCode= 13; // some random value
     fHashCode= multiplier * fHashCode + (font == null ? 0 : font.hashCode());
     fHashCode= multiplier * fHashCode + (background == null ? 0 : background.hashCode());
     fHashCode= multiplier * fHashCode + (foreground == null ? 0 : foreground.hashCode());
     fHashCode= multiplier * fHashCode + style;
   }
   return fHashCode;
 }

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

/**
 * 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() {
  int hash = 0;
  if (foreground != null) hash ^= foreground.hashCode();
  if (background != null) hash ^= background.hashCode();
  if (font != null) hash ^= font.hashCode();
  if (metrics != null) hash ^= metrics.hashCode();
  if (underline) hash ^= (hash << 1);
  if (strikeout) hash ^= (hash << 2);
  hash ^= rise;
  if (underlineColor != null) hash ^= underlineColor.hashCode();
  if (strikeoutColor != null) hash ^= strikeoutColor.hashCode();
  if (borderColor != null) hash ^= borderColor.hashCode();
  hash ^= underlineStyle;
  return hash;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

/**
 * 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() {
  int hash = 0;
  if (foreground != null) hash ^= foreground.hashCode();
  if (background != null) hash ^= background.hashCode();
  if (font != null) hash ^= font.hashCode();
  if (metrics != null) hash ^= metrics.hashCode();
  if (underline) hash ^= (hash << 1);
  if (strikeout) hash ^= (hash << 2);
  hash ^= rise;
  if (underlineColor != null) hash ^= underlineColor.hashCode();
  if (strikeoutColor != null) hash ^= strikeoutColor.hashCode();
  if (borderColor != null) hash ^= borderColor.hashCode();
  hash ^= underlineStyle;
  return hash;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

/**
 * 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() {
  int hash = 0;
  if (foreground != null) hash ^= foreground.hashCode();
  if (background != null) hash ^= background.hashCode();
  if (font != null) hash ^= font.hashCode();
  if (metrics != null) hash ^= metrics.hashCode();
  if (underline) hash ^= (hash << 1);
  if (strikeout) hash ^= (hash << 2);
  hash ^= rise;
  if (underlineColor != null) hash ^= underlineColor.hashCode();
  if (strikeoutColor != null) hash ^= strikeoutColor.hashCode();
  if (borderColor != null) hash ^= borderColor.hashCode();
  hash ^= underlineStyle;
  return hash;
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

/**
 * 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)
 */
public int hashCode() {
  int hash = 0;
  if (foreground != null) hash ^= foreground.hashCode();
  if (background != null) hash ^= background.hashCode();	
  if (font != null) hash ^= font.hashCode();
  if (metrics != null) hash ^= metrics.hashCode();
  if (underline) hash ^= (hash << 1);
  if (strikeout) hash ^= (hash << 2);
  hash ^= rise;
  if (underlineColor != null) hash ^= underlineColor.hashCode();
  if (strikeoutColor != null) hash ^= strikeoutColor.hashCode();
  if (borderColor != null) hash ^= borderColor.hashCode();
  hash ^= underlineStyle;
  return hash;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

/**
 * 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() {
  int hash = 0;
  if (foreground != null) hash ^= foreground.hashCode();
  if (background != null) hash ^= background.hashCode();
  if (font != null) hash ^= font.hashCode();
  if (metrics != null) hash ^= metrics.hashCode();
  if (underline) hash ^= (hash << 1);
  if (strikeout) hash ^= (hash << 2);
  hash ^= rise;
  if (underlineColor != null) hash ^= underlineColor.hashCode();
  if (strikeoutColor != null) hash ^= strikeoutColor.hashCode();
  if (borderColor != null) hash ^= borderColor.hashCode();
  hash ^= underlineStyle;
  return hash;
}

代码示例来源:origin: org.eclipse.egit/ui

@Override
  public int hashCode() {
    return super.hashCode() ^ color.hashCode();
  }
}

相关文章