| 103 | } |
| 104 | |
| 105 | private boolean prefers(Object hierarchy, Object x, Object y) { |
| 106 | IPersistentSet xprefs = (IPersistentSet) getPreferTable().valAt(x); |
| 107 | if(xprefs != null && xprefs.contains(y)) |
| 108 | return true; |
| 109 | for(ISeq ps = RT.seq(parents.invoke(hierarchy, y)); ps != null; ps = ps.next()) |
| 110 | { |
| 111 | if(prefers(hierarchy, x, ps.first())) |
| 112 | return true; |
| 113 | } |
| 114 | for(ISeq ps = RT.seq(parents.invoke(hierarchy, x)); ps != null; ps = ps.next()) |
| 115 | { |
| 116 | if(prefers(hierarchy, ps.first(), y)) |
| 117 | return true; |
| 118 | } |
| 119 | return false; |
| 120 | } |
| 121 | |
| 122 | private boolean isA(Object hierarchy, Object x, Object y) { |
| 123 | return RT.booleanCast(isa.invoke(hierarchy, x, y)); |