1 package org.tigris.scarab.reports; 2 3 41 42 import java.util.List ; 43 import java.util.ArrayList ; 44 import org.apache.fulcrum.intake.Retrievable; 45 46 51 public class ReportAxis 52 implements java.io.Serializable , 53 Retrievable 54 { 55 private List reportHeadings; 56 57 private String queryKey; 58 59 67 public ReportHeading getHeading(int headingIndex) 68 { 69 ReportHeading heading; 70 List headings = getReportHeadings(); 71 if (headingIndex >= 0) 72 { 73 if (headings == null || headings.size() <= headingIndex) 74 { 75 throw new IllegalArgumentException (headingIndex + 76 " is larger than the number of headings"); } 78 else 79 { 80 heading = (ReportHeading)headings.get(headingIndex); 81 } 82 } 83 else 84 { 85 heading = new ReportHeading(); 86 addReportHeading(heading); 87 } 88 return heading; 89 } 90 91 95 public List getReportHeadings() 96 { 97 return reportHeadings; 98 } 99 100 104 public void setReportHeadings(List newReportHeadings) 105 { 106 this.reportHeadings = newReportHeadings; 107 } 108 109 113 public void addReportHeading(ReportHeading newReportHeading) 114 { 115 if (reportHeadings == null) 116 { 117 reportHeadings = new ArrayList (); 118 } 119 reportHeadings.add(newReportHeading); 120 } 121 122 126 public String getQueryKey() 127 { 128 return queryKey == null ? "" : queryKey; 129 } 130 131 135 public void setQueryKey(String newQueryKey) 136 { 137 this.queryKey = newQueryKey; 138 } 139 } 140 | Popular Tags |