1 13 17 package com.tonbeller.jpivot.mondrian; 18 19 23 public class MondrianSortPosition implements Comparable { 24 25 public int index; 26 private mondrian.olap.Member[] posMembers; 27 28 30 public MondrianSortPosition(int index, mondrian.olap.Member[] posMembers) { 31 this.index = index; 32 this.posMembers = posMembers; 33 } 34 35 38 public int compareTo(Object o) { 39 MondrianSortPosition other = (MondrianSortPosition)o; 40 DimensionLoop : for (int i = 0; i < this.posMembers.length; i++) { 41 mondrian.olap.Member m1 = this.posMembers[i]; 42 mondrian.olap.Member m2 = other.posMembers[i]; 43 if (m1.equals(m2)) 44 continue DimensionLoop; 45 46 int ic = m1.getUniqueName().compareTo(m2.getUniqueName()); 49 if (ic != 0) 50 return ic; 51 } 54 return 0; } 56 57 } | Popular Tags |