35 |
* overlaps with the given one. |
* overlaps with the given one. |
36 |
* VERY INEFFICIENT. |
* VERY INEFFICIENT. |
37 |
*/ |
*/ |
38 |
public class EnfiladeOverlapIndex implements Indexer, Index { |
public class EnfiladeOverlapIndex implements Index { |
39 |
|
|
40 |
private HashMap map = new HashMap(); |
private HashMap map; |
41 |
public void set(Object entryName, Object value) { |
public Map getContents() { |
42 |
|
return Collections.con |
43 |
|
} |
44 |
|
|
45 |
|
public EnfiladeOverlapIndex() { |
46 |
|
clear(); |
47 |
|
} |
48 |
|
public void clear() { |
49 |
|
map = new HashMap(); |
50 |
|
} |
51 |
|
|
52 |
|
public void set(int dir, Object entryName, Object value) { |
53 |
if(value == null) { |
if(value == null) { |
54 |
map.remove(entryName); |
map.remove(entryName); |
55 |
return; |
return; |
57 |
if(!(value instanceof Enfilade1DImpl)) return; |
if(!(value instanceof Enfilade1DImpl)) return; |
58 |
map.put(entryName, value); |
map.put(entryName, value); |
59 |
} |
} |
60 |
|
|
61 |
public Collection getMatches(Object o) { |
public Collection getMatches(Object o) { |
62 |
Set s = map.entrySet(); |
Set s = map.entrySet(); |
63 |
List ret = new ArrayList(); |
List ret = new ArrayList(); |