Skip to content

Commit

Permalink
added getValue/setValue, so the value of a parameter can be queried a…
Browse files Browse the repository at this point in the history
…nd modified without invoking the parser

[git-p4: depot-paths = "//open/mondrian/": change = 311]
  • Loading branch information
Andreas Voss committed Feb 20, 2003
1 parent 4b4fb3e commit 1d735c5
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/main/mondrian/olap/Parameter.java
Expand Up @@ -137,6 +137,38 @@ public void setValue(String value, NameResolver st)
exp = Util.lookupMember(st, value, false);
}
}

/**
* returns the parameters value
* @return one of String, Double, Member
*/
public Object getValue() {
switch (category) {
case CatNumeric:
case CatString:
return ((Literal)exp).getValue();
default:
return (Member)exp;
}
}


/**
* sets the parameters value
* @param value one of String, Double, Member
*/
public void setValue(Object value) {
switch (category) {
case CatNumeric:
exp = Literal.create((Double)value);
break;
case CatString:
exp = Literal.createString((String)value);
break;
default:
exp = (Member)value;
}
}

/**
* Returns "STRING", "NUMERIC" or "MEMBER"
Expand Down

0 comments on commit 1d735c5

Please sign in to comment.