Updated C_Expression

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@113951 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-04-13 08:44:28 +00:00
parent aa855309eb
commit e55042d90b
56 changed files with 589 additions and 455 deletions

View File

@ -126,3 +126,35 @@ Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2737 units from cache.
Compiling...
30% complete (ETR: 8 seconds)
30% complete (ETR: 8 seconds)
30% complete (ETR: 8 seconds)
30% complete (ETR: 8 seconds)
40% complete (ETR: 8 seconds)
50% complete (ETR: 6 seconds)
60% complete (ETR: 4 seconds)
70% complete (ETR: 3 seconds)
80% complete (ETR: 2 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 32.50 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2737 cached/archived units. Used 2737 / 2737 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2737 cached/archived units. Used 2737 / 2737 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes

View File

@ -3,5 +3,8 @@ package org.gcube.portlets.user.td.expressionwidget.shared.expression;
public interface C_MultivaluedExpression {
public String getIdMulti();
public String getReadableMultivaluedString();
}

View File

@ -21,9 +21,11 @@ public class C_ExternalReferenceExpression extends C_Expression implements
C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "ExternalReferenceExpression("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "ExternalReferenceExpression("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
@Override
@ -51,7 +53,14 @@ public class C_ExternalReferenceExpression extends C_Expression implements
public void setRightArgument(C_Expression rightArgument) {
this.rightArgument = rightArgument;
}
@Override
public String getReadableMultivaluedString() {
return readableExpression;
}
@Override
public String toString() {
return "ExternalReferenceExpression [ id=" + id + ", leftArgument="

View File

@ -22,21 +22,21 @@ public class C_AggregationExpression extends C_Expression {
public C_AggregationExpression(C_Expression argument) {
this.argument = argument;
this.readableExpression = "AggregationExpression("
+ argument.getReadableExpression() + ")";
if (argument != null) {
this.readableExpression = "AggregationExpression("
+ argument.getReadableExpression() + ")";
}
}
@Override
public String getId() {
return id;
}
public String getReturnedDataType() {
return "DataType";
}
public C_Expression getArgument() {
return argument;
}

View File

@ -24,8 +24,10 @@ public class C_Avg extends C_AggregationExpression {
*/
public C_Avg(C_Expression argument) {
this.argument = argument;
this.readableExpression = "AVG("
+ argument.getReadableExpression() + ")";
if (argument != null) {
this.readableExpression = "AVG(" + argument.getReadableExpression()
+ ")";
}
}

View File

@ -5,33 +5,35 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class C_Count extends C_AggregationExpression {
private static final long serialVersionUID = 7728851019516221450L;
protected String id = "Count";
public C_Count() {
}
/**
*
* @param argument
*/
public C_Count(C_Expression argument) {
this.argument = argument;
this.readableExpression = "Count("
+ argument.getReadableExpression() + ")";
if (argument != null) {
this.readableExpression = "Count("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.COUNT;
}
@Override
public String getReturnedDataType() {
return "Integer";
@ -42,13 +44,9 @@ public class C_Count extends C_AggregationExpression {
return id;
}
@Override
public String toString() {
return "Count [id=" + id + ", argument=" + argument + "]";
}
}

View File

@ -24,8 +24,10 @@ public class C_Max extends C_AggregationExpression {
*/
public C_Max(C_Expression argument) {
this.argument = argument;
this.readableExpression = "Max("
+ argument.getReadableExpression() + ")";
if (argument != null) {
this.readableExpression = "Max(" + argument.getReadableExpression()
+ ")";
}
}
public C_OperatorType getOperator() {

View File

@ -24,21 +24,21 @@ public class C_Min extends C_AggregationExpression {
*/
public C_Min(C_Expression argument) {
this.argument = argument;
this.readableExpression = "Min("
+ argument.getReadableExpression() + ")";
if (argument != null) {
this.readableExpression = "Min(" + argument.getReadableExpression()
+ ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.MIN;
}
@Override
public String getId() {
return id;
}
@Override
public String toString() {
return "Min [id=" + id + ", argument=" + argument + "]";

View File

@ -23,8 +23,10 @@ public class C_ST_Extent extends C_AggregationExpression {
*/
public C_ST_Extent(C_Expression argument) {
this.argument = argument;
this.readableExpression = "ST_Extent("
+ argument.getReadableExpression() + ")";
if (argument != null) {
this.readableExpression = "ST_Extent("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {

View File

@ -24,8 +24,10 @@ public class C_Sum extends C_AggregationExpression {
*/
public C_Sum(C_Expression argument) {
this.argument = argument;
this.readableExpression = "Sum("
+ argument.getReadableExpression() + ")";
if (argument != null) {
this.readableExpression = "Sum(" + argument.getReadableExpression()
+ ")";
}
}
public C_OperatorType getOperator() {

View File

@ -5,34 +5,34 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class C_Addition extends C_ArithmeticExpression {
public class C_Addition extends C_ArithmeticExpression {
private static final long serialVersionUID = 3148009575987859751L;
private String id="Addition";
private String id = "Addition";
public C_Addition() {
}
public C_Addition(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "Addition("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Addition("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.ADDITION;
}
@Override
public String getId() {
return id;
@ -40,8 +40,8 @@ public class C_Addition extends C_ArithmeticExpression {
@Override
public String toString() {
return "Addition [id=" + id + ", leftArgument="
+ leftArgument + ", rightArgument=" + rightArgument + "]";
return "Addition [id=" + id + ", leftArgument=" + leftArgument
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -30,16 +30,19 @@ public class C_ArithmeticExpression extends C_Expression {
C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "ArithmeticExpression("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "ArithmeticExpression("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
static {
acceptedDataTypes.add(ColumnDataType.Numeric);
acceptedDataTypes.add(ColumnDataType.Integer);
//acceptedDataTypes.add(ColumnDataType.Date); //Date+Date?
//acceptedDataTypes.add(ColumnDataType.Geometry); //Point+Point PostiGIS?
// acceptedDataTypes.add(ColumnDataType.Date); //Date+Date?
// acceptedDataTypes.add(ColumnDataType.Geometry); //Point+Point
// PostiGIS?
}
public String getReturnedDataType() {

View File

@ -5,33 +5,33 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class C_Division extends C_ArithmeticExpression {
public class C_Division extends C_ArithmeticExpression {
private static final long serialVersionUID = 6678032753615890456L;
private String id="Division";
private String id = "Division";
public C_Division() {
}
public C_Division(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "Division("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Division("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.DIVISION;
}
@Override
public String getId() {
return id;
@ -39,8 +39,8 @@ public class C_Division extends C_ArithmeticExpression {
@Override
public String toString() {
return "Division [id=" + id + ", leftArgument="
+ leftArgument + ", rightArgument=" + rightArgument + "]";
return "Division [id=" + id + ", leftArgument=" + leftArgument
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -13,9 +13,7 @@ public class C_Exponentiation extends C_ArithmeticExpression {
private static final long serialVersionUID = -8124478792466278925L;
private String id = "Exponentiation";
public C_Exponentiation() {
}
@ -24,12 +22,15 @@ public class C_Exponentiation extends C_ArithmeticExpression {
*
* @param argument
*/
public C_Exponentiation(C_Expression leftArgument, C_Expression rightArgument) {
public C_Exponentiation(C_Expression leftArgument,
C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "Exponentiation("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Exponentiation("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
@ -37,20 +38,15 @@ public class C_Exponentiation extends C_ArithmeticExpression {
return C_OperatorType.EXPONENTIATION;
}
@Override
public String getId() {
return id;
}
@Override
public String toString() {
return "Exponentiation [id=" + id + ", leftArgument="
+ leftArgument + ", rightArgument=" + rightArgument + "]";
return "Exponentiation [id=" + id + ", leftArgument=" + leftArgument
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -5,33 +5,33 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class C_Modulus extends C_ArithmeticExpression {
public class C_Modulus extends C_ArithmeticExpression {
private static final long serialVersionUID = -4068595785080246810L;
private String id="Modulus";
private String id = "Modulus";
public C_Modulus() {
}
public C_Modulus(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "Modulus("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Modulus("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.MODULUS;
}
@Override
public String getId() {
return id;
@ -39,8 +39,8 @@ public class C_Modulus extends C_ArithmeticExpression {
@Override
public String toString() {
return "Modulus [id=" + id + ", leftArgument="
+ leftArgument + ", rightArgument=" + rightArgument + "]";
return "Modulus [id=" + id + ", leftArgument=" + leftArgument
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -5,33 +5,34 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class C_Multiplication extends C_ArithmeticExpression {
public class C_Multiplication extends C_ArithmeticExpression {
private static final long serialVersionUID = 4822682666900687606L;
private String id="Multiplication";
private String id = "Multiplication";
public C_Multiplication() {
}
public C_Multiplication(C_Expression leftArgument, C_Expression rightArgument) {
public C_Multiplication(C_Expression leftArgument,
C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "Multiplication("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Multiplication("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.MULTIPLICATION;
}
@Override
public String getId() {
return id;
@ -39,8 +40,8 @@ public class C_Multiplication extends C_ArithmeticExpression {
@Override
public String toString() {
return "Multiplication [id=" + id + ", leftArgument="
+ leftArgument + ", rightArgument=" + rightArgument + "]";
return "Multiplication [id=" + id + ", leftArgument=" + leftArgument
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -5,34 +5,34 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class C_Subtraction extends C_ArithmeticExpression {
public class C_Subtraction extends C_ArithmeticExpression {
private static final long serialVersionUID = 3148009575987859751L;
private String id="Subtraction";
private String id = "Subtraction";
public C_Subtraction() {
}
public C_Subtraction(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "Subtraction("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Subtraction("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.SUBTRACTION;
}
@Override
public String getId() {
return id;
@ -40,8 +40,8 @@ public class C_Subtraction extends C_ArithmeticExpression {
@Override
public String toString() {
return "Subtraction [id=" + id + ", leftArgument="
+ leftArgument + ", rightArgument=" + rightArgument + "]";
return "Subtraction [id=" + id + ", leftArgument=" + leftArgument
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -10,39 +10,39 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi
*
*/
public class C_Equals extends C_Expression {
protected String id="Equals";
protected String id = "Equals";
private static final long serialVersionUID = 3154667914317692836L;
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_Equals() {
}
public C_Equals(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "Equals("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Equals("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.EQUALS;
}
public String getReturnedDataType() {
return "Boolean";
}
@Override
public String getId() {
return id;
}
public C_Expression getLeftArgument() {
return leftArgument;
}
@ -64,7 +64,5 @@ public class C_Equals extends C_Expression {
return "Equals [id=" + id + ", leftArgument=" + leftArgument
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -16,17 +16,19 @@ public class C_GreaterOrEquals extends C_Expression {
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_GreaterOrEquals(){
public C_GreaterOrEquals() {
}
public C_GreaterOrEquals(C_Expression leftArgument,
C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "GreaterOrEquals("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "GreaterOrEquals("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
@ -36,7 +38,7 @@ public class C_GreaterOrEquals extends C_Expression {
public String getReturnedDataType() {
return "Boolean";
}
@Override
public String getId() {
return id;

View File

@ -15,16 +15,18 @@ public class C_GreaterThan extends C_Expression {
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_GreaterThan(){
public C_GreaterThan() {
}
public C_GreaterThan(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "GreaterThan("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "GreaterThan("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
@ -34,7 +36,7 @@ public class C_GreaterThan extends C_Expression {
public String getReturnedDataType() {
return "Boolean";
}
@Override
public String getId() {
return id;

View File

@ -15,16 +15,18 @@ public class C_LessOrEquals extends C_Expression {
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_LessOrEquals(){
public C_LessOrEquals() {
}
public C_LessOrEquals(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "LessOrEquals("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "LessOrEquals("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {

View File

@ -15,16 +15,19 @@ public class C_LessThan extends C_Expression {
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_LessThan(){
public C_LessThan() {
}
public C_LessThan(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "LessThan("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "LessThan("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
@ -34,7 +37,7 @@ public class C_LessThan extends C_Expression {
public String getReturnedDataType() {
return "Boolean";
}
@Override
public String getId() {
return id;

View File

@ -11,26 +11,28 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi
*/
public class C_NotEquals extends C_Expression {
private static final long serialVersionUID = 7587723477959909679L;
protected String id="NotEquals";
protected String id = "NotEquals";
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_NotEquals(){
public C_NotEquals() {
}
public C_NotEquals(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "NotEquals("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "NotEquals("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.NOT_EQUALS;
}
public String getReturnedDataType() {
return "Boolean";
}
@ -40,7 +42,6 @@ public class C_NotEquals extends C_Expression {
return id;
}
public C_Expression getLeftArgument() {
return leftArgument;
}
@ -62,6 +63,5 @@ public class C_NotEquals extends C_Expression {
return "NotEquals [id=" + id + ", leftArgument=" + leftArgument
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -11,38 +11,37 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi
*/
public class C_NotGreater extends C_Expression {
private static final long serialVersionUID = 6783019184437499833L;
protected String id="NotGreater";
protected String id = "NotGreater";
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_NotGreater(){
public C_NotGreater() {
}
public C_NotGreater(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "NotGreater("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "NotGreater("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.NOT_GREATER;
}
public String getReturnedDataType() {
return "Boolean";
}
@Override
public String getId() {
return id;
}
public C_Expression getLeftArgument() {
return leftArgument;
}
@ -64,7 +63,5 @@ public class C_NotGreater extends C_Expression {
return "NotGreater [id=" + id + ", leftArgument=" + leftArgument
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -15,16 +15,18 @@ public class C_NotLess extends C_Expression {
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_NotLess(){
public C_NotLess() {
}
public C_NotLess(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "NotLess("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "NotLess("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {

View File

@ -11,25 +11,25 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataT
*
*/
public class C_Cast extends C_Expression {
private static final long serialVersionUID = 5871179766613405166L;
protected String id = "Cast";
protected C_Expression leftArgument;
protected ColumnDataType rightArgument;
public C_Cast(){
public C_Cast() {
super();
}
public C_Cast(C_Expression leftArgument,
ColumnDataType rightArgument) {
public C_Cast(C_Expression leftArgument, ColumnDataType rightArgument) {
super();
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "Cast("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getColumnDataTypeLabel() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Cast("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getColumnDataTypeLabel() + ")";
}
}
public C_OperatorType getOperator() {
@ -39,7 +39,7 @@ public class C_Cast extends C_Expression {
public ColumnDataType getReturnedDataType() {
return rightArgument;
}
@Override
public String getId() {
return id;
@ -61,23 +61,25 @@ public class C_Cast extends C_Expression {
this.rightArgument = rightArgument;
}
@Override
public String toString() {
return "Cast [id=" + id + ", leftArgument=" + leftArgument
+ ", rightArgument=" + rightArgument + "]";
}
public boolean isCastSupported(ColumnDataType sourceType,ColumnDataType targetType){
// from / to text
if(targetType==ColumnDataType.Text||sourceType==ColumnDataType.Text) return true;
public boolean isCastSupported(ColumnDataType sourceType,
ColumnDataType targetType) {
// from / to text
if (targetType == ColumnDataType.Text
|| sourceType == ColumnDataType.Text)
return true;
// same class
if(sourceType==targetType) return true;
// integer <--> numeric
if((sourceType==ColumnDataType.Integer && targetType==ColumnDataType.Numeric)
|| (sourceType==ColumnDataType.Numeric && targetType==ColumnDataType.Integer))return true;
if (sourceType == targetType)
return true;
// integer <--> numeric
if ((sourceType == ColumnDataType.Integer && targetType == ColumnDataType.Numeric)
|| (sourceType == ColumnDataType.Numeric && targetType == ColumnDataType.Integer))
return true;
return false;
}

View File

@ -10,25 +10,25 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi
*
*/
public class C_Concat extends C_Expression {
private static final long serialVersionUID = 5871179766613405166L;
protected String id = "Concat";
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_Concat(){
public C_Concat() {
super();
}
public C_Concat(C_Expression leftArgument,
C_Expression rightArgument) {
public C_Concat(C_Expression leftArgument, C_Expression rightArgument) {
super();
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "Concat("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Concat("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
@ -38,7 +38,7 @@ public class C_Concat extends C_Expression {
public String getReturnedDataType() {
return "Text";
}
@Override
public String getId() {
return id;
@ -60,13 +60,10 @@ public class C_Concat extends C_Expression {
this.rightArgument = rightArgument;
}
@Override
public String toString() {
return "Concat [id=" + id + ", leftArgument=" + leftArgument
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -14,16 +14,17 @@ public class C_Lenght extends C_Expression {
protected String id = "Length";
protected C_Expression argument;
public C_Lenght(){
}
public C_Lenght(C_Expression argument) {
this.argument=argument;
this.readableExpression = "Lenght("
+ argument.getReadableExpression() + ")";
public C_Lenght() {
}
public C_Lenght(C_Expression argument) {
this.argument = argument;
if (argument != null) {
this.readableExpression = "Lenght("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.LENGTH;
@ -32,7 +33,7 @@ public class C_Lenght extends C_Expression {
public String getReturnedDataType() {
return "Integer";
}
@Override
public String getId() {
return id;
@ -50,5 +51,5 @@ public class C_Lenght extends C_Expression {
public String toString() {
return "Length [id=" + id + ", argument=" + argument + "]";
}
}

View File

@ -10,24 +10,24 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi
*
*/
public class C_Levenshtein extends C_Expression {
private static final long serialVersionUID = 5871179766613405166L;
protected String id = "Levenshtein";
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_Levenshtein(){
public C_Levenshtein() {
}
public C_Levenshtein(C_Expression leftArgument,
C_Expression rightArgument) {
public C_Levenshtein(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "Levenshtein("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Levenshtein("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
@ -37,7 +37,7 @@ public class C_Levenshtein extends C_Expression {
public String getReturnedDataType() {
return "Text";
}
@Override
public String getId() {
return id;
@ -59,14 +59,10 @@ public class C_Levenshtein extends C_Expression {
this.rightArgument = rightArgument;
}
@Override
public String toString() {
return "Levenshtein [id=" + id + ", leftArgument=" + leftArgument
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -14,16 +14,17 @@ public class C_Lower extends C_Expression {
protected String id = "Lower";
protected C_Expression argument;
public C_Lower(){
}
public C_Lower(C_Expression argument) {
this.argument=argument;
this.readableExpression = "Lower("
+ argument.getReadableExpression() + ")";
public C_Lower() {
}
public C_Lower(C_Expression argument) {
this.argument = argument;
if (argument != null) {
this.readableExpression = "Lower("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.LOWER;
@ -32,7 +33,7 @@ public class C_Lower extends C_Expression {
public String getReturnedDataType() {
return "Text";
}
@Override
public String getId() {
return id;
@ -51,8 +52,4 @@ public class C_Lower extends C_Expression {
return "Lower [id=" + id + ", argument=" + argument + "]";
}
}

View File

@ -14,16 +14,17 @@ public class C_MD5 extends C_Expression {
protected String id = "MD5";
protected C_Expression argument;
public C_MD5(){
}
public C_MD5(C_Expression argument) {
this.argument=argument;
this.readableExpression = "MD5("
+ argument.getReadableExpression() + ")";
public C_MD5() {
}
public C_MD5(C_Expression argument) {
this.argument = argument;
if (argument != null) {
this.readableExpression = "MD5(" + argument.getReadableExpression()
+ ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.MD5;
@ -32,7 +33,7 @@ public class C_MD5 extends C_Expression {
public String getReturnedDataType() {
return "Text";
}
@Override
public String getId() {
return id;
@ -51,8 +52,4 @@ public class C_MD5 extends C_Expression {
return "MD5 [id=" + id + ", argument=" + argument + "]";
}
}

View File

@ -10,24 +10,24 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi
*
*/
public class C_Similarity extends C_Expression {
private static final long serialVersionUID = 5871179766613405166L;
protected String id = "Similarity";
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_Similarity(){
public C_Similarity() {
}
public C_Similarity(C_Expression leftArgument,
C_Expression rightArgument) {
public C_Similarity(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "Similarity("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Similarity("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
@ -37,7 +37,7 @@ public class C_Similarity extends C_Expression {
public String getReturnedDataType() {
return "Text";
}
@Override
public String getId() {
return id;
@ -59,14 +59,10 @@ public class C_Similarity extends C_Expression {
this.rightArgument = rightArgument;
}
@Override
public String toString() {
return "Similarity [id=" + id + ", leftArgument=" + leftArgument
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -14,16 +14,17 @@ public class C_Soundex extends C_Expression {
protected String id = "Soundex";
protected C_Expression argument;
public C_Soundex(){
}
public C_Soundex(C_Expression argument) {
this.argument=argument;
this.readableExpression = "Soundex("
+ argument.getReadableExpression() + ")";
public C_Soundex() {
}
public C_Soundex(C_Expression argument) {
this.argument = argument;
if (argument != null) {
this.readableExpression = "Soundex("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.SOUNDEX;
@ -32,7 +33,7 @@ public class C_Soundex extends C_Expression {
public String getReturnedDataType() {
return "Text";
}
@Override
public String getId() {
return id;
@ -51,8 +52,4 @@ public class C_Soundex extends C_Expression {
return "Soundex [id=" + id + ", argument=" + argument + "]";
}
}

View File

@ -10,31 +10,31 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi
*
*/
public class C_SubstringByIndex extends C_Expression {
private static final long serialVersionUID = 5871179766613405166L;
protected String id = "SubstringByIndex";
private C_Expression sourceString;
private C_Expression fromIndex;
private C_Expression toIndex;
public C_SubstringByIndex(){
public C_SubstringByIndex() {
super();
}
public C_SubstringByIndex(C_Expression sourceString, C_Expression fromIndex, C_Expression toIndex) {
public C_SubstringByIndex(C_Expression sourceString,
C_Expression fromIndex, C_Expression toIndex) {
super();
this.sourceString = sourceString;
this.fromIndex=fromIndex;
this.toIndex=toIndex;
this.readableExpression = "SubstringByIndex("
+ sourceString.getReadableExpression() + ","
+ fromIndex.getReadableExpression() + ","
+ toIndex.getReadableExpression() + ")";
this.fromIndex = fromIndex;
this.toIndex = toIndex;
if (sourceString != null && fromIndex != null && toIndex != null) {
this.readableExpression = "SubstringByIndex("
+ sourceString.getReadableExpression() + ","
+ fromIndex.getReadableExpression() + ","
+ toIndex.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
@ -44,52 +44,40 @@ public class C_SubstringByIndex extends C_Expression {
public String getReturnedDataType() {
return "Text";
}
@Override
public String getId() {
return id;
}
public C_Expression getSourceString() {
return sourceString;
}
public void setSourceString(C_Expression sourceString) {
this.sourceString = sourceString;
}
public C_Expression getFromIndex() {
return fromIndex;
}
public void setFromIndex(C_Expression fromIndex) {
this.fromIndex = fromIndex;
}
public C_Expression getToIndex() {
return toIndex;
}
public void setToIndex(C_Expression toIndex) {
this.toIndex = toIndex;
}
@Override
public String toString() {
return "SubstringByIndex [id=" + id + ", sourceString="
+ sourceString + ", fromIndex=" + fromIndex + ", toIndex="
+ toIndex + "]";
return "SubstringByIndex [id=" + id + ", sourceString=" + sourceString
+ ", fromIndex=" + fromIndex + ", toIndex=" + toIndex + "]";
}
}

View File

@ -21,15 +21,16 @@ public class C_SubstringByRegex extends C_Expression {
super();
}
public C_SubstringByRegex(C_Expression sourceString,
C_Expression regex) {
public C_SubstringByRegex(C_Expression sourceString, C_Expression regex) {
super();
this.sourceString = sourceString;
this.regex = regex;
this.readableExpression = "SubstringByRegex("
+ sourceString.getReadableExpression() + ","
+ regex.getReadableExpression() + ")";
if (sourceString != null && regex != null) {
this.readableExpression = "SubstringByRegex("
+ sourceString.getReadableExpression() + ","
+ regex.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
@ -63,8 +64,8 @@ public class C_SubstringByRegex extends C_Expression {
@Override
public String toString() {
return "SubstringByRegex [id=" + id + ", sourceString="
+ sourceString + ", regex=" + regex + "]";
return "SubstringByRegex [id=" + id + ", sourceString=" + sourceString
+ ", regex=" + regex + "]";
}
}

View File

@ -16,24 +16,23 @@ public class C_SubstringPosition extends C_Expression {
private C_Expression leftArgument;
private C_Expression rightArgument;
public C_SubstringPosition() {
super();
}
public C_SubstringPosition(C_Expression leftArgument,
C_Expression rightArgument) {
super();
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "SubstringPosition("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "SubstringPosition("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.SUBSTRING_BY_REGEX;
}
@ -47,33 +46,26 @@ public class C_SubstringPosition extends C_Expression {
return id;
}
public C_Expression getLeftArgument() {
return leftArgument;
}
public void setLeftArgument(C_Expression leftArgument) {
this.leftArgument = leftArgument;
}
public C_Expression getRightArgument() {
return rightArgument;
}
public void setRightArgument(C_Expression rightArgument) {
this.rightArgument = rightArgument;
}
@Override
public String toString() {
return "SubstringPosition [id=" + id + ", leftArgument="
+ leftArgument + ", rightArgument=" + rightArgument + "]";
return "SubstringPosition [id=" + id + ", leftArgument=" + leftArgument
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -10,24 +10,25 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expressi
*
*/
public class C_TextBeginsWith extends C_Expression {
private static final long serialVersionUID = 5871179766613405166L;
protected String id = "TextBeginsWith";
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_TextBeginsWith(){
public C_TextBeginsWith() {
}
public C_TextBeginsWith(C_Expression leftArgument,
C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "TextBeginsWith("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "TextBeginsWith("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
@ -37,7 +38,7 @@ public class C_TextBeginsWith extends C_Expression {
public String getReturnedDataType() {
return "Boolean";
}
@Override
public String getId() {
return id;

View File

@ -15,16 +15,18 @@ public class C_TextContains extends C_Expression {
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_TextContains(){
public C_TextContains() {
}
public C_TextContains(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "TextContains("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "TextContains("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {

View File

@ -15,16 +15,18 @@ public class C_TextEndsWith extends C_Expression {
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_TextEndsWith(){
public C_TextEndsWith() {
}
public C_TextEndsWith(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "TextEndsWith("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "TextEndsWith("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
@ -34,7 +36,7 @@ public class C_TextEndsWith extends C_Expression {
public String getReturnedDataType() {
return "Boolean";
}
@Override
public String getId() {
return id;

View File

@ -15,17 +15,19 @@ public class C_TextMatchSQLRegexp extends C_Expression {
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_TextMatchSQLRegexp(){
public C_TextMatchSQLRegexp() {
}
public C_TextMatchSQLRegexp(C_Expression leftArgument,
C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
this.readableExpression = "TextMatchSQLRegexp("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "TextMatchSQLRegexp("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
@ -35,7 +37,7 @@ public class C_TextMatchSQLRegexp extends C_Expression {
public String getReturnedDataType() {
return "Boolean";
}
@Override
public String getId() {
return id;

View File

@ -30,11 +30,13 @@ public class C_TextReplaceMatchingRegex extends C_Expression {
this.toCheckText = toCheckText;
this.regexp = regexp;
this.replacing = replacing;
this.readableExpression = "TextReplaceMatchingRegex("
+ toCheckText.getReadableExpression() + ","
+ regexp.getReadableExpression() + ","
+ replacing.getReadableExpression() + ")";
if (toCheckText != null && regexp != null && replacing != null) {
this.readableExpression = "TextReplaceMatchingRegex("
+ toCheckText.getReadableExpression() + ","
+ regexp.getReadableExpression() + ","
+ replacing.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {

View File

@ -14,16 +14,17 @@ public class C_Trim extends C_Expression {
protected String id = "Trim";
protected C_Expression argument;
public C_Trim(){
}
public C_Trim(C_Expression argument) {
this.argument=argument;
this.readableExpression = "Trim("
+ argument.getReadableExpression() + ")";
public C_Trim() {
}
public C_Trim(C_Expression argument) {
this.argument = argument;
if (argument != null) {
this.readableExpression = "Trim("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.TRIM;
@ -32,7 +33,7 @@ public class C_Trim extends C_Expression {
public String getReturnedDataType() {
return "Text";
}
@Override
public String getId() {
return id;
@ -51,7 +52,4 @@ public class C_Trim extends C_Expression {
return "Trim [id=" + id + ", argument=" + argument + "]";
}
}

View File

@ -14,16 +14,17 @@ public class C_Upper extends C_Expression {
protected String id = "Upper";
protected C_Expression argument;
public C_Upper(){
}
public C_Upper(C_Expression argument) {
this.argument=argument;
this.readableExpression = "Upper("
+ argument.getReadableExpression() + ")";
public C_Upper() {
}
public C_Upper(C_Expression argument) {
this.argument = argument;
if (argument != null) {
this.readableExpression = "Upper("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.UPPER;
@ -32,7 +33,7 @@ public class C_Upper extends C_Expression {
public String getReturnedDataType() {
return "Text";
}
@Override
public String getId() {
return id;
@ -51,8 +52,4 @@ public class C_Upper extends C_Expression {
return "Upper [id=" + id + ", argument=" + argument + "]";
}
}

View File

@ -29,8 +29,10 @@ public class C_ColumnReference extends C_Leaf {
tableId = trId.getTableId();
}
}
this.readableExpression = "ColumnReference(" + tableId + ","
+ dataType.getColumnDataTypeLabel() + "," + columnId + ")";
if (tableId != null && columnId != null && dataType != null) {
this.readableExpression = "ColumnReference(" + tableId + ","
+ dataType.getColumnDataTypeLabel() + "," + columnId + ")";
}
}

View File

@ -9,16 +9,21 @@ public class C_ColumnReferencePlaceholder extends C_Leaf {
protected String columnId;
protected ColumnDataType dataType;
public C_ColumnReferencePlaceholder(){
public C_ColumnReferencePlaceholder() {
}
public C_ColumnReferencePlaceholder(ColumnDataType dataType, String columnId) {
this.dataType = dataType;
this.columnId = columnId;
if (dataType != null && columnId != null) {
this.readableExpression = "PlaceHolder("
+ dataType.getColumnDataTypeLabel() +
"," + columnId + ")";
}
}
@Override
public String getId() {
return id;

View File

@ -14,6 +14,18 @@ public class C_ConstantList extends C_Leaf implements C_MultivaluedExpression {
public C_ConstantList(List<TD_Value> arguments) {
this.arguments = arguments;
String cList=new String();
for(TD_Value tdValue:arguments){
if(tdValue!=null){
if(cList.isEmpty()){
cList=cList.concat(tdValue.getReadableExpression());
} else {
cList=cList.concat(",").concat(tdValue.getReadableExpression());
}
}
}
this.readableExpression = "CostantList("+cList+")";
}
@Override
@ -35,12 +47,19 @@ public class C_ConstantList extends C_Leaf implements C_MultivaluedExpression {
this.arguments = arguments;
}
@Override
public String getReadableMultivaluedString() {
return readableExpression;
}
@Override
public String toString() {
return "ConstantList [id=" + id + ", arguments=" + arguments + "]";
}

View File

@ -10,7 +10,7 @@ public class C_Leaf extends C_Expression {
protected String id="Leaf";
public C_Leaf(){
this.readableExpression = "Leaf()";
}
@Override

View File

@ -10,26 +10,30 @@ public class C_Range extends C_Leaf implements C_MultivaluedExpression {
protected TD_Value minimum;
protected TD_Value maximum;
public C_Range(){
public C_Range() {
}
public C_Range(TD_Value minimum, TD_Value maximum) {
this.minimum = minimum;
this.maximum = maximum;
if (minimum != null && maximum != null) {
this.readableExpression = "Range("
+ minimum.getReadableExpression() + ","
+ maximum.getReadableExpression() + ")";
}
}
@Override
public String getId() {
return id;
}
@Override
public String getIdMulti() {
return id;
}
public TD_Value getMinimum() {
return minimum;
}
@ -46,6 +50,11 @@ public class C_Range extends C_Leaf implements C_MultivaluedExpression {
this.maximum = maximum;
}
@Override
public String getReadableMultivaluedString() {
return readableExpression;
}
@Override
public String toString() {
return "Range [id=" + id + ", minimum=" + minimum + ", maximum="

View File

@ -5,19 +5,24 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataT
public class TD_Value extends C_Leaf {
private static final long serialVersionUID = 2802022467528178596L;
protected String id="TD_Value";
protected String id = "TD_Value";
protected String value;
protected ColumnDataType valueType;
public TD_Value(){
public TD_Value() {
}
public TD_Value(ColumnDataType valueType, String value){
this.valueType=valueType;
this.value=value;
public TD_Value(ColumnDataType valueType, String value) {
this.valueType = valueType;
this.value = value;
if (valueType != null) {
this.readableExpression = "TDValue("
+ valueType.getColumnDataTypeLabel() + "," + value + ")";
}
}
@Override
public String getId() {
return id;
@ -43,7 +48,5 @@ public class TD_Value extends C_Leaf {
public String toString() {
return "TD_Value [value=" + value + ", valueType=" + valueType + "]";
}
}

View File

@ -23,10 +23,35 @@ public class C_And extends C_Expression {
public C_And(C_Expression... arguments) {
this.arguments = Arrays.asList(arguments);
String cList=new String();
for(C_Expression arg:arguments){
if(arg!=null){
if(cList.isEmpty()){
cList=cList.concat(arg.getReadableExpression());
} else {
cList=cList.concat(",").concat(arg.getReadableExpression());
}
}
}
this.readableExpression = "And("+cList+")";
}
public C_And(List<C_Expression> arguments) {
this.arguments = arguments;
String cList=new String();
for(C_Expression arg:arguments){
if(arg!=null){
if(cList.isEmpty()){
cList=cList.concat(arg.getReadableExpression());
} else {
cList=cList.concat(",").concat(arg.getReadableExpression());
}
}
}
this.readableExpression = "And("+cList+")";
}
public C_OperatorType getOperator() {

View File

@ -24,6 +24,11 @@ public class C_Between extends C_Expression {
public C_Between(C_Expression leftArgument, C_Range rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Between("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}

View File

@ -21,6 +21,10 @@ public class C_IsNotNull extends C_Expression {
public C_IsNotNull(C_Expression argument) {
this.argument = argument;
if (argument != null) {
this.readableExpression = "IsNotNull("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {

View File

@ -21,6 +21,10 @@ public class C_IsNull extends C_Expression {
public C_IsNull(C_Expression argument) {
this.argument=argument;
if (argument != null) {
this.readableExpression = "IsNull("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {

View File

@ -20,6 +20,10 @@ public class C_Not extends C_Expression {
public C_Not(C_Expression argument) {
this.argument = argument;
if (argument != null) {
this.readableExpression = "Not("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {

View File

@ -23,10 +23,35 @@ public class C_Or extends C_Expression {
public C_Or(C_Expression... arguments) {
this.arguments = Arrays.asList(arguments);
String cList=new String();
for(C_Expression arg:arguments){
if(arg!=null){
if(cList.isEmpty()){
cList=cList.concat(arg.getReadableExpression());
} else {
cList=cList.concat(",").concat(arg.getReadableExpression());
}
}
}
this.readableExpression = "Or("+cList+")";
}
public C_Or(List<C_Expression> arguments) {
this.arguments = arguments;
String cList=new String();
for(C_Expression arg:arguments){
if(arg!=null){
if(cList.isEmpty()){
cList=cList.concat(arg.getReadableExpression());
} else {
cList=cList.concat(",").concat(arg.getReadableExpression());
}
}
}
this.readableExpression = "Or("+cList+")";
}
public C_OperatorType getOperator() {

View File

@ -24,6 +24,11 @@ public class C_ValueIsIn extends C_Expression {
public C_ValueIsIn(C_Expression leftArgument, C_MultivaluedExpression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "ValueIsIn("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableMultivaluedString() + ")";
}
}
public C_OperatorType getOperator() {