本文整理汇总了Java中com.intellij.openapi.externalSystem.model.Key.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Key.equals方法的具体用法?Java Key.equals怎么用?Java Key.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.externalSystem.model.Key
的用法示例。
在下文中一共展示了Key.equals方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChildren
import com.intellij.openapi.externalSystem.model.Key; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@NotNull
public static <T> Collection<DataNode<T>> getChildren(@NotNull DataNode<?> node, @NotNull Key<T> key) {
Collection<DataNode<T>> result = null;
for (DataNode<?> child : node.getChildren()) {
if (!key.equals(child.getKey())) {
continue;
}
if (result == null) {
result = ContainerUtilRt.newArrayList();
}
result.add((DataNode<T>)child);
}
return result == null ? Collections.<DataNode<T>>emptyList() : result;
}
示例2: find
import com.intellij.openapi.externalSystem.model.Key; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Nullable
public static <T> DataNode<T> find(@NotNull DataNode<?> node, @NotNull Key<T> key) {
for (DataNode<?> child : node.getChildren()) {
if (key.equals(child.getKey())) {
return (DataNode<T>)child;
}
}
return null;
}
示例3: findParent
import com.intellij.openapi.externalSystem.model.Key; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Nullable
public static <T> DataNode<T> findParent(@NotNull DataNode<?> node,
@NotNull Key<T> key,
@Nullable BooleanFunction<DataNode<T>> predicate) {
DataNode<?> parent = node.getParent();
if (parent == null) return null;
return key.equals(parent.getKey()) && (predicate == null || predicate.fun((DataNode<T>)parent))
? (DataNode<T>)parent : findParent(parent, key, predicate);
}
示例4: findAll
import com.intellij.openapi.externalSystem.model.Key; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@NotNull
public static <T> Collection<DataNode<T>> findAll(@NotNull DataNode<?> parent, @NotNull Key<T> key) {
Collection<DataNode<T>> result = null;
for (DataNode<?> child : parent.getChildren()) {
if (!key.equals(child.getKey())) {
continue;
}
if (result == null) {
result = ContainerUtilRt.newArrayList();
}
result.add((DataNode<T>)child);
}
return result == null ? Collections.<DataNode<T>>emptyList() : result;
}
示例5: isSameNode
import com.intellij.openapi.externalSystem.model.Key; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public boolean isSameNode(@NotNull DataNode<?> node1, @NotNull DataNode<?> node2, @NotNull Project project) {
Key<?> key = node1.getKey();
if (!key.equals(node2.getKey())) {
return false;
}
EqualityStrategy strategy = myStrategies.get(key);
if (strategy == null) {
return node1.getData().equals(node2.getData());
}
return strategy.isSameData(node1.getData(), node2.getData(), project);
}
示例6: getChildren
import com.intellij.openapi.externalSystem.model.Key; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Nonnull
public static <T> Collection<DataNode<T>> getChildren(@Nonnull DataNode<?> node, @Nonnull Key<T> key) {
Collection<DataNode<T>> result = null;
for (DataNode<?> child : node.getChildren()) {
if (!key.equals(child.getKey())) {
continue;
}
if (result == null) {
result = ContainerUtilRt.newArrayList();
}
result.add((DataNode<T>)child);
}
return result == null ? Collections.<DataNode<T>>emptyList() : result;
}
示例7: find
import com.intellij.openapi.externalSystem.model.Key; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Nullable
public static <T> DataNode<T> find(@Nonnull DataNode<?> node, @Nonnull Key<T> key) {
for (DataNode<?> child : node.getChildren()) {
if (key.equals(child.getKey())) {
return (DataNode<T>)child;
}
}
return null;
}
示例8: findParent
import com.intellij.openapi.externalSystem.model.Key; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Nullable
public static <T> DataNode<T> findParent(@Nonnull DataNode<?> node, @Nonnull Key<T> key, @javax.annotation.Nullable BooleanFunction<DataNode<T>> predicate) {
DataNode<?> parent = node.getParent();
if (parent == null) return null;
return key.equals(parent.getKey()) && (predicate == null || predicate.fun((DataNode<T>)parent)) ? (DataNode<T>)parent : findParent(parent, key, predicate);
}
示例9: findAll
import com.intellij.openapi.externalSystem.model.Key; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Nonnull
public static <T> Collection<DataNode<T>> findAll(@Nonnull DataNode<?> parent, @Nonnull Key<T> key) {
Collection<DataNode<T>> result = null;
for (DataNode<?> child : parent.getChildren()) {
if (!key.equals(child.getKey())) {
continue;
}
if (result == null) {
result = ContainerUtilRt.newArrayList();
}
result.add((DataNode<T>)child);
}
return result == null ? Collections.<DataNode<T>>emptyList() : result;
}