| 39 | } |
| 40 | |
| 41 | static public <T> T findFrom(Box b, Dict.Prop<T> what) { |
| 42 | Optional<Box> o = b.breadthFirst(b.upwards()) |
| 43 | .filter(x -> x.properties.has(what) && x.properties.get(what) != null) |
| 44 | .findFirst(); |
| 45 | |
| 46 | |
| 47 | if (!o.isPresent()) { |
| 48 | // record missing, and do something about it? |
| 49 | return null; |
| 50 | } |
| 51 | |
| 52 | |
| 53 | T r = o.get().properties.get(what); |
| 54 | |
| 55 | |
| 56 | recordGet(b, what, o.get(), r); |
| 57 | |
| 58 | return r; |
| 59 | } |
| 60 | |
| 61 | static public <T> T findFrom(Box b, Dict.Prop<T> what, Set<Box> ignore) { |
| 62 | Optional<Box> o = b.breadthFirst(x -> { |