public IntegerTopology(Functor<V,Integer> f, int a) { this(f, a, a); }
public IntegerTopology(Functor<V,Integer> f, int a, int b) { this(f, new Range(a, b)); }
public IntegerTopology(Functor<V,Integer> f, Range r) { this(f, new Range.Set(r)); }
- public IntegerTopology(Functor<V,Integer> f, Range.Set rs) { this.rs = rs; this.f = f; }
-
+ public IntegerTopology(Functor<V,Integer> f, Range.Set rs) {
+ this.rs = rs;
+ this.f = f==null?(this instanceof Functor ? (Functor)this : null):f;
+ }
+
public Topology<V> empty() { return new IntegerTopology<V>(f); }
public boolean contains(V v) { return rs.contains(toInt(v)); }