View Javadoc
1   /*
2    * Copyright 2011 The Kuali Foundation.
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole;
17  
18  import java.util.ArrayList;
19  import java.util.HashMap;
20  import java.util.List;
21  import java.util.Map;
22  
23  /**
24   * Created by IntelliJ IDEA.
25   * User: pvsubrah
26   * Date: 9/8/11
27   * Time: 10:41 AM
28   * To change this template use File | Settings | File Templates.
29   */
30  
31  public class OleDocStoreData {
32      private String category;
33      private List<String> doctypes = new ArrayList<String>();
34      private List<String> formats = new ArrayList<String>();
35      private Map<String, List<String>> typeFormatMap = new HashMap<String, List<String>>();
36      private Map<String, Integer> formatLevelsMap = new HashMap<String, Integer>();
37      private Map<String, Map<String, Long>> typeFormatMapWithNodeCount = new HashMap<String, Map<String, Long>>();
38  
39      public String getCategory() {
40          return category;
41      }
42  
43      public void setCategory(String category) {
44          this.category = category;
45      }
46  
47      public Map<String, List<String>> getTypeFormatMap() {
48          return typeFormatMap;
49      }
50  
51      public List<String> getDoctypes() {
52          return doctypes;
53      }
54  
55      public void setDoctypes(List<String> doctypes) {
56          this.doctypes = doctypes;
57      }
58  
59      public void addDocType(String docType) {
60          if (!this.doctypes.contains(docType)) {
61              this.doctypes.add(docType);
62          }
63      }
64  
65      public void addFormat(String docType, String format) {
66          List<String> formatsList = null;
67          if (!this.typeFormatMap.containsKey(docType)) {
68              this.typeFormatMap.put(docType, new ArrayList<String>());
69          }
70  
71          formatsList = this.typeFormatMap.get(docType);
72  
73          if (!formatsList.contains(format)) {
74              formatsList.add(format);
75              formats.add(format);
76          }
77          this.typeFormatMap.put(docType, formatsList);
78      }
79  
80      public void addLevelInfoForFormat(String format, Integer levels) {
81          formatLevelsMap.put(format, levels);
82      }
83  
84      public Map<String, Map<String, Long>> getTypeFormatMapWithNodeCount() {
85          return typeFormatMapWithNodeCount;
86      }
87  
88      public void setTypeFormatMapWithNodeCount(Map<String, Map<String, Long>> typeFormatMapWithNodeCount) {
89          this.typeFormatMapWithNodeCount = typeFormatMapWithNodeCount;
90      }
91  
92      public Map<String, Integer> getFormatLevelsMap() {
93          return formatLevelsMap;
94      }
95  
96      public void setFormatLevelsMap(Map<String, Integer> formatLevelsMap) {
97          this.formatLevelsMap = formatLevelsMap;
98      }
99  
100     public List<String> getFormats() {
101         return formats;
102     }
103 }