package com.jfireel.expression.node.impl;

import com.jfireel.expression.node.CalculateNode;
import com.jfireel.expression.token.Token;
import com.jfireel.expression.token.TokenType;

import java.util.Map;

public class TypeNode implements CalculateNode {
	private Class<?> ckass;
	private Token type;

	public TypeNode(Class<?> ckass, Token type) {
		this.ckass = ckass;
		this.type = type;
	}

	@Override
	public Object calculate(Map<String, Object> variables) {
		return ckass;
	}

	@Override
	public TokenType type() {
		return type;
	}

	@Override
	public String literals() {
		return ckass.getName();
	}

	public String toString() {
		return literals();
	}

}
