// (c): Matti J. Katila package org.fenfire.util; import org.fenfire.*; import org.fenfire.swamp.*; import org.fenfire.vocab.RDF; import org.fenfire.vocab.lava.LIST; /** Simple list implementation. * * (Given object will be the List) --next--> first item --next --> second item ... */ public class RDFList { private final Object list; private Fen fen; /** Give an object and it will be a list. */ public RDFList(Fen fen, Object theListObj) { this.fen = fen; this.list = theListObj; fen.graph.add(list, RDF.type, LIST.Instance); } public Object get(int index) { if (index < 0 || index >= length() ) throw new Error("Index: "+index+" out of list's length"); Object obj = list; for (int i=-1; i