1 13 package com.tonbeller.jpivot.olap.model; 14 15 import java.util.Comparator ; 16 17 18 21 public final class MemberPropertyMeta implements Displayable { 22 private String name; 23 private String scope; 24 private String label; 25 26 29 public static final Comparator KEY_COMPARATOR = new Comparator () { 30 public int compare(Object o1, Object o2) { 31 MemberPropertyMeta m1 = (MemberPropertyMeta) o1; 32 MemberPropertyMeta m2 = (MemberPropertyMeta) o2; 33 int comp = m1.getScope().compareTo(m2.getScope()); 34 if (comp == 0) 35 return m1.getName().compareTo(m2.getName()); 36 return comp; 37 } 38 }; 39 40 public MemberPropertyMeta() { 41 } 42 43 public MemberPropertyMeta(String label, String name, String scope) { 44 this.label = label; 45 this.name = name; 46 this.scope = scope; 47 } 48 49 public void accept(Visitor visitor) { 50 visitor.visitMemberPropertyMeta(this); 51 } 52 53 public String getName() { 54 return name; 55 } 56 57 public String getScope() { 58 return scope; 59 } 60 61 public void setName(String string) { 62 name = string; 63 } 64 65 public void setScope(String string) { 66 scope = string; 67 } 68 69 public String getLabel() { 70 return label; 71 } 72 73 public void setLabel(String string) { 74 label = string; 75 } 76 77 public String getKey() { 78 return scope + "." + name; 79 } 80 81 public String toString() { 82 return "MemberPropertyMeta[" + name + ", " + label + ", " + scope + "]"; 83 } 84 85 } 86 | Popular Tags |