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

@ -4,4 +4,7 @@ public interface C_MultivaluedExpression {
public String getIdMulti();
public String getReadableMultivaluedString();
}

View File

@ -21,10 +21,12 @@ public class C_ExternalReferenceExpression extends C_Expression implements
C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "ExternalReferenceExpression("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
@Override
public String getId() {
@ -52,6 +54,13 @@ public class C_ExternalReferenceExpression extends C_Expression implements
this.rightArgument = rightArgument;
}
@Override
public String getReadableMultivaluedString() {
return readableExpression;
}
@Override
public String toString() {
return "ExternalReferenceExpression [ id=" + id + ", leftArgument="

View File

@ -22,9 +22,10 @@ public class C_AggregationExpression extends C_Expression {
public C_AggregationExpression(C_Expression argument) {
this.argument = argument;
if (argument != null) {
this.readableExpression = "AggregationExpression("
+ argument.getReadableExpression() + ")";
}
}
@Override
@ -36,7 +37,6 @@ public class C_AggregationExpression extends C_Expression {
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,8 +5,8 @@ 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 {
@ -24,9 +24,11 @@ public class C_Count extends C_AggregationExpression {
*/
public C_Count(C_Expression argument) {
this.argument = argument;
if (argument != null) {
this.readableExpression = "Count("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.COUNT;
@ -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,9 +23,11 @@ public class C_ST_Extent extends C_AggregationExpression {
*/
public C_ST_Extent(C_Expression argument) {
this.argument = argument;
if (argument != null) {
this.readableExpression = "ST_Extent("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.ST_EXTENT;

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,16 +5,15 @@ 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 {
private static final long serialVersionUID = 3148009575987859751L;
private String id="Addition";
private String id = "Addition";
public C_Addition() {
@ -23,16 +22,17 @@ public class C_Addition extends C_ArithmeticExpression {
public C_Addition(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
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;
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,15 +5,14 @@ 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 {
private static final long serialVersionUID = 6678032753615890456L;
private String id="Division";
private String id = "Division";
public C_Division() {
@ -22,16 +21,17 @@ public class C_Division extends C_ArithmeticExpression {
public C_Division(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
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

@ -14,8 +14,6 @@ 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;
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,15 +5,14 @@ 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 {
private static final long serialVersionUID = -4068595785080246810L;
private String id="Modulus";
private String id = "Modulus";
public C_Modulus() {
@ -22,16 +21,17 @@ public class C_Modulus extends C_ArithmeticExpression {
public C_Modulus(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
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 {
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;
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,16 +5,15 @@ 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 {
private static final long serialVersionUID = 3148009575987859751L;
private String id="Subtraction";
private String id = "Subtraction";
public C_Subtraction() {
@ -23,16 +22,17 @@ public class C_Subtraction extends C_ArithmeticExpression {
public C_Subtraction(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
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,7 +10,7 @@ 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;
@ -23,10 +23,12 @@ public class C_Equals extends C_Expression {
public C_Equals(C_Expression leftArgument, C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Equals("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.EQUALS;
@ -36,13 +38,11 @@ public class C_Equals extends C_Expression {
return "Boolean";
}
@Override
public String getId() {
return id;
}
public C_Expression getLeftArgument() {
return leftArgument;
}
@ -65,6 +65,4 @@ public class C_Equals extends C_Expression {
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -16,7 +16,7 @@ public class C_GreaterOrEquals extends C_Expression {
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_GreaterOrEquals(){
public C_GreaterOrEquals() {
}
@ -24,10 +24,12 @@ public class C_GreaterOrEquals extends C_Expression {
C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "GreaterOrEquals("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.GREATER_OR_EQUALS;

View File

@ -15,17 +15,19 @@ 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;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "GreaterThan("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.GREATER;

View File

@ -15,17 +15,19 @@ 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;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "LessOrEquals("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.LESSER_OR_EQUALS;

View File

@ -15,18 +15,21 @@ 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;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "LessThan("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.LESSER;
}

View File

@ -11,21 +11,23 @@ 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;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "NotEquals("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.NOT_EQUALS;
@ -40,7 +42,6 @@ public class C_NotEquals extends C_Expression {
return id;
}
public C_Expression getLeftArgument() {
return leftArgument;
}
@ -63,5 +64,4 @@ public class C_NotEquals extends C_Expression {
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -11,21 +11,23 @@ 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;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "NotGreater("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.NOT_GREATER;
@ -35,14 +37,11 @@ public class C_NotGreater extends C_Expression {
return "Boolean";
}
@Override
public String getId() {
return id;
}
public C_Expression getLeftArgument() {
return leftArgument;
}
@ -65,6 +64,4 @@ public class C_NotGreater extends C_Expression {
+ ", rightArgument=" + rightArgument + "]";
}
}

View File

@ -15,17 +15,19 @@ 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;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "NotLess("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.NOT_LESSER;

View File

@ -17,20 +17,20 @@ public class C_Cast extends C_Expression {
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;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Cast("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getColumnDataTypeLabel() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.CAST;
@ -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){
public boolean isCastSupported(ColumnDataType sourceType,
ColumnDataType targetType) {
// from / to text
if(targetType==ColumnDataType.Text||sourceType==ColumnDataType.Text) return true;
if (targetType == ColumnDataType.Text
|| sourceType == ColumnDataType.Text)
return true;
// same class
if(sourceType==targetType) return true;
if (sourceType == targetType)
return true;
// integer <--> numeric
if((sourceType==ColumnDataType.Integer && targetType==ColumnDataType.Numeric)
|| (sourceType==ColumnDataType.Numeric && targetType==ColumnDataType.Integer))return true;
if ((sourceType == ColumnDataType.Integer && targetType == ColumnDataType.Numeric)
|| (sourceType == ColumnDataType.Numeric && targetType == ColumnDataType.Integer))
return true;
return false;
}

View File

@ -16,20 +16,20 @@ public class C_Concat extends C_Expression {
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;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Concat("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.CONCAT;
@ -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() {
}
public C_Lenght(C_Expression argument) {
this.argument=argument;
this.argument = argument;
if (argument != null) {
this.readableExpression = "Lenght("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.LENGTH;

View File

@ -16,19 +16,19 @@ public class C_Levenshtein extends C_Expression {
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;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Levenshtein("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.LEVENSHTEIN;
@ -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() {
}
public C_Lower(C_Expression argument) {
this.argument=argument;
this.argument = argument;
if (argument != null) {
this.readableExpression = "Lower("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.LOWER;
@ -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() {
}
public C_MD5(C_Expression argument) {
this.argument=argument;
this.readableExpression = "MD5("
+ argument.getReadableExpression() + ")";
this.argument = argument;
if (argument != null) {
this.readableExpression = "MD5(" + argument.getReadableExpression()
+ ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.MD5;
@ -51,8 +52,4 @@ public class C_MD5 extends C_Expression {
return "MD5 [id=" + id + ", argument=" + argument + "]";
}
}

View File

@ -16,19 +16,19 @@ public class C_Similarity extends C_Expression {
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;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "Similarity("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.SIMILARITY;
@ -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() {
}
public C_Soundex(C_Expression argument) {
this.argument=argument;
this.argument = argument;
if (argument != null) {
this.readableExpression = "Soundex("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.SOUNDEX;
@ -51,8 +52,4 @@ public class C_Soundex extends C_Expression {
return "Soundex [id=" + id + ", argument=" + argument + "]";
}
}

View File

@ -18,22 +18,22 @@ public class C_SubstringByIndex extends C_Expression {
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.fromIndex = fromIndex;
this.toIndex = toIndex;
if (sourceString != null && fromIndex != null && toIndex != null) {
this.readableExpression = "SubstringByIndex("
+ sourceString.getReadableExpression() + ","
+ fromIndex.getReadableExpression() + ","
+ toIndex.getReadableExpression() + ")";
}
}
@ -50,46 +50,34 @@ public class C_SubstringByIndex extends C_Expression {
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,14 +21,15 @@ 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;
if (sourceString != null && regex != null) {
this.readableExpression = "SubstringByRegex("
+ sourceString.getReadableExpression() + ","
+ regex.getReadableExpression() + ")";
}
}
@ -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

@ -21,18 +21,17 @@ public class C_SubstringPosition extends C_Expression {
super();
}
public C_SubstringPosition(C_Expression leftArgument,
C_Expression rightArgument) {
super();
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
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

@ -16,19 +16,20 @@ public class C_TextBeginsWith extends C_Expression {
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;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "TextBeginsWith("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.BEGINS_WITH;

View File

@ -15,17 +15,19 @@ 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;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "TextContains("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.CONTAINS;

View File

@ -15,17 +15,19 @@ 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;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "TextEndsWith("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.ENDS_WITH;

View File

@ -15,7 +15,7 @@ public class C_TextMatchSQLRegexp extends C_Expression {
protected C_Expression leftArgument;
protected C_Expression rightArgument;
public C_TextMatchSQLRegexp(){
public C_TextMatchSQLRegexp() {
}
@ -23,10 +23,12 @@ public class C_TextMatchSQLRegexp extends C_Expression {
C_Expression rightArgument) {
this.leftArgument = leftArgument;
this.rightArgument = rightArgument;
if (leftArgument != null && rightArgument != null) {
this.readableExpression = "TextMatchSQLRegexp("
+ leftArgument.getReadableExpression() + ","
+ rightArgument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.MATCH_REGEX;

View File

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

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() {
}
public C_Trim(C_Expression argument) {
this.argument=argument;
this.argument = argument;
if (argument != null) {
this.readableExpression = "Trim("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.TRIM;
@ -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() {
}
public C_Upper(C_Expression argument) {
this.argument=argument;
this.argument = argument;
if (argument != null) {
this.readableExpression = "Upper("
+ argument.getReadableExpression() + ")";
}
}
public C_OperatorType getOperator() {
return C_OperatorType.UPPER;
@ -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();
}
}
if (tableId != null && columnId != null && dataType != null) {
this.readableExpression = "ColumnReference(" + tableId + ","
+ dataType.getColumnDataTypeLabel() + "," + columnId + ")";
}
}

View File

@ -9,13 +9,18 @@ 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 + ")";
}
}

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,6 +47,11 @@ 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 + "]";
@ -44,4 +61,6 @@ public class C_ConstantList extends C_Leaf implements C_MultivaluedExpression {
}

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,13 +10,18 @@ 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
@ -29,7 +34,6 @@ public class C_Range extends C_Leaf implements C_MultivaluedExpression {
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,17 +5,22 @@ 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
@ -44,6 +49,4 @@ public class TD_Value extends C_Leaf {
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() {