01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/postem/tags/sakai_2-4-1/postem-app/src/java/org/sakaiproject/tool/postem/Column.java $
03: * $Id: Column.java 14724 2006-09-15 16:00:15Z lance@indiana.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.tool.postem;
21:
22: /**
23: * @author rduhon
24: */
25:
26: import java.util.List;
27:
28: import org.sakaiproject.api.app.postem.data.Gradebook;
29:
30: public class Column {
31:
32: public Gradebook gradebook;
33:
34: public int column;
35:
36: public Column(Gradebook gradebook, int column) {
37: this .gradebook = gradebook;
38: this .column = column;
39: }
40:
41: public List getSummary() {
42: try {
43: return gradebook.getAggregateData(column);
44: } catch (Exception exception) {
45: return null;
46: }
47: }
48:
49: public List getRaw() {
50: return gradebook.getRawData(column);
51: }
52:
53: public boolean getHasName() {
54: return gradebook.getHeadings().size() > 0;
55: }
56:
57: public String getName() {
58: try {
59: return (String) gradebook.getHeadings().get(column + 1);
60: } catch (Exception exception) {
61: return "" + (column + 1);
62: }
63: }
64: }
|