1 7 package com.hp.hpl.jena.rdf.arp; 8 9 13 class RDFCollection extends CollectionAction { 14 15 16 17 static URIReference first = null; 18 static URIReference rest = null; 19 static URIReference nil = null; 20 21 RDFCollection(ParserSupport x){ 22 super(x); 23 } 24 RDFCollection(ParserSupport x, AResourceInternal r[]){ 25 super(x); 26 rslt = r; 27 } 28 private AResourceInternal rslt[]; 29 static { 30 try { 31 nil = new URIReference(XMLHandler.rdfns+"nil"); 32 33 first = new URIReference(XMLHandler.rdfns+"first"); 34 rest = new URIReference(XMLHandler.rdfns+"rest"); 35 } 36 catch (MalformedURIException e) { 37 System.err.println("Internal error: " + e.toString()); 38 e.printStackTrace(); 39 } 40 } 41 44 void terminate() { 45 rslt[0] = nil; 46 } 47 public void cleanUp() { 48 if (rslt[0]!=null) { 49 X.arp.endLocalScope(rslt[0]); 50 rslt[0] = null; 51 } 52 } 53 56 CollectionAction next(AResourceInternal head) { 57 ARPResource cell= new ARPResource(X.arp); 58 try { 59 cell.setPredicateObject( first,head, null ); 60 } 61 finally { 62 X.arp.endLocalScope(head); 63 rslt[0] = cell; 64 } 65 68 return new RDFTailCollection(X,cell); 69 70 } 71 72 } 73 74 | Popular Tags |