1 12 package org.displaytag.model; 13 14 import org.apache.commons.lang.builder.ToStringBuilder; 15 import org.apache.commons.lang.builder.ToStringStyle; 16 import org.displaytag.util.HtmlAttributeMap; 17 18 19 30 public class Cell implements Comparable , Cloneable 31 { 32 33 36 public static final Cell EMPTY_CELL = new Cell(); 37 38 41 private Object staticValue; 42 43 46 private HtmlAttributeMap attributes; 47 48 51 private Cell() 52 { 53 super(); 54 } 55 56 60 public Cell(Object value) 61 { 62 this.staticValue = value; 63 } 64 65 69 public Object getStaticValue() 70 { 71 return this.staticValue; 72 } 73 74 80 public int compareTo(Object obj) 81 { 82 83 if (this.staticValue == null) 84 { 85 return -1; 86 } 87 88 if (obj instanceof Cell) 89 { 90 return ((Comparable ) this.staticValue).compareTo(((Cell) obj).getStaticValue()); 91 } 92 93 return ((Comparable ) this.staticValue).compareTo(obj); 94 95 } 96 97 101 public String toString() 102 { 103 return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) .append("staticValue", this.staticValue).toString(); } 106 107 public void setPerRowAttributes(HtmlAttributeMap perRowValues) 108 { 109 this.attributes = perRowValues; 110 } 111 112 public HtmlAttributeMap getPerRowAttributes() 113 { 114 return this.attributes; 115 } 116 117 } | Popular Tags |