projects
/
sbp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5501b49
)
change Invokable from two arguments to 3
author
adam
<adam@megacz.com>
Mon, 26 Mar 2007 05:37:01 +0000
(
01:37
-0400)
committer
adam
<adam@megacz.com>
Mon, 26 Mar 2007 05:37:01 +0000
(
01:37
-0400)
darcs-hash:
20070326053701
-5007d-
be67355344d42e4a93f85788274e29ed9c3f695c
.gz
src/edu/berkeley/sbp/util/FastSet.java
patch
|
blob
|
history
src/edu/berkeley/sbp/util/Invokable.java
patch
|
blob
|
history
src/edu/berkeley/sbp/util/TopologicalBag.java
patch
|
blob
|
history
src/edu/berkeley/sbp/util/Visitable.java
patch
|
blob
|
history
src/edu/berkeley/sbp/util/VisitableMap.java
patch
|
blob
|
history
diff --git
a/src/edu/berkeley/sbp/util/FastSet.java
b/src/edu/berkeley/sbp/util/FastSet.java
index
711c984
..
88475e2
100644
(file)
--- a/
src/edu/berkeley/sbp/util/FastSet.java
+++ b/
src/edu/berkeley/sbp/util/FastSet.java
@@
-43,10
+43,10
@@
public /*final*/ class FastSet<T> implements Iterator<T>, Iterable<T>, Visitable
if (found) size--;
}
if (found) size--;
}
- public <B,C> void visit(Invokable<T,B,C> ivbc, B b, C c) {
- if (only!=null) ivbc.invoke(only, b, c);
+ public <B> void visit(Invokable<T,B> ivbc, B b) {
+ if (only!=null) ivbc.invoke(only, b);
else for(int j=0; j<size; j++)
else for(int j=0; j<size; j++)
- ivbc.invoke((T)array[j], b, c);
+ ivbc.invoke((T)array[j], b);
}
public int size() { return only==null ? size : 1; }
}
public int size() { return only==null ? size : 1; }
diff --git
a/src/edu/berkeley/sbp/util/Invokable.java
b/src/edu/berkeley/sbp/util/Invokable.java
index
43415e8
..
0d16ea9
100644
(file)
--- a/
src/edu/berkeley/sbp/util/Invokable.java
+++ b/
src/edu/berkeley/sbp/util/Invokable.java
@@
-8,6
+8,6
@@
import java.util.*;
import java.lang.reflect.*;
import java.lang.ref.*;
import java.lang.reflect.*;
import java.lang.ref.*;
-public interface Invokable<A,B,C> {
- public void invoke(A a, B b, C c);
+public interface Invokable<A,B> {
+ public void invoke(A a, B b);
}
}
diff --git
a/src/edu/berkeley/sbp/util/TopologicalBag.java
b/src/edu/berkeley/sbp/util/TopologicalBag.java
index
f7ce6e7
..
eb71cdc
100644
(file)
--- a/
src/edu/berkeley/sbp/util/TopologicalBag.java
+++ b/
src/edu/berkeley/sbp/util/TopologicalBag.java
@@
-103,11
+103,11
@@
public class TopologicalBag<K,V> implements MapBag<Topology<K>,V>, VisitableMap<
private HashMap<K,Iterable<V>> cache = new HashMap<K,Iterable<V>>();
public Iterable<V> getAll(Topology<K> k) { return h.get(k); }
private HashMap<K,Iterable<V>> cache = new HashMap<K,Iterable<V>>();
public Iterable<V> getAll(Topology<K> k) { return h.get(k); }
- public <B,C> void invoke(K k, Invokable<V,B,C> ivbc, B b, C c) {
+ public <B> void invoke(K k, Invokable<V,B> ivbc, B b) {
for(Topology<K> t : h.keySet())
if (t.contains(k))
for(V v : h.get(t))
for(Topology<K> t : h.keySet())
if (t.contains(k))
for(V v : h.get(t))
- ivbc.invoke(v, b, c);
+ ivbc.invoke(v, b);
}
public Iterable<V> get(K k) {
}
public Iterable<V> get(K k) {
@@
-165,13
+165,13
@@
public class TopologicalBag<K,V> implements MapBag<Topology<K>,V>, VisitableMap<
return true;
return false;
}
return true;
return false;
}
- public <B,C> void invoke(K k, Invokable<V,B,C> ivbc, B b, C c) {
+ public <B> void invoke(K k, Invokable<V,B> ivbc, B b) {
int asint = f.invoke(k);
for(int i=0; i<size; i++) {
if (min[i] <= asint && max[i] >= asint) {
Object[] arr = v[i];
for(int j=0; j<arr.length; j++)
int asint = f.invoke(k);
for(int i=0; i<size; i++) {
if (min[i] <= asint && max[i] >= asint) {
Object[] arr = v[i];
for(int j=0; j<arr.length; j++)
- ivbc.invoke((V)arr[j], b, c);
+ ivbc.invoke((V)arr[j], b);
}
}
}
}
}
}
diff --git
a/src/edu/berkeley/sbp/util/Visitable.java
b/src/edu/berkeley/sbp/util/Visitable.java
index
017cab7
..
911e1b9
100644
(file)
--- a/
src/edu/berkeley/sbp/util/Visitable.java
+++ b/
src/edu/berkeley/sbp/util/Visitable.java
@@
-5,6
+5,6
@@
import java.util.*;
public interface Visitable<V> {
public interface Visitable<V> {
- public <B,C> void visit(Invokable<V,B,C> ivbc, B b, C c);
+ public <B> void visit(Invokable<V,B> ivbc, B b);
}
}
diff --git
a/src/edu/berkeley/sbp/util/VisitableMap.java
b/src/edu/berkeley/sbp/util/VisitableMap.java
index
8ede7f4
..
314f55e
100644
(file)
--- a/
src/edu/berkeley/sbp/util/VisitableMap.java
+++ b/
src/edu/berkeley/sbp/util/VisitableMap.java
@@
-7,7
+7,7
@@
import java.util.*;
public interface VisitableMap<K,V> {
/** invokes <tt>ivbc</tt> on each element of this map, passing constant arguments <tt>b</tt> and <tt>c</tt> */
public interface VisitableMap<K,V> {
/** invokes <tt>ivbc</tt> on each element of this map, passing constant arguments <tt>b</tt> and <tt>c</tt> */
- public <B,C> void invoke(K k, Invokable<V,B,C> ivbc, B b, C c);
+ public <B> void invoke(K k, Invokable<V,B> ivbc, B b);
/** returns true iff this map contains some value <tt>v</tt> for key <tt>k</tt> */
public boolean contains(K k);
/** returns true iff this map contains some value <tt>v</tt> for key <tt>k</tt> */
public boolean contains(K k);