Package java.util.prefs

Examples of java.util.prefs.Preferences.parent()


        pref.node("child2");
        pref.node("child3");
        child1.node("subchild1");

        assertSame(pref, child1.parent());
        assertEquals(3, pref.childrenNames().length);
    }

    public void testClear() throws BackingStoreException {
        pref.put("testClearKey", "testClearValue");
View Full Code Here


    public void testUserRoot() throws BackingStoreException {
        Preferences p = Preferences.userRoot();
        assertTrue(p instanceof AbstractPreferences);
        assertEquals("/", p.absolutePath());
        assertSame(null, p.parent());
        assertTrue(p.isUserNode());
        assertEquals("", p.name());
        assertEquals("User Preference Node: " + p.absolutePath(), p.toString());
    }
View Full Code Here

    public void testSystemRoot() throws BackingStoreException {
        Preferences p = Preferences.systemRoot();
        assertTrue(p instanceof AbstractPreferences);
        assertEquals("/", p.absolutePath());
        assertSame(null, p.parent());
        assertFalse(p.isUserNode());
        assertEquals("", p.name());
        assertEquals("System Preference Node: " + p.absolutePath(), p
                .toString());
    }
View Full Code Here

        pref.node("child2");
    pref.node("child3");
    child1.node("subchild1");

        assertSame(pref, child1.parent());
    assertEquals(3, pref.childrenNames().length);
  }

  public void testClear() throws BackingStoreException {
    pref.put("testClearKey", "testClearValue");
View Full Code Here

  public void testSystemRoot() throws BackingStoreException {
    Preferences p = Preferences.systemRoot();
    assertTrue(p instanceof AbstractPreferences);
    assertEquals("/", p.absolutePath());
    assertSame(null, p.parent());
    assertFalse(p.isUserNode());
    assertEquals("", p.name());
    assertEquals("System Preference Node: " + p.absolutePath(), p
        .toString());
    // assertEquals(0, p.childrenNames().length);
View Full Code Here

  public void testUserRoot() throws BackingStoreException {
    Preferences p = Preferences.userRoot();
    assertTrue(p instanceof AbstractPreferences);
    assertEquals("/", p.absolutePath());
    assertSame(null, p.parent());
    assertTrue(p.isUserNode());
    assertEquals("", p.name());
    assertEquals("User Preference Node: " + p.absolutePath(), p.toString());
    // assertEquals(0, p.childrenNames().length);
    // assertEquals(p.keys().length, 0);
View Full Code Here

    p.node(null);
    try {
      p.nodeExists(null);
    } catch (BackingStoreException e1) {
    }
    p.parent();
    p.put(null, null);
    p.putBoolean(null, false);
    p.putByteArray(null, null);
    p.putDouble(null, 1);
    p.putFloat(null, 1f);
View Full Code Here

        List list = new ArrayList();
        Preferences preferences = prefs;
        while ((preferences.parent() != null) && (preferences.parent().parent() != null))
        {
            list.add(preferences.absolutePath());
            preferences = preferences.parent();
        }
        return (String[]) list.toArray(new String[0]);
    }

}
View Full Code Here

    {
        ArgUtil.notNull(new Object[] { prefs }, new String[] { "preferences" }, "resolve(java.util.prefs.Preferences)");

        List list = new ArrayList();
        Preferences preferences = prefs;
        while ((preferences.parent() != null) && (preferences.parent().parent() != null))
        {
            list.add(preferences.absolutePath());
            preferences = preferences.parent();
        }
        return (String[]) list.toArray(new String[0]);
View Full Code Here

    {
        ArgUtil.notNull(new Object[] { prefs }, new String[] { "preferences" }, "resolve(java.util.prefs.Preferences)");

        List list = new ArrayList();
        Preferences preferences = prefs;
        while ((preferences.parent() != null) && (preferences.parent().parent() != null))
        {
            list.add(preferences.absolutePath());
            preferences = preferences.parent();
        }
        return (String[]) list.toArray(new String[0]);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.