Preferences putDouble - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Preferences putDouble method.

This code example shows how to use the following methods:putDouble
This code example shows how to use the following methods:getDouble, getInt, putDouble, putInt
      XMLStore store = XMLStore.createFromFile(storeFile, store1);
      PreferencesExt prefs = store.getPreferences();
      prefs.exportSubtree( System.out);
 
      Preferences node = prefs.node("/myApp");
      int ival  = node.getInt("extraOne", 0);
      assert ival == 1 : "testChain fail 1 " + ival;
 
      ival  = node.getInt("extraTwo", 0);
      assert ival == 2 : "testChain fail 1 " + ival;
 
      double dval  = node.getDouble("TestDouble", 0.0);
      assert closeD(dval, 3.14159) : "testChain fail 2 " + dval;
 
      node.putDouble("TestDouble", 3.14159);
      node.putDouble("TestFloat", -999.0);
      node.putInt("extraTwo", 2);
      //prefs.exportSubtree( System.out); 
      store.save();
 

6
CodeRank
This code example shows how to use the following methods:put, putBoolean, putByteArray, putDouble, putFloat
      barr[1] = 2;
      barr[2] = 3;
      prefs.putByteArray("testBA", barr);
 
      Preferences subnode = prefs.node("SemperUbi");
      subnode.putDouble("testD", 3.14158);
      subnode.putFloat("testF", 1.23457F);
      subnode.putLong("testL", 12345678901L);
      subnode.putInt("testI", 123456780);
      subnode.put("testS", "youdBeLivebyNow");
      subnode.putBoolean("testB", false);
 
      byte[] barr2 = new byte[3];
      barr2[0] = 2;
      barr2[1] = 3;
      barr2[2] = 4;
      subnode.putByteArray("testBA", barr2);
 
      store.save();
    } catch (Exception e) {

6
CodeRank
This code example shows how to use the following methods:getDouble, getInt, putDouble, putInt
      XMLStore store = XMLStore.createFromFile(storeFile, store1);
      PreferencesExt prefs = store.getPreferences();
      prefs.exportSubtree( System.out);
 
      Preferences node = prefs.node("/myApp");
      int ival  = node.getInt("extraOne", 0);
      assert ival == 1 : "testChain fail 1 " + ival;
 
      ival  = node.getInt("extraTwo", 0);
      assert ival == 2 : "testChain fail 1 " + ival;
 
      double dval  = node.getDouble("TestDouble", 0.0);
      assert Misc.closeEnough(dval, 3.14159) : "testChain fail 2 " + dval;
 
      node.putDouble("TestDouble", 3.14159);
      node.putDouble("TestFloat", -999.0);
      node.putInt("extraTwo", 2);
      //prefs.exportSubtree( System.out); 
      store.save();
 

6
CodeRank
This code example shows how to use the following methods:putDouble, putInt
     * @param format {@code PageFormat} to save 
     */ 
    public static void savePageFormat(final DynamicJasperReport report, final PageFormat format) {
        Preferences p = report.getPreferences();
 
        p.putInt(ORIENTATION, format.getOrientation());
 
        Paper paper = format.getPaper();
 
        p.putDouble(HEIGHT, paper.getHeight());
        p.putDouble(WIDTH, paper.getWidth());
 
        p.putDouble(IMAGEABLE_HEIGHT, paper.getImageableHeight());
        p.putDouble(IMAGEABLE_WIDTH, paper.getImageableWidth());
        p.putDouble(IMAGEABLE_X, paper.getImageableX());
        p.putDouble(IMAGEABLE_Y, paper.getImageableY());
    } 
 
    public static PageFormat getPageFormat(final DynamicJasperReport report) {
        Preferences p = report.getPreferences();
 
6
CodeRank
This code example shows how to use the following methods:put, putBoolean, putByteArray, putDouble, putFloat
      barr[1] = 2;
      barr[2] = 3;
      prefs.putByteArray("testBA", barr);
 
      Preferences subnode = prefs.node("SemperUbi");
      subnode.putDouble("testD", 3.14158);
      subnode.putFloat("testF", 1.23457F);
      subnode.putLong("testL", 12345678901L);
      subnode.putInt("testI", 123456780);
      subnode.put("testS", "youdBeLivebyNow");
      subnode.putBoolean("testB", false);
 
      byte[] barr2 = new byte[3];
      barr2[0] = 2;
      barr2[1] = 3;
      barr2[2] = 4;
      subnode.putByteArray("testBA", barr2);
 
      store.save();
    } catch (Exception e) {

6
CodeRank
This code example shows how to use the following methods:putDouble, putInt
m_program = opt.get("program", null);
        m_gtpFile = opt.get("gtpfile", "");
        m_gtpCommand = opt.get("command", "");
        if (opt.contains("komi"))
            m_prefs.putDouble("komi", opt.getDouble("komi"));
        m_lookAndFeel = opt.get("laf", null);
        m_move = opt.getInteger("move", -1);
        if (opt.contains("size"))
            m_prefs.putInt("boardsize", opt.getInteger("size"));
        m_time = opt.get("time", null);
        m_verbose = opt.contains("verbose");
        ArrayList<String> arguments = opt.getArguments();
        m_file = null;
        if (arguments.size() == 1)
            m_file = new File(arguments.get(0));
        else if (arguments.size() > 1)
            throw new ErrorMessage("Only one argument allowed"); 
        validate(); 
    } 
5
CodeRank
This code example shows how to use the following methods:putDouble, putInt
		prefs.put("displayFontName", "helvetica");
 
		// Toss in a couple more values for the curious who want to look 
		// at how Preferences values are actually stored. 
		Preferences child = prefs.node("/a/b");
		child.putInt("meaning", 42);
		child.putDouble("pi", Math.PI);
 
		prefs.exportSubtree(System.out);
	} 
} 
5
CodeRank
This code example shows how to use the following methods:putDouble, putInt
		prefs.put("displayFontName", "helvetica");
 
		// Toss in a couple more values for the curious who want to look 
		// at how Preferences values are actually stored. 
		Preferences child = prefs.node("a/b");
		child.putInt("meaning", 42);
		child.putDouble("pi", Math.PI);
 
		// And dump the subtree from our first node on down, in XML. 
		prefs.exportSubtree(System.out);
	} 
} 
// END main 
4
CodeRank
This code example shows how to use the following methods:putDouble
		preferences.putDouble("start_lat",  lat);
		preferences.putDouble("start_lon",  lon);
	} 
	 
	public void saveEndLocation(double lat, double lon){
		preferences.putDouble("end_lat",  lat);
		preferences.putDouble("end_lon",  lon);
	} 
	 
	public MapZooms getMapZooms(){ 
		String value = preferences.get("map_zooms", MapZooms.MAP_ZOOMS_DEFAULT);
		return MapZooms.parseZooms(value);
	} 
	 
	public String getMapZoomsValue(){
		return preferences.get("map_zooms", MapZooms.MAP_ZOOMS_DEFAULT);
	} 
	 
	public void setMapZooms(String zooms){
		// check string 
4
CodeRank
putDouble Method Overview
Associates a string representing the specified double value with the specified key in this preference node.
See Code Examples for other Java 8 Preferences Methods: