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.
Lots of tests for metadata classes, and implement corresponding funct…
…ionality in mondrian driver. Review org.olap4j.type package, and remove/hide several methods. Add API for creating validator and validating an MDX parse tree. Test that non-unique axis names cause a validation error. git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@38 c6a108a4-781c-0410-a6c6-c2d559e19af0
- Loading branch information
1 parent
fb680a8
commit 96d3da3
Showing
54 changed files
with
1,743 additions
and
376 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
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
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,54 @@ | ||
/* | ||
// 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.ArrayList; | ||
|
||
/** | ||
* Implementation of {@link org.olap4j.metadata.NamedList} which uses | ||
* {@link java.util.ArrayList} for storage. | ||
* | ||
* <p>Derived class must implement {@link #getName(Object)}, to indicate how | ||
* elements are named. | ||
* | ||
* @see mondrian.olap4j.NamedListImpl | ||
* | ||
* @author jhyde | ||
* @version $Id: $ | ||
* @since Nov 12, 2007 | ||
*/ | ||
public abstract class ArrayNamedListImpl<T> | ||
extends ArrayList<T> | ||
implements NamedList<T> | ||
{ | ||
protected abstract String getName(T t); | ||
|
||
public T get(String name) { | ||
for (T t : this) { | ||
if (getName(t).equals(name)) { | ||
return t; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
public int indexOfName(String name) { | ||
for (int i = 0; i < size(); ++i) { | ||
T t = get(i); | ||
if (getName(t).equals(name)) { | ||
return i; | ||
} | ||
} | ||
return -1; | ||
} | ||
} | ||
|
||
// End ArrayNamedListImpl.java |
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
Oops, something went wrong.