public void removeDDF(DDF ddf) throws DDFException { ddf.getRepresentationHandler().uncacheAll(); ddf.getRepresentationHandler().reset(); mDDFCache.removeDDF(ddf); }
@Test public void testRepresentDDF() throws DDFException { DDFManager manager = DDFManager.get(DDFManager.EngineType.BASIC); DDF ddf = manager.newDDF(); IHandleRepresentations handler = ddf.getRepresentationHandler(); handler.reset(); Assert.assertNull("There should not be any existing representations", handler.get(list.get(0).getClass())); handler.set(list, List.class, String.class); Assert.assertNotNull("There should now be a representation of type <List,String>", handler.get(List.class, String.class)); handler.add(list, List.class, String.class); Assert.assertNotNull("There should now be a representation of type <List,String>", handler.get(List.class, String.class)); handler.remove(List.class, String.class); Assert.assertNull("There should now be no representation of type <List,String>", handler.get(List.class, String.class)); }
@Override public DDF updateInplace(DDF newddf) throws DDFException { //copy content of newddf to this ddf DDF curDDF = this.getDDF(); curDDF.getRepresentationHandler().reset(); curDDF.getRepresentationHandler().setRepresentations(newddf.getRepresentationHandler().getAllRepresentations()); newddf.getMetaDataHandler().copyFactor(this.getDDF()); curDDF.getSchemaHandler().setSchema(newddf.getSchema()); return curDDF; } }