Minor Updated

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@92767 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-03-06 16:08:32 +00:00
parent 61d7e8b579
commit 74d17d8b1c
1 changed files with 73 additions and 58 deletions

View File

@ -165,7 +165,8 @@ public class C_ExpressionParser {
private Expression getValueIsIn(C_Expression exp) { private Expression getValueIsIn(C_Expression exp) {
C_ValueIsIn v = (C_ValueIsIn) exp; C_ValueIsIn v = (C_ValueIsIn) exp;
ValueIsIn valueIsIn = new ValueIsIn(parse(v.getLeftArgument()), parse(v.getRightArgument())); ValueIsIn valueIsIn = new ValueIsIn(parse(v.getLeftArgument()),
parse(v.getRightArgument()));
return valueIsIn; return valueIsIn;
} }
@ -202,7 +203,8 @@ public class C_ExpressionParser {
private Expression getBetween(C_Expression exp) { private Expression getBetween(C_Expression exp) {
C_Between bet = (C_Between) exp; C_Between bet = (C_Between) exp;
Between between=new Between(parse(bet.getLeftArgument()),parse(bet.getRightArgument())); Between between = new Between(parse(bet.getLeftArgument()),
parse(bet.getRightArgument()));
return between; return between;
} }
@ -221,69 +223,85 @@ public class C_ExpressionParser {
private Expression getTextMatchSQLRegexp(C_Expression exp) { private Expression getTextMatchSQLRegexp(C_Expression exp) {
C_TextMatchSQLRegexp reg = (C_TextMatchSQLRegexp) exp; C_TextMatchSQLRegexp reg = (C_TextMatchSQLRegexp) exp;
TextMatchSQLRegexp regExp=new TextMatchSQLRegexp(parse(reg.getLeftArgument()),parse(reg.getRightArgument())); TextMatchSQLRegexp regExp = new TextMatchSQLRegexp(
parse(reg.getLeftArgument()), parse(reg.getRightArgument()));
return regExp; return regExp;
} }
private Expression getTextEndWith(C_Expression exp) { private Expression getTextEndWith(C_Expression exp) {
C_TextEndsWith textEnd = (C_TextEndsWith) exp; C_TextEndsWith textEnd = (C_TextEndsWith) exp;
TextEndsWith textEndWith=new TextEndsWith(parse(textEnd.getLeftArgument()),parse(textEnd.getRightArgument())); TextEndsWith textEndWith = new TextEndsWith(
parse(textEnd.getLeftArgument()),
parse(textEnd.getRightArgument()));
return textEndWith; return textEndWith;
} }
private Expression getTextContains(C_Expression exp) { private Expression getTextContains(C_Expression exp) {
C_TextContains textContains = (C_TextContains) exp; C_TextContains textContains = (C_TextContains) exp;
TextContains textCont=new TextContains(parse(textContains.getLeftArgument()),parse(textContains.getRightArgument())); TextContains textCont = new TextContains(
parse(textContains.getLeftArgument()),
parse(textContains.getRightArgument()));
return textCont; return textCont;
} }
private Expression getTextBeginWith(C_Expression exp) { private Expression getTextBeginWith(C_Expression exp) {
C_TextBeginsWith textB = (C_TextBeginsWith) exp; C_TextBeginsWith textB = (C_TextBeginsWith) exp;
TextBeginsWith textBegins=new TextBeginsWith(parse(textB.getLeftArgument()),parse(textB.getRightArgument())); TextBeginsWith textBegins = new TextBeginsWith(
parse(textB.getLeftArgument()), parse(textB.getRightArgument()));
return textBegins; return textBegins;
} }
private Expression getNotLess(C_Expression exp) { private Expression getNotLess(C_Expression exp) {
C_NotLess notL = (C_NotLess) exp; C_NotLess notL = (C_NotLess) exp;
NotLess notLess=new NotLess(parse(notL.getLeftArgument()),parse(notL.getRightArgument())); NotLess notLess = new NotLess(parse(notL.getLeftArgument()),
parse(notL.getRightArgument()));
return notLess; return notLess;
} }
private Expression getNotGreater(C_Expression exp) { private Expression getNotGreater(C_Expression exp) {
C_NotGreater notG = (C_NotGreater) exp; C_NotGreater notG = (C_NotGreater) exp;
NotGreater notGreater=new NotGreater(parse(notG.getLeftArgument()),parse(notG.getRightArgument())); NotGreater notGreater = new NotGreater(parse(notG.getLeftArgument()),
parse(notG.getRightArgument()));
return notGreater; return notGreater;
} }
private Expression getNotEquals(C_Expression exp) { private Expression getNotEquals(C_Expression exp) {
C_NotEquals notE = (C_NotEquals) exp; C_NotEquals notE = (C_NotEquals) exp;
NotEquals notEquals=new NotEquals(parse(notE.getLeftArgument()),parse(notE.getRightArgument())); NotEquals notEquals = new NotEquals(parse(notE.getLeftArgument()),
parse(notE.getRightArgument()));
return notEquals; return notEquals;
} }
private Expression getLessThan(C_Expression exp) { private Expression getLessThan(C_Expression exp) {
C_LessThan lessT = (C_LessThan) exp; C_LessThan lessT = (C_LessThan) exp;
LessThan lessThan=new LessThan(parse(lessT.getLeftArgument()),parse(lessT.getRightArgument())); LessThan lessThan = new LessThan(parse(lessT.getLeftArgument()),
parse(lessT.getRightArgument()));
return lessThan; return lessThan;
} }
private Expression getLessOrEquals(C_Expression exp) { private Expression getLessOrEquals(C_Expression exp) {
C_LessOrEquals lessOrE = (C_LessOrEquals) exp; C_LessOrEquals lessOrE = (C_LessOrEquals) exp;
LessOrEquals lessOrEquals=new LessOrEquals(parse(lessOrE.getLeftArgument()),parse(lessOrE.getRightArgument())); LessOrEquals lessOrEquals = new LessOrEquals(
parse(lessOrE.getLeftArgument()),
parse(lessOrE.getRightArgument()));
return lessOrEquals; return lessOrEquals;
} }
private Expression getGreaterThan(C_Expression exp) { private Expression getGreaterThan(C_Expression exp) {
C_GreaterThan greaterThan = (C_GreaterThan) exp; C_GreaterThan greaterThan = (C_GreaterThan) exp;
GreaterThan greater=new GreaterThan(parse(greaterThan.getLeftArgument()),parse(greaterThan.getRightArgument())); GreaterThan greater = new GreaterThan(
parse(greaterThan.getLeftArgument()),
parse(greaterThan.getRightArgument()));
return greater; return greater;
} }
private Expression getGreaterOrEquals(C_Expression exp) { private Expression getGreaterOrEquals(C_Expression exp) {
C_GreaterOrEquals greaterOrEq = (C_GreaterOrEquals) exp; C_GreaterOrEquals greaterOrEq = (C_GreaterOrEquals) exp;
GreaterOrEquals greaterOrEquals=new GreaterOrEquals(parse(greaterOrEq.getLeftArgument()),parse(greaterOrEq.getRightArgument())); GreaterOrEquals greaterOrEquals = new GreaterOrEquals(
parse(greaterOrEq.getLeftArgument()),
parse(greaterOrEq.getRightArgument()));
return greaterOrEquals; return greaterOrEquals;
} }
@ -373,8 +391,8 @@ public class C_ExpressionParser {
protected Expression getRange(C_Expression exp) { protected Expression getRange(C_Expression exp) {
C_Range c = (C_Range) exp; C_Range c = (C_Range) exp;
Range range = new Range(getExpressionValue(c.getMaximum()), Range range = new Range(getExpressionValue(c.getMinimum()),
getExpressionValue(c.getMinimum())); getExpressionValue(c.getMaximum()));
return range; return range;
} }
@ -383,9 +401,7 @@ public class C_ExpressionParser {
TableId tableId = new TableId(Long.valueOf(c.getTrId().getTableId())); TableId tableId = new TableId(Long.valueOf(c.getTrId().getTableId()));
ColumnLocalId columnId = new ColumnLocalId(c.getColumnId()); ColumnLocalId columnId = new ColumnLocalId(c.getColumnId());
TypedColumnReference ref = new TypedColumnReference( TypedColumnReference ref = new TypedColumnReference(tableId, columnId,
tableId,
columnId,
mapColumnDataType(c.getDataType())); mapColumnDataType(c.getDataType()));
return ref; return ref;
} }
@ -398,5 +414,4 @@ public class C_ExpressionParser {
return eq; return eq;
} }
} }