1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
Description: adding missing override of test in some classes, using the same
definition as in the parent interface in guava-libraries.
It seems there exists another Predicate class in guava-libraries, without the
test method to be overridden...
Author: Pierre Gruet <pgt@debian.org>
Forwarded: not-needed
Last-Update: 2021-11-13
--- a/jung-algorithms/src/main/java/edu/uci/ics/jung/algorithms/util/SelfLoopEdgePredicate.java
+++ b/jung-algorithms/src/main/java/edu/uci/ics/jung/algorithms/util/SelfLoopEdgePredicate.java
@@ -20,4 +20,9 @@
Pair<V> endpoints = context.graph.getEndpoints(context.element);
return endpoints.getFirst().equals(endpoints.getSecond());
}
+
+ @Override
+ public boolean test(Context<Graph<V,E>,E> context) {
+ return apply(context);
+ }
}
--- a/jung-io/src/main/java/edu/uci/ics/jung/io/PajekNetReader.java
+++ b/jung-io/src/main/java/edu/uci/ics/jung/io/PajekNetReader.java
@@ -452,6 +452,11 @@
public boolean apply(String str) {
return (str != null && str.toLowerCase().startsWith(tag));
}
+
+ @Override
+ public boolean test(String str) {
+ return apply(str);
+ }
}
@@ -478,6 +483,12 @@
{
return (s != null && s.toLowerCase().endsWith("list"));
}
+
+ @Override
+ public boolean test(String s)
+ {
+ return apply(s);
+ }
}
/**
--- a/jung-visualization/src/main/java/edu/uci/ics/jung/visualization/RenderContext.java
+++ b/jung-visualization/src/main/java/edu/uci/ics/jung/visualization/RenderContext.java
@@ -179,6 +179,11 @@
public boolean apply(Context<Graph<V,E>,E> c) {
return c.graph.getEdgeType(c.element) == EdgeType.DIRECTED;
}
+
+ @Override
+ public boolean test(Context<Graph<V,E>,E> c) {
+ return apply(c);
+ }
}
@@ -189,6 +194,11 @@
public boolean apply(Context<Graph<V,E>,E> c) {
return c.graph.getEdgeType(c.element) == EdgeType.UNDIRECTED;
}
+
+ @Override
+ public boolean test(Context<Graph<V,E>,E> c) {
+ return apply(c);
+ }
}
@@ -207,4 +217,4 @@
void setPickSupport(GraphElementAccessor<V, E> pickSupport);
-}
\ No newline at end of file
+}
--- a/jung-samples/src/main/java/edu/uci/ics/jung/samples/PluggableRendererDemo.java
+++ b/jung-samples/src/main/java/edu/uci/ics/jung/samples/PluggableRendererDemo.java
@@ -972,6 +972,12 @@
}
return false;
}
+
+ @Override
+ public boolean test(Context<Graph<V,E>,E> context)
+ {
+ return apply(context);
+ }
}
private final static class VertexDisplayPredicate<V,E>
@@ -1000,6 +1006,11 @@
else
return true;
}
+
+ @Override
+ public boolean test(Context<Graph<V,E>,V> context) {
+ return apply(context);
+ }
}
/**
--- a/jung-samples/src/main/java/edu/uci/ics/jung/samples/VertexCollapseDemo.java
+++ b/jung-samples/src/main/java/edu/uci/ics/jung/samples/VertexCollapseDemo.java
@@ -124,6 +124,12 @@
public boolean apply(Object e) {
return exclusions.contains(e);
+ }
+
+ @Override
+ public boolean test(Object e) {
+
+ return apply(e);
}});
--- a/jung-samples/src/main/java/edu/uci/ics/jung/samples/VertexCollapseDemoWithLayouts.java
+++ b/jung-samples/src/main/java/edu/uci/ics/jung/samples/VertexCollapseDemoWithLayouts.java
@@ -144,6 +144,12 @@
public boolean apply(Object e) {
return exclusions.contains(e);
+ }
+
+ @Override
+ public boolean test(Object e) {
+
+ return apply(e);
}});
|