Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.IPreference


   * @see org.rssowl.core.model.preferences.IPreferencesNode#getBoolean(java.lang.String)
   */
  public boolean getBoolean(String key) {
    synchronized (fCache) {
      /* Consult Cache */
      IPreference cachedPref = fCache.get(key);
      if (cachedPref != null && cachedPref.getBoolean() != null)
        return cachedPref.getBoolean();
      /* Consult the Persistence Layer */
      IPreference pref = load(key);
      if (pref != null && pref.getBoolean() != null) {
        fCache.put(key, pref);
        return pref.getBoolean();
      }
      /* Ask Parent */
      boolean parentValue = fParent.getBoolean(key);
      /* Cache value from parent */
      pref = Owl.getModelFactory().createPreference(key);
      pref.putBooleans(parentValue);
      fCache.put(key, pref);
      return parentValue;
    }
  }
View Full Code Here


   * @see org.rssowl.core.model.preferences.IPreferencesNode#getInteger(java.lang.String)
   */
  public int getInteger(String key) {
    synchronized (fCache) {
      /* Consult Cache */
      IPreference cachedPref = fCache.get(key);
      if (cachedPref != null && cachedPref.getInteger() != null)
        return cachedPref.getInteger();
      /* Consult the Persistence Layer */
      IPreference pref = load(key);
      if (pref != null && pref.getInteger() != null) {
        fCache.put(key, pref);
        return pref.getInteger();
      }
      /* Ask Parent */
      int parentValue = fParent.getInteger(key);
      /* Cache value from parent */
      pref = Owl.getModelFactory().createPreference(key);
      pref.putIntegers(parentValue);
      fCache.put(key, pref);
      return parentValue;
    }
  }
View Full Code Here

   * @see org.rssowl.core.model.preferences.IPreferencesNode#getIntegers(java.lang.String)
   */
  public int[] getIntegers(String key) {
    synchronized (fCache) {
      /* Consult Cache */
      IPreference cachedPref = fCache.get(key);
      if (cachedPref != null && cachedPref.getIntegers() != null)
        return cachedPref.getIntegers();
      /* Consult the Persistence Layer */
      IPreference pref = load(key);
      if (pref != null && pref.getIntegers() != null) {
        fCache.put(key, pref);
        return pref.getIntegers();
      }
      /* Ask Parent */
      int[] parentValue = fParent.getIntegers(key);
      /* Cache value from parent */
      if (parentValue != null) {
        pref = Owl.getModelFactory().createPreference(key);
        pref.putIntegers(parentValue);
        fCache.put(key, pref);
      }
      return parentValue;
    }
  }
View Full Code Here

   * @see org.rssowl.core.model.preferences.IPreferencesNode#getLong(java.lang.String)
   */
  public long getLong(String key) {
    synchronized (fCache) {
      /* Consult Cache */
      IPreference cachedPref = fCache.get(key);
      if (cachedPref != null && cachedPref.getLong() != null)
        return cachedPref.getLong();
      /* Consult the Persistence Layer */
      IPreference pref = load(key);
      if (pref != null && pref.getLong() != null) {
        fCache.put(key, pref);
        return pref.getLong();
      }
      /* Ask Parent */
      long parentValue = fParent.getLong(key);
      /* Cache value from parent */
      pref = Owl.getModelFactory().createPreference(key);
      pref.putLongs(parentValue);
      fCache.put(key, pref);
      return parentValue;
    }
  }
View Full Code Here

   * @see org.rssowl.core.model.preferences.IPreferencesNode#getLongs(java.lang.String)
   */
  public long[] getLongs(String key) {
    synchronized (fCache) {
      /* Consult Cache */
      IPreference cachedPref = fCache.get(key);
      if (cachedPref != null && cachedPref.getLongs() != null)
        return cachedPref.getLongs();
      /* Consult the Persistence Layer */
      IPreference pref = load(key);
      if (pref != null && pref.getLongs() != null) {
        fCache.put(key, pref);
        return pref.getLongs();
      }
      /* Ask Parent */
      long[] parentValue = fParent.getLongs(key);
      /* Cache value from parent */
      if (parentValue != null) {
        pref = Owl.getModelFactory().createPreference(key);
        pref.putLongs(parentValue);
        fCache.put(key, pref);
      }
      return parentValue;
    }
  }
View Full Code Here

   * @see org.rssowl.core.model.preferences.IPreferencesNode#getString(java.lang.String)
   */
  public String getString(String key) {
    synchronized (fCache) {
      /* Consult Cache */
      IPreference cachedPref = fCache.get(key);
      if (cachedPref != null && cachedPref.getString() != null)
        return cachedPref.getString();
      /* Consult the Persistence Layer */
      IPreference pref = load(key);
      if (pref != null && pref.getString() != null) {
        fCache.put(key, pref);
        return pref.getString();
      }
      /* Ask Parent */
      String parentValue = fParent.getString(key);
      /* Cache value from parent */
      if (parentValue != null) {
        pref = Owl.getModelFactory().createPreference(key);
        pref.putStrings(parentValue);
        fCache.put(key, pref);
      }
      return parentValue;
    }
  }
View Full Code Here

   * @see org.rssowl.core.model.preferences.IPreferencesNode#getStrings(java.lang.String)
   */
  public String[] getStrings(String key) {
    synchronized (fCache) {
      /* Consult Cache */
      IPreference cachedPref = fCache.get(key);
      if (cachedPref != null && cachedPref.getStrings() != null)
        return cachedPref.getStrings();
      /* Consult the Persistence Layer */
      IPreference pref = load(key);
      if (pref != null && pref.getStrings() != null) {
        fCache.put(key, pref);
        return pref.getStrings();
      }
      /* Ask Parent */
      String[] parentValue = fParent.getStrings(key);
      /* Cache value from parent */
      if (parentValue != null) {
        pref = Owl.getModelFactory().createPreference(key);
        pref.putStrings(parentValue);
        fCache.put(key, pref);
      }
      return parentValue;
    }
  }
View Full Code Here

      delete(key);
      return;
    }

    /* Save to DB */
    IPreference pref = fPreferenceDAO.loadOrCreate(key);
    pref.putBooleans(value);
    fPreferenceDAO.save(pref);
  }
View Full Code Here

      delete(key);
      return;
    }

    /* Save to DB */
    IPreference pref = fPreferenceDAO.loadOrCreate(key);
    pref.putIntegers(value);
    fPreferenceDAO.save(pref);
  }
View Full Code Here

      delete(key);
      return;
    }

    /* Save to DB */
    IPreference pref = fPreferenceDAO.loadOrCreate(key);
    pref.putIntegers(values);
    fPreferenceDAO.save(pref);
  }
View Full Code Here

TOP

Related Classes of org.rssowl.core.persist.IPreference

Copyright © 2018 www.massapicom. 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.