当前位置: 首页>>代码示例>>Java>>正文


Java Equality.equals方法代码示例

本文整理汇总了Java中gnu.trove.Equality.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Equality.equals方法的具体用法?Java Equality.equals怎么用?Java Equality.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gnu.trove.Equality的用法示例。


在下文中一共展示了Equality.equals方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: install

import gnu.trove.Equality; //导入方法依赖的package包/类
public static TreeExpansionMonitor<DefaultMutableTreeNode> install(final JTree tree, final Equality<DefaultMutableTreeNode> equality) {
  return new TreeExpansionMonitor<DefaultMutableTreeNode>(tree) {
    protected TreePath findPathByNode(final DefaultMutableTreeNode node) {
      Enumeration enumeration = ((DefaultMutableTreeNode)tree.getModel().getRoot()).breadthFirstEnumeration();
      while (enumeration.hasMoreElements()) {
        final Object nextElement = enumeration.nextElement();
        if (nextElement instanceof DefaultMutableTreeNode) {
          DefaultMutableTreeNode child = (DefaultMutableTreeNode)nextElement;
          if (equality.equals(child, node)) {
            return new TreePath(child.getPath());
          }
        }
      }
      return null;
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:TreeExpansionMonitor.java

示例2: equals

import gnu.trove.Equality; //导入方法依赖的package包/类
@Contract(pure=true)
public static <T> boolean equals(@NotNull T[] a1, @NotNull T[] a2, @NotNull Equality<? super T> comparator) {
  if (a1 == a2) {
    return true;
  }

  int length = a2.length;
  if (a1.length != length) {
    return false;
  }

  for (int i = 0; i < length; i++) {
    if (!comparator.equals(a1[i], a2[i])) {
      return false;
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ArrayUtil.java

示例3: equals

import gnu.trove.Equality; //导入方法依赖的package包/类
public static <T> boolean equals(T[] a1, T[] a2, @NotNull Equality<? super T> comparator) {
  if (a1 == a2) {
    return true;
  }
  if (a1 == null || a2 == null) {
    return false;
  }

  int length = a2.length;
  if (a1.length != length) {
    return false;
  }

  for (int i = 0; i < length; i++) {
    if (!comparator.equals(a1[i], a2[i])) {
      return false;
    }
  }
  return true;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:ArrayUtil.java

示例4: equals

import gnu.trove.Equality; //导入方法依赖的package包/类
@Contract(pure=true)
public static <T> boolean equals(@Nonnull T[] a1, @Nonnull T[] a2, @Nonnull Equality<? super T> comparator) {
  //noinspection ArrayEquality
  if (a1 == a2) {
    return true;
  }

  int length = a2.length;
  if (a1.length != length) {
    return false;
  }

  for (int i = 0; i < length; i++) {
    if (!comparator.equals(a1[i], a2[i])) {
      return false;
    }
  }
  return true;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:ArrayUtil.java

示例5: indexOf

import gnu.trove.Equality; //导入方法依赖的package包/类
@Contract(pure=true)
public static <T> int indexOf(@NotNull List<T> objects, T object, @NotNull Equality<T> comparator) {
  for (int i = 0; i < objects.size(); i++) {
    if (comparator.equals(objects.get(i), object)) return i;
  }
  return -1;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ArrayUtil.java

示例6: lastIndexOf

import gnu.trove.Equality; //导入方法依赖的package包/类
@Contract(pure=true)
public static <T> int lastIndexOf(@NotNull final T[] src, final T obj, @NotNull Equality<? super T> comparator) {
  for (int i = src.length - 1; i >= 0; i--) {
    final T o = src[i];
    if (comparator.equals(obj, o)) {
      return i;
    }
  }
  return -1;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ArrayUtil.java

示例7: indexOf

import gnu.trove.Equality; //导入方法依赖的package包/类
@Contract(pure=true)
public static <T> int indexOf(@Nonnull List<T> objects, T object, @Nonnull Equality<T> comparator) {
  for (int i = 0; i < objects.size(); i++) {
    if (comparator.equals(objects.get(i), object)) return i;
  }
  return -1;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:ArrayUtil.java

示例8: lastIndexOf

import gnu.trove.Equality; //导入方法依赖的package包/类
@Contract(pure=true)
public static <T> int lastIndexOf(@Nonnull final T[] src, final T obj, @Nonnull Equality<? super T> comparator) {
  for (int i = src.length - 1; i >= 0; i--) {
    final T o = src[i];
    if (comparator.equals(obj, o)) {
      return i;
    }
  }
  return -1;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:ArrayUtil.java

示例9: indexOf

import gnu.trove.Equality; //导入方法依赖的package包/类
public static <T> int indexOf(@NotNull List<T> objects, T object, @NotNull Equality<T> comparator) {
  for (int i = 0; i < objects.size(); i++) {
    if (comparator.equals(objects.get(i), object)) return i;
  }
  return -1;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:7,代码来源:ArrayUtil.java


注:本文中的gnu.trove.Equality.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。