forked from olap4j/olap4j
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename OlapResultSet to CellSet, OlapResultSetMetaData to CellSetMeta…
…Data, OlapResultAxis to CellSetAxis, ResultCell to Cell, ResultSetPosition to Position; add implementation of olap4j against mondrian, and a unit test git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@17 c6a108a4-781c-0410-a6c6-c2d559e19af0
- Loading branch information
1 parent
b456d38
commit 5d7b66c
Showing
48 changed files
with
5,352 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
// $Id: $ | ||
// 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. | ||
// Copyright (C) 2007-2007 Julian Hyde | ||
// All Rights Reserved. | ||
// You must accept the terms of that agreement to use this software. | ||
*/ | ||
package mondrian.olap4j; | ||
|
||
import org.olap4j.metadata.NamedList; | ||
|
||
import java.util.AbstractList; | ||
|
||
/** | ||
* Partial implementation of {@link org.olap4j.metadata.NamedList}. | ||
* | ||
* <p>Derived class must implement {@link #get(int)} and {@link #size()}, as | ||
* per {@link java.util.AbstractList}. | ||
* | ||
* @see mondrian.olap4j.NamedListImpl | ||
* | ||
* @author jhyde | ||
* @version $Id: $ | ||
* @since May 25, 2007 | ||
*/ | ||
abstract class AbstractNamedList<T extends Named> | ||
extends AbstractList<T> | ||
implements NamedList<T> | ||
{ | ||
public T get(String name) { | ||
for (T t : this) { | ||
if (t.getName().equals(name)) { | ||
return t; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
public int indexOfName(String name) { | ||
for (int i = 0; i < size(); ++i) { | ||
T t = get(i); | ||
if (t.getName().equals(name)) { | ||
return i; | ||
} | ||
} | ||
return -1; | ||
} | ||
|
||
} | ||
|
||
// End AbstractNamedList.java |
Oops, something went wrong.