public IokeObject newMacro(String doc, IokeObject tp, IokeData impl) throws ControlFlow { IokeObject obj = tp.allocateCopy(null, null); obj.setDocumentation(doc, null, null); obj.mimicsWithoutCheck(tp); obj.setData(impl); return obj; }
public IokeObject newRegexp(String pattern, String flags, IokeObject context, IokeObject message) throws ControlFlow { IokeObject obj = this.regexp.allocateCopy(null, null); obj.mimicsWithoutCheck(this.regexp); obj.setData(Regexp.create(pattern, flags, context, message)); return obj; }
public IokeObject newCallFrom( IokeObject ctx, IokeObject message, IokeObject surroundingContext, IokeObject on) { IokeObject obj = this.call.allocateCopy(null, null); obj.mimicsWithoutCheck(this.call); obj.setData(new Call(ctx, message, surroundingContext, on)); return obj; }
public IokeObject newNumber(RatNum number) { if (number instanceof IntNum) { return newNumber((IntNum) number); } else { IokeObject obj = this.ratio.allocateCopy(null, null); obj.mimicsWithoutCheck(this.ratio); obj.setData(Number.ratio((IntFraction) number)); return obj; } }
public IokeObject newFile(IokeObject context, File eff) throws ControlFlow { IokeObject fileMimic = IokeObject.as( ((Message) IokeObject.data(FileMessage)).sendTo(FileMessage, context, this.fileSystem), context); IokeObject obj = fileMimic.allocateCopy(null, null); obj.mimicsWithoutCheck(fileMimic); obj.setData(new FileSystem.IokeFile(eff)); return obj; }
public IokeObject createIntegratedJavaWrapper(Class clz) { IokeObject obj = this.javaWrapper.allocateCopy(null, null); obj.mimicsWithoutCheck(registry.wrap(Class.class)); obj.mimicsWithoutCheck(registry.wrap(clz.getSuperclass())); for (Class<?> i : clz.getInterfaces()) { obj.mimicsWithoutCheck(registry.wrap(i)); } obj.setData(JavaIntegrationWrapper.wrapWithMethods(clz, obj, this)); return obj; }
public IokeObject newNumber(IntNum number) { IokeObject obj = null; obj = numCache.get(number); if (obj == null) { obj = this.integer.allocateCopy(null, null); obj.mimicsWithoutCheck(this.integer); obj.setData(Number.integer(number)); numCache.put(number, obj); } return obj; }
public IokeObject createJavaWrapper(Object object) { if (object instanceof Class) { if (object == Object.class) { IokeObject obj = this.javaWrapper.allocateCopy(null, null); obj.mimicsWithoutCheck(this.javaWrapper); obj.setData(JavaWrapper.wrapWithMethods((Class) object, obj, this)); return obj; } else if (object == Class.class) { IokeObject obj = this.javaWrapper.allocateCopy(null, null); Class<?> clz = (Class) object; IokeObject objWrap = registry.wrap(clz.getSuperclass()); obj.mimicsWithoutCheck(objWrap); obj.setData(JavaWrapper.wrapWithMethods(clz, obj, this)); objWrap.mimicsWithoutCheck(0, obj); // circularity - warning! =) return obj; } else { IokeObject obj = this.javaWrapper.allocateCopy(null, null); Class<?> clz = (Class) object; if (((Class) object).isArray()) { obj.mimicsWithoutCheck(javaArray); } obj.mimicsWithoutCheck(registry.wrap(Class.class)); obj.mimicsWithoutCheck(registry.wrap(clz.getSuperclass())); for (Class<?> i : clz.getInterfaces()) { obj.mimicsWithoutCheck(registry.wrap(i)); } obj.setData(JavaWrapper.wrapWithMethods(clz, obj, this)); return obj; } } else { IokeObject obj = this.javaWrapper.allocateCopy(null, null); obj.mimicsWithoutCheck(registry.wrap(object.getClass())); obj.setData(new JavaWrapper(object)); return obj; } }
public IokeObject newRange(IokeObject from, IokeObject to, boolean inclusive, boolean inverted) { IokeObject obj = this.range.allocateCopy(null, null); obj.mimicsWithoutCheck(this.range); obj.setData(new Range(from, to, inclusive, inverted)); return obj; }
public IokeObject newDateTime(org.joda.time.DateTime dt) { IokeObject obj = this.dateTime.allocateCopy(null, null); obj.mimicsWithoutCheck(this.dateTime); obj.setData(new DateTime(dt)); return obj; }
public IokeObject newList(List<Object> list, IokeObject orig) { IokeObject obj = orig.allocateCopy(null, null); obj.mimicsWithoutCheck(orig); obj.setData(new IokeList(list)); return obj; }
public IokeObject newList(List<Object> list) { IokeObject obj = this.list.allocateCopy(null, null); obj.mimicsWithoutCheck(this.list); obj.setData(new IokeList(list)); return obj; }
public IokeObject newSet(Collection<Object> objs) { IokeObject obj = this.set.allocateCopy(null, null); obj.mimicsWithoutCheck(this.set); obj.setData(new IokeSet(new HashSet<Object>(objs))); return obj; }
public IokeObject newDict(Map<Object, Object> map) { IokeObject obj = dict.allocateCopy(null, null); obj.mimicsWithoutCheck(dict); obj.setData(new Dict(map)); return obj; }
public IokeObject createMessage(Message m) { IokeObject obj = this.message.allocateCopy(null, null); obj.mimicsWithoutCheck(this.message); obj.setData(m); return obj; }
public IokeObject newText(String text) { IokeObject obj = this.text.allocateCopy(null, null); obj.mimicsWithoutCheck(this.text); obj.setData(new Text(text)); return obj; }
public IokeObject newPair(Object first, Object second) { IokeObject obj = this.pair.allocateCopy(null, null); obj.mimicsWithoutCheck(this.pair); obj.setData(new Pair(first, second)); return obj; }
public IokeObject newDecimal(BigDecimal number) throws ControlFlow { IokeObject obj = this.decimal.allocateCopy(null, null); obj.mimicsWithoutCheck(this.decimal); obj.setData(Decimal.decimal(number)); return obj; }