Package astra.lang
Class Console
- java.lang.Object
-
- astra.core.Module
-
- astra.lang.Console
-
public class Console extends Module
This API provides support for I/O via the Java console. It does this via java.lang.System.in and java.lang.System.out respectively.- Author:
- Rem Collier
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class astra.core.Module
Module.ACTION, Module.EVENT, Module.FORMULA, Module.SENSOR, Module.SUPPRESS_NOTIFICATIONS, Module.TERM
-
-
Constructor Summary
Constructors Constructor Description Console()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanprint(Formula formula)Action to print a formula (no new line).booleanprint(Boolean value)Action to print a boolean (no new line).booleanprint(Character value)Action to print a char (no new line).booleanprint(Double value)Action to print a double (no new line).booleanprint(Float value)Action to print a float (no new line).booleanprint(Integer value)Action to print a integer (no new line).booleanprint(Long value)Action to print a long (no new line).booleanprint(Object obj)Action to print an object (no new line).booleanprint(String value)Action to print a string (no new line).booleanprintClassName(Object obj)Action to print the canonical class name of an object.booleanprintln(Formula formula)Action to print a formula followed by a new line.booleanprintln(Funct funct)Action to print a string followed by a new line.booleanprintln(ListTerm list)Action to print an ASTRA list followed by a new line.booleanprintln(Boolean bool)Action to print a boolean followed by a new line.booleanprintln(Character value)Action to print a char followed by a new line.booleanprintln(Double value)Action to print a double followed by a new line.booleanprintln(Float value)Action to print a float followed by a new line.booleanprintln(Integer integer)Action to print a int followed by a new line.booleanprintln(Long value)Action to print a long followed by a new line.booleanprintln(Object obj)Action to print an object followed by a new line.booleanprintln(String string)Action to print a string followed by a new line.booleanreadDouble(ActionParam<Double> value)Action to read an double value from the console.booleanreadFloat(ActionParam<Float> value)Action to read an float value from the console.booleanreadInt(ActionParam<Integer> value)Action to read an integer value from the console.booleanreadLong(ActionParam<Long> value)Action to read an long value from the console.booleanreadString(ActionParam<String> value)Action to read a string value from the console.
-
-
-
Method Detail
-
println
public boolean println(String string)
Action to print a string followed by a new line.- Parameters:
string- the string to be output- Returns:
- true if the action is successful, false otherwise
-
println
public boolean println(Funct funct)
Action to print a string followed by a new line.- Parameters:
funct- the string to be output- Returns:
- true if the action is successful, false otherwise
-
println
public boolean println(Formula formula)
Action to print a formula followed by a new line.- Parameters:
formula- the formula to be output- Returns:
- true if the action is successful, false otherwise
-
println
public boolean println(Integer integer)
Action to print a int followed by a new line.- Parameters:
integer- the int to be output- Returns:
- true if the action is successful, false otherwise
-
println
public boolean println(Long value)
Action to print a long followed by a new line.- Parameters:
value- the long to be output- Returns:
- true if the action is successful, false otherwise
-
println
public boolean println(Float value)
Action to print a float followed by a new line.- Parameters:
value- the float to be output- Returns:
- true if the action is successful, false otherwise
-
println
public boolean println(Double value)
Action to print a double followed by a new line.- Parameters:
value- the double to be output- Returns:
- true if the action is successful, false otherwise
-
println
public boolean println(Character value)
Action to print a char followed by a new line.- Parameters:
value- the char to be output- Returns:
- true if the action is successful, false otherwise
-
println
public boolean println(Boolean bool)
Action to print a boolean followed by a new line.- Parameters:
bool- the boolean to be output- Returns:
- true if the action is successful, false otherwise
-
println
public boolean println(ListTerm list)
Action to print an ASTRA list followed by a new line.- Parameters:
list- the ASTRA list to be output- Returns:
- true if the action is successful, false otherwise
-
println
public boolean println(Object obj)
Action to print an object followed by a new line.- Parameters:
obj- the object to be output- Returns:
- true if the action is successful, false otherwise
-
print
public boolean print(Long value)
Action to print a long (no new line).- Parameters:
value- the long to be output- Returns:
- true if the action is successful, false otherwise
-
print
public boolean print(Float value)
Action to print a float (no new line).- Parameters:
value- the float to be output- Returns:
- true if the action is successful, false otherwise
-
print
public boolean print(Double value)
Action to print a double (no new line).- Parameters:
value- the double to be output- Returns:
- true if the action is successful, false otherwise
-
print
public boolean print(Integer value)
Action to print a integer (no new line).- Parameters:
value- the integer to be output- Returns:
- true if the action is successful, false otherwise
-
print
public boolean print(String value)
Action to print a string (no new line).- Parameters:
value- the string to be output- Returns:
- true if the action is successful, false otherwise
-
print
public boolean print(Boolean value)
Action to print a boolean (no new line).- Parameters:
value- the boolean to be output- Returns:
- true if the action is successful, false otherwise
-
print
public boolean print(Character value)
Action to print a char (no new line).- Parameters:
value- the char to be output- Returns:
- true if the action is successful, false otherwise
-
print
public boolean print(Formula formula)
Action to print a formula (no new line).- Parameters:
formula- the formula to be output- Returns:
- true if the action is successful, false otherwise
-
print
public boolean print(Object obj)
Action to print an object (no new line).- Parameters:
obj- the object to be output- Returns:
- true if the action is successful, false otherwise
-
printClassName
public boolean printClassName(Object obj)
Action to print the canonical class name of an object.- Parameters:
obj- the object.- Returns:
- true if the action is successful, false otherwise
-
readInt
public boolean readInt(ActionParam<Integer> value)
Action to read an integer value from the console.- Parameters:
value- a container for holding the value.- Returns:
- true if the action is successful, false otherwise
-
readLong
public boolean readLong(ActionParam<Long> value)
Action to read an long value from the console.- Parameters:
value- a container for holding the value.- Returns:
- true if the action is successful, false otherwise
-
readFloat
public boolean readFloat(ActionParam<Float> value)
Action to read an float value from the console.- Parameters:
value- a container for holding the value.- Returns:
- true if the action is successful, false otherwise
-
readDouble
public boolean readDouble(ActionParam<Double> value)
Action to read an double value from the console.- Parameters:
value- a container for holding the value.- Returns:
- true if the action is successful, false otherwise
-
readString
public boolean readString(ActionParam<String> value)
Action to read a string value from the console.- Parameters:
value- a container for holding the value.- Returns:
- true if the action is successful, false otherwise
-
-