// Path: src/main/java/com/kcthota/JSONQuery/exceptions/UnsupportedExprException.java
// @SuppressWarnings("serial")
// public class UnsupportedExprException extends RuntimeException {
// 
// 	public UnsupportedExprException(String message) {
// 		super(message);
// 	}
// 
// }


import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.DoubleNode;
import com.kcthota.JSONQuery.exceptions.UnsupportedExprException;
/**
 * 
 */
package com.kcthota.JSONQuery.expressions;


/**
 * Floor the value and returns double value
 * @author kc
 *
 */
public class FloorValueExpression extends DoubleValueExpression {

	public FloorValueExpression(String property) {
		super(property);
	}

	public FloorValueExpression(String property, ValueExpression innerExpression) {
		super(property, innerExpression);
	}

	@Override
	public JsonNode evaluate(JsonNode node) {
		JsonNode valueNode = super.evaluate(node);
		if(valueNode!=null && valueNode.isNumber()) {
			
			return DoubleNode.valueOf(Math.floor(valueNode.asDouble()));
// Path: src/main/java/com/kcthota/JSONQuery/exceptions/UnsupportedExprException.java
// @SuppressWarnings("serial")
// public class UnsupportedExprException extends RuntimeException {
// 
// 	public UnsupportedExprException(String message) {
// 		super(message);
// 	}
// 
// }


// Path: src/main/java/com/kcthota/JSONQuery/expressions/FloorValueExpression.java
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.DoubleNode;
import com.kcthota.JSONQuery.exceptions.UnsupportedExprException;

/**
 * 
 */
package com.kcthota.JSONQuery.expressions;


/**
 * Floor the value and returns double value
 * @author kc
 *
 */
public class FloorValueExpression extends DoubleValueExpression {

	public FloorValueExpression(String property) {
		super(property);
	}

	public FloorValueExpression(String property, ValueExpression innerExpression) {
		super(property, innerExpression);
	}

	@Override
	public JsonNode evaluate(JsonNode node) {
		JsonNode valueNode = super.evaluate(node);
		if(valueNode!=null && valueNode.isNumber()) {
			
			return DoubleNode.valueOf(Math.floor(valueNode.asDouble()));
		} else if (valueNode!=null && valueNode.isTextual()){