OSDN Git Service

8fb034c83b1cb371d229959848ef41fae3d50696
[mikumikustudio/MikuMikuStudio.git] / junit / com / jme / util / export / binary / Bar.java
1 package com.jme.util.export.binary;
2
3 import java.io.IOException;
4 import java.util.logging.Level;
5 import java.util.logging.Logger;
6
7 import com.jme.util.export.JMEExporter;
8 import com.jme.util.export.JMEImporter;
9 import com.jme.util.export.Savable;
10
11 public class Bar implements Savable {
12     private static final Logger logger = Logger.getLogger(Bar.class.getName());
13
14     public float f = 0;
15     public float g = 0;
16     
17     public Bar() {
18         
19     }
20     
21     public void write(JMEExporter e) {
22         try {
23             e.getCapsule(this).write(f, "f", 0);
24             e.getCapsule(this).write(g, "g", 0);
25         } catch (IOException e1) {
26             logger.logp(Level.SEVERE, this.getClass().toString(), "write(JMEExporter e)", "Exception", e1);
27         }
28     }
29
30     public void read(JMEImporter e) {
31         try {
32             f = e.getCapsule(this).readFloat("f", 0);
33             g = e.getCapsule(this).readFloat("g", 0);
34         } catch (IOException e1) {
35             logger.logp(Level.SEVERE, this.getClass().toString(), "read(JMEImporter e)", "Exception", e1);
36         }
37     }
38     
39     public Class getClassTag() {
40         return this.getClass();
41     }
42 }