public IList getProfileData() { IValueFactory VF = ValueFactoryFactory.getValueFactory(); IListWriter w = VF.listWriter(); for (Map.Entry<ISourceLocation, Count> e : sortData(ast)) { w.insert(VF.tuple(e.getKey(), VF.integer(e.getValue().getTicks()))); } return w.done(); }
public static IList closureStar(IList rel1) { Type resultType = rel1.getType().closure(); // an exception will have been thrown if the type is not acceptable IListWriter reflex = List.createListWriter(resultType.getElementType()); for (IValue e : carrier(rel1)) { reflex.insert(Tuple.newTuple(new IValue[] {e, e})); } return closure(rel1).concat(reflex.done()); }
public void insert(IListWriter listW, IValue message) { if (message.getType().isConstructor() && message.getType().getAbstractDataType().getName().equals("Message")) { listW.insert(message); } }