/* // $Id: //guest/paul_dymecki/mondrian/src/main/mondrian/rolap/StringList.java#1 $ // This software is subject to the terms of the Common Public License // Agreement, available at the following URL: // http://www.opensource.org/licenses/cpl.html. // (C) Copyright 2001-2002 Kana Software, Inc. and others. // All Rights Reserved. // You must accept the terms of that agreement to use this software. // // jhyde, 29 December, 2001 */ package mondrian.rolap; import mondrian.olap.Util; /** * <code>StringList</code> makes it easy to build up a comma-separated string. * * @author jhyde * @since 29 December, 2001 * @version $Id: //guest/paul_dymecki/mondrian/src/main/mondrian/rolap/StringList.java#1 $ **/ class StringList { StringBuffer sb; String first, mid, last; int count; StringList(String first, String mid) { this.sb = new StringBuffer(first); this.count = 0; this.first = first; this.mid = mid; this.last = ""; } StringList(String first) { this(first, ", "); } int getCount() { return count; } boolean isEmpty() { return count == 0; } /** Creates a new item. **/ void newItem(String s) { if (count++ > 0) { sb.append(mid); } sb.append(s); } /** Appends to an existing item. **/ void append(String s) { Util.assertTrue(count > 0); sb.append(s); } // override Object public String toString() { sb.append(last); return sb.toString(); } }; // End StringList.java
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 1820 | Paul Robert Dymecki | mondrian: Integrate latest from //guest/julian_hyde | ||
//guest/julian_hyde/mondrian/src/main/mondrian/rolap/StringList.java | |||||
#2 | 1603 | Julian Hyde |
mondrian: Add Andreas' taglib; Rename 'mondrian.rolap.Util.assert' to 'assertTrue', because 'assert' is a keyword in jdk 1.4; Fix 'NON EMPTY'; JUnit framework for tests; Add Oracle dataset. |
||
#1 | 1453 | Julian Hyde | mondrian: first source check-in |