1 28 package net.sf.jasperreports.crosstabs.fill.calculation; 29 30 36 public class HeaderCell 37 { 38 private final BucketDefinition.Bucket[] bucketValues; 39 private final int levelSpan; 40 private final int depthSpan; 41 private final boolean isTotal; 42 43 44 51 public HeaderCell( 52 BucketDefinition.Bucket[] bucketValues, 53 int levelSpan, 54 int depthSpan) 55 { 56 this.bucketValues = bucketValues; 57 this.levelSpan = levelSpan; 58 this.depthSpan = depthSpan; 59 60 boolean foundTotal = false; 61 for (int i = 0; i < bucketValues.length; i++) 62 { 63 if (bucketValues[i] != null && bucketValues[i].isTotal()) 64 { 65 foundTotal = true; 66 break; 67 } 68 } 69 70 isTotal = foundTotal; 71 } 72 73 74 79 public BucketDefinition.Bucket[] getBucketValues() 80 { 81 return bucketValues; 82 } 83 84 85 92 public int getLevelSpan() 93 { 94 return levelSpan; 95 } 96 97 98 105 public int getDepthSpan() 106 { 107 return depthSpan; 108 } 109 110 111 116 public boolean isTotal() 117 { 118 return isTotal; 119 } 120 121 public static HeaderCell createLevelSpanCopy(HeaderCell cell, int newLevelSpan) 122 { 123 return new HeaderCell(cell.bucketValues, newLevelSpan, cell.getDepthSpan()); 124 } 125 } 126 | Popular Tags |