1 6 package com.hp.hpl.jena.mem; 7 8 import com.hp.hpl.jena.graph.impl.GraphBase; 9 import com.hp.hpl.jena.shared.ReificationStyle; 10 11 22 public abstract class GraphMemBase extends GraphBase 23 { 24 27 protected int count; 28 29 32 public GraphMemBase( ReificationStyle style ) 33 { 34 super( style ); 35 count = 1; 36 } 37 38 42 public GraphMemBase openAgain() 43 { 44 count += 1; 45 return this; 46 } 47 48 52 protected abstract void destroy(); 53 54 58 public void close() 59 { 60 if (--count == 0) 61 { 62 destroy(); 63 super.close(); 64 } 65 } 66 } 67 68 69 | Popular Tags |