2015-05-06 18:48:49 +02:00
|
|
|
package org.gcube.portlets.user.td.expressionwidget.client.multicolumn;
|
|
|
|
|
2015-05-07 19:37:23 +02:00
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.List;
|
|
|
|
|
2015-05-06 18:48:49 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
2017-05-15 12:49:43 +02:00
|
|
|
* @author Giancarlo Panichi
|
|
|
|
*
|
2015-05-06 18:48:49 +02:00
|
|
|
*
|
|
|
|
*/
|
2015-05-07 19:37:23 +02:00
|
|
|
public enum DepthOfExpressionType {
|
2015-05-11 18:38:54 +02:00
|
|
|
BOTTOM("Cond."),
|
2015-05-07 19:37:23 +02:00
|
|
|
STARTOR("Or("),
|
|
|
|
ENDOR(")"),
|
|
|
|
STARTAND("And["),
|
|
|
|
ENDAND("]"),
|
|
|
|
COMMA(",");
|
2015-05-06 18:48:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param text
|
|
|
|
*/
|
|
|
|
private DepthOfExpressionType(final String id) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
private final String id;
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
2015-05-07 19:37:23 +02:00
|
|
|
public String getLabel() {
|
2015-05-06 18:48:49 +02:00
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
2015-05-07 19:37:23 +02:00
|
|
|
public static List<DepthOfExpressionType> asList(){
|
|
|
|
return Arrays.asList(values());
|
|
|
|
}
|
2015-05-06 18:48:49 +02:00
|
|
|
|
|
|
|
public static DepthOfExpressionType getColumnDataTypeFromId(String id) {
|
2015-05-07 19:37:23 +02:00
|
|
|
for (DepthOfExpressionType type : values()) {
|
|
|
|
if (type.id.compareToIgnoreCase(id) == 0) {
|
|
|
|
return type;
|
2015-05-06 18:48:49 +02:00
|
|
|
}
|
|
|
|
}
|
2015-05-07 19:37:23 +02:00
|
|
|
|
2015-05-06 18:48:49 +02:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2015-05-07 19:37:23 +02:00
|
|
|
|
|
|
|
|
2015-05-06 18:48:49 +02:00
|
|
|
}
|