Package arcommon.net
Class LineConnectionThread
- java.lang.Object
-
- java.lang.Thread
-
- arcommon.MyThread
-
- arcommon.net.LineConnectionThread
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
LineClientThread
public abstract class LineConnectionThread extends MyThread
-
-
Field Summary
-
Fields inherited from class arcommon.MyThread
DEFAULT_TIMEOUT
-
-
Constructor Summary
Constructors Constructor Description LineConnectionThread()LineConnectionThread(LineConnection plineConnection)LineConnectionThread(java.lang.String name)LineConnectionThread(java.lang.String name, LineConnection plineConnection)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected voiddoLoop()LineConnectiongetLineConnection()booleanisConnected()protected abstract voidonDisconnect()protected abstract voidonReadLine(java.lang.String line)java.lang.StringreadLine()intreadNumber()voidsendLine(java.lang.String text)voidsendNumber(int number)voidsetLineConnection(LineConnection plineConnection)-
Methods inherited from class arcommon.MyThread
afterLoop, beforeLoop, blockUntilStopped, blockUntilStoppedWithTimeout, blockUntilStoppedWithTimeout, isRequestedToStop, requestToStop, run, setRequestedToStop
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
LineConnectionThread
public LineConnectionThread()
-
LineConnectionThread
public LineConnectionThread(LineConnection plineConnection)
-
LineConnectionThread
public LineConnectionThread(java.lang.String name)
-
LineConnectionThread
public LineConnectionThread(java.lang.String name, LineConnection plineConnection)
-
-
Method Detail
-
isConnected
public boolean isConnected()
-
sendLine
public void sendLine(java.lang.String text)
-
sendNumber
public void sendNumber(int number)
-
readLine
public java.lang.String readLine() throws LineConnectionDisconnectException
-
readNumber
public int readNumber() throws LineConnectionDisconnectException
-
close
public void close()
-
setLineConnection
public void setLineConnection(LineConnection plineConnection)
-
getLineConnection
public LineConnection getLineConnection()
-
onReadLine
protected abstract void onReadLine(java.lang.String line) throws LineConnectionDisconnectException
-
onDisconnect
protected abstract void onDisconnect()
-
-