1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package io.github.prolobjectlink.prolog.jlog;
23
24 import static io.github.prolobjectlink.prolog.PrologTermType.INTEGER_TYPE;
25
26 import io.github.prolobjectlink.prolog.PrologInteger;
27 import io.github.prolobjectlink.prolog.PrologProvider;
28 import io.github.prolobjectlink.prolog.PrologTerm;
29 import ubc.cs.JLog.Terms.jInteger;
30 import ubc.cs.JLog.Terms.jTerm;
31
32
33
34
35
36
37 class JLogInteger extends JLogNumber implements PrologInteger {
38
39 JLogInteger(PrologProvider provider, Number value) {
40 super(INTEGER_TYPE, provider, new jInteger(value.intValue()));
41 }
42
43 JLogInteger(int type, PrologProvider provider, jTerm value) {
44 super(type, provider, value);
45 }
46
47 public final long getLongValue() {
48 return (long) getIntegerValue();
49 }
50
51 public final double getDoubleValue() {
52 return (double) getIntegerValue();
53 }
54
55 public final int getIntegerValue() {
56 return ((jInteger) value).getIntegerValue();
57 }
58
59 public final float getFloatValue() {
60 return (float) getIntegerValue();
61 }
62
63 public final PrologTerm[] getArguments() {
64 return new JLogInteger[0];
65 }
66
67 }