本文整理汇总了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;
}
};
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}