PageRenderTime 213ms CodeModel.GetById 130ms app.highlight 4ms RepoModel.GetById 77ms app.codeStats 0ms

/src/org/ooc/frontend/model/FloatLiteral.java

http://github.com/nddrylliog/ooc
Java | 46 lines | 33 code | 13 blank | 0 comment | 0 complexity | 0563100beec3f0784e8d21e18dbc2c1a MD5 | raw file
 1package org.ooc.frontend.model;
 2
 3import java.io.IOException;
 4
 5import org.ooc.frontend.Visitor;
 6import org.ooc.frontend.model.tokens.Token;
 7
 8public class FloatLiteral extends Literal {
 9
10	protected double value;
11	public static Type type = new Type("Float", Token.defaultToken);
12
13	public FloatLiteral(double value, Token startToken) {
14		super(startToken);
15		this.value = value;
16	}
17
18	@Override
19	public boolean replace(Node oldie, Node kiddo) {
20		return false;
21	}
22
23	public Type getType() {
24		return type;
25	}
26	
27	public double getValue() {
28		return value;
29	}
30
31	public void accept(Visitor visitor) throws IOException {
32		visitor.visit(this);
33	}
34
35	public void acceptChildren(Visitor visitor) throws IOException {}
36
37	public boolean hasChildren() {
38		return false;
39	}
40	
41	@Override
42	public String toString() {
43		return String.valueOf(value);
44	}
45
46}