@Test public void testSubMemory() { QMemory top = DefaultQMemory.create(); top.setString("a.b.c.d", "hello"); top.setString("a.b.c.e", "goodbye"); top.setString("a.b.c.f", "another"); top.setString("x.b.c.f", "another"); QMemory a = top.subMemory("a"); assertEquals("hello", a.getString("b.c.d")); assertEquals("goodbye", a.getString("b.c.e")); assertEquals("another", a.getString("b.c.f")); assertEquals(new HashSet<String>(Arrays.asList("b.c.d", "b.c.e", "b.c.f")), a.getPaths()); QMemory c = a.subMemory("b.c."); assertEquals("hello", c.getString("d")); assertEquals("goodbye", c.getString("e")); assertEquals("another", c.getString("f")); assertEquals(new HashSet<String>(Arrays.asList("d", "e", "f")), c.getPaths()); }
@Override public QMemory subMemory(String prefix) { return new SubQMemory(this, prefix); }
DefaultQMemory implements QMemory { @Override public QMemory subMemory(String prefix) { return new SubQMemory(this, prefix); } }
DefaultQMemory implements QMemory { @Override public QMemory subMemory(String prefix) { return new SubQMemory(this, prefix); } private  DefaultQMemory(); }
DefaultQMemory implements QMemory { @Override public QMemory subMemory(String prefix) { return new SubQMemory(this, prefix); } private  DefaultQMemory(); static QMemory create(); static QMemory create(Identifier id); synchronized boolean hasPath(String path); synchronized double getDouble(String path); synchronized long getInteger(String path); synchronized String getString(String path); synchronized Set<String> getPaths(); @Override QMemory subMemory(String prefix); synchronized void setDouble(String path, double doubleVal); synchronized void setInteger(String path, int intVal); synchronized void setInteger(String path, long longVal); synchronized void setString(String path, String strVal); synchronized void clear(String path); synchronized void remove(String path); @Override void addListener(QMemoryListener listener); @Override void removeListener(QMemoryListener listener); }
DefaultQMemory implements QMemory { @Override public QMemory subMemory(String prefix) { return new SubQMemory(this, prefix); } private  DefaultQMemory(); static QMemory create(); static QMemory create(Identifier id); synchronized boolean hasPath(String path); synchronized double getDouble(String path); synchronized long getInteger(String path); synchronized String getString(String path); synchronized Set<String> getPaths(); @Override QMemory subMemory(String prefix); synchronized void setDouble(String path, double doubleVal); synchronized void setInteger(String path, int intVal); synchronized void setInteger(String path, long longVal); synchronized void setString(String path, String strVal); synchronized void clear(String path); synchronized void remove(String path); @Override void addListener(QMemoryListener listener); @Override void removeListener(QMemoryListener listener);  }