|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.netlib.util.EasyIn
public class EasyIn
Simple input from the keyboard for all primitive types. ver 1.0
Copyright (c) Peter van der Linden, May 5 1997. corrected error message 11/21/97
The creator of this software hereby gives you permission to:
This is not thread safe, not high performance, and doesn't tell EOF. It's intended for low-volume easy keyboard input. An example of use is:
EasyIn easy = new EasyIn();
int i = easy.readInt(); // reads an int from System.in
float f = easy.readFloat(); // reads a float from System.in
2/25/98 - modified by Keith Seymour to be useful with the f2j translator.
Constructor Summary | |
---|---|
EasyIn()
|
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
This method is just here to test the class |
boolean |
readboolean()
Gets a boolean value from the next token. |
boolean |
readBoolean()
Gets a boolean value from the next token. |
byte |
readbyte()
Gets a byte value from the next token. |
byte |
readByte()
Gets a byte value from the next token. |
char |
readchar()
Gets a character value from the next token. |
char |
readChar()
Gets a character value from the next token. |
java.lang.String |
readchars(int num_chars)
Reads the specified number of characters and returns a new String containing them. |
java.lang.String |
readChars(int num_chars)
Reads the specified number of characters and returns a new String containing them. |
double |
readdouble()
Gets a double value from the next token. |
double |
readDouble()
Gets a double value from the next token. |
float |
readfloat()
Gets a float value from the next token. |
float |
readFloat()
Gets a float value from the next token. |
int |
readint()
Gets an integer value from the next token. |
int |
readInt()
Gets an integer value from the next token. |
long |
readlong()
Gets a long integer value from the next token. |
long |
readLong()
Gets a long integer value from the next token. |
short |
readshort()
Gets a short value from the next token. |
short |
readShort()
Gets a short value from the next token. |
java.lang.String |
readstring()
Gets a string value from the next token. |
java.lang.String |
readString()
Gets a string value from the next token. |
void |
skipRemaining()
Skips any tokens remaining on this line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EasyIn()
Method Detail |
---|
public java.lang.String readchars(int num_chars) throws java.io.IOException
num_chars
- the number of characters to read
java.io.IOException
- if an input or output exception occurred.public java.lang.String readChars(int num_chars)
num_chars
- the number of characters to read
public void skipRemaining()
public boolean readboolean() throws java.io.IOException
java.io.IOException
- if an input or output exception occurred.public boolean readBoolean()
public byte readbyte() throws java.io.IOException
java.io.IOException
- if an input or output exception occurred.public byte readByte()
public short readshort() throws java.io.IOException
java.io.IOException
- if an input or output exception occurred.public short readShort()
public int readint() throws java.io.IOException
java.io.IOException
- if an input or output exception occurred.public int readInt()
public long readlong() throws java.io.IOException
java.io.IOException
- if an input or output exception occurred.public long readLong()
public float readfloat() throws java.io.IOException
java.io.IOException
- if an input or output exception occurred.public float readFloat()
public double readdouble() throws java.io.IOException
java.io.IOException
- if an input or output exception occurred.public double readDouble()
public char readchar() throws java.io.IOException
java.io.IOException
- if an input or output exception occurred.public char readChar()
public java.lang.String readstring() throws java.io.IOException
java.io.IOException
- if an input or output exception occurred.public java.lang.String readString()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |