Beispiel #1
0
 public TripleBasedBean(Object o, TripleStore store, TripleFactory factory) {
   super();
   this.store = store;
   this.storeId = store.getId();
   this.object = o;
   this.tripleFactory = factory;
 }
 protected Collection<Triple> getTriplesForSubject(Object subj) {
   Collection<Triple> coll = store.getAll(tripleFactory.newTriple(subj, Variable.v, Variable.v));
   Iterator<Triple> iter = coll.iterator();
   while (iter.hasNext()) {
     if ((iter.next().getProperty()).equals(TripleStore.TYPE)) {
       iter.remove();
     }
   }
   return coll;
 }
 public Object get(Object key) {
   Triple t = store.get(propertyKey(key));
   return t == null ? null : t.getValue();
 }
 public boolean containsKey(Object key) {
   return store.get(propertyKey(key)) != null;
 }
 public void clear() {
   for (Triple t : getTriplesForSubject(getObject())) {
     store.remove(t);
   }
 }
 public Object remove(Object key) {
   return store.remove(store.get(propertyKey(key)));
 }
 public Object put(String key, Object value) {
   return store.put(property(key, value));
 }