MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / Namer

Class Namer

src/main/java/fieldbox/boxes/plugins/Pseudo.java:195–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193 }
194
195 static public class Namer implements AsMap, HandlesCompletion {
196
197 protected final Box on;
198
199 public Namer(Box on) {
200 this.on = on;
201 }
202
203 @Override
204 public boolean asMap_isProperty(String s) {
205 return true;
206 }
207
208 @Override
209 public Object asMap_call(Object o, Object o1) {
210 return asMap_getElement(o1);
211 }
212
213 @Override
214 public Object asMap_getElement(Object element) {
215 return asMap_get(element + "");
216 }
217
218 @Override
219 public Object asMap_setElement(int element, Object o) {
220 return null;
221 }
222
223 @Override
224 public Object asMap_get(String p) {
225 return on.breadthFirst(on.downwards())
226 .filter(x -> x.properties.has(Box.name))
227 .filter(x -> x.properties.get(Box.name)
228 .matches(p))
229 .collect(Collectors.toList());
230 }
231
232 @Override
233 public Object asMap_set(String p, Object val) {
234 return null;
235 }
236
237
238 @Override
239 public Object asMap_new(Object a) {
240 return null;
241 }
242
243 @Override
244 public Object asMap_new(Object a, Object b) {
245 return null;
246 }
247
248 @Override
249 public Object asMap_getElement(int element) {
250 return asMap_get("" + element);
251 }
252

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected