/**
* Copyright (c) 2008, http://www.snakeyaml.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.yaml.snakeyaml.tests;
import org.yaml.snakeyaml.*;
import jhplot.*;
import java.util.*;
import org.yaml.snakeyaml.constructor.*;
public class Test {
public static void main(String args[]) {
Yaml yaml = new Yaml();
P1D p1 = new P1D("test");
Constructor constructor = new Constructor(jhplot.P1D.class);
p1.add(10,20,5);
p1.add(20,40,5);
//String output = yaml.dump(1);
H1D h1= new H1D("histo", 100, 0, 10);
h1.fillGauss(100,0,20);
Map data = new HashMap();
data.put("name", "Silenthand Olleander");
data.put("race", "Human");
data.put("traits", new String[] { "ONE_HAND", "ONE_EYE" });
data.put("p1d", p1);
data.put("h1d", h1.get());
String output = yaml.dump(data);
Constructor constructor1 = new Constructor(jhplot.H1D.class);
//TypeDescription carDescription = new TypeDescription(MyCar.class);
// carDescription.putMapPropertyType("wheels", MyWheel.class, Object.class);
// constructor.addTypeDefinition(carDescription);
Yaml yaml1 = new Yaml(constructor1);
System.out.println(yaml1.dump(h1.get()));
}
}
Ads help maintain this website.