]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/src/org/simantics/databoard/container/DataContainer.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / container / DataContainer.java
1 package org.simantics.databoard.container;
2
3 import java.util.TreeMap;
4
5 import org.simantics.databoard.binding.mutable.Variant;
6
7 /**
8  * This is a container format primarly for encoding data to file system.
9  * It adds to the actual data encoded as a variant some metadata, format
10  * name and version information.
11  * @author Hannu Niemistö
12  */
13 public class DataContainer {
14     /**
15      * Format name that tells how the data is used. 
16      * Applications use format name to decide if the file can 
17      * be used for the operation the user requested.
18      */
19     public String format;
20     /**
21      * Version number of the content format. Increased every
22      * time the data type or the interpretation of the data
23      * changes.
24      */
25     public int version;
26     /**
27      * May contain arbitrary metadata about the data such as
28      * author, export data etc.
29      */
30     public TreeMap<String, Variant> metadata;
31     /**
32      * The actual data content.
33      */
34     public Variant content;
35     
36     public DataContainer() {
37     }
38     
39     public DataContainer(String format, int version,
40             TreeMap<String, Variant> metadata, Variant content) {
41         this.format = format;
42         this.version = version;
43         this.metadata = metadata;
44         this.content = content;
45     }
46     
47     public DataContainer(String format, int version, Variant content) {
48         this(format, version, new TreeMap<String,Variant>(), content);
49     }
50 }