1 7 package com.hp.hpl.jena.rdf.arp; 8 9 13 class DAMLTailCollection extends DAMLCollection { 14 DAMLTailCollection(ParserSupport x,ARPResource cell) { 15 super(x); 16 last = cell; 17 f = cell; 18 } 19 ARPResource last; 20 final ARPResource f; 21 private void endLastScope() { 22 if (last!=f) 23 X.arp.endLocalScope(last); 24 } 25 void terminate() { 26 last.setPredicateObject(rest, nil, null); 27 endLastScope(); 28 } 29 public void cleanUp() { 30 endLastScope(); 31 } 32 33 36 CollectionAction next(AResourceInternal head) { 37 ARPResource cell = new ARPResource(X.arp); 38 try { 39 last.setPredicateObject(rest, cell, null); 40 cell.setPredicateObject(first, head, null); 41 cell.setType(List); 42 } 43 finally { 44 X.arp.endLocalScope(head); 45 endLastScope(); 46 last = cell; 47 } 48 return this; 49 } 50 } 51 52 | Popular Tags |