SCCT.JavaSubscriber
Class SCCT_Observer

java.lang.Object
  extended by SCCT.JavaSubscriber.SCCT_Observer

public abstract class SCCT_Observer
extends java.lang.Object

It is a fundamental class of this library.
It is an abstract class and must be extended.
This class define an interface for all concrete observers, to receive data or manage events coming from subject.


Constructor Summary
SCCT_Observer()
           
SCCT_Observer(boolean guiThread)
           
 
Method Summary
 void analogDataListener(SCCT_AnalogDataPackage adp)
          This is a listener of analog data that is called back when an analog data package is received.
 void arrayListener(SCCT_2DArrayPackage arrayPackage)
          This is a listener that is called back when an array package of any type is received.
 void boolArrayListener(SCCT_2DBoolArray boolArray)
          This is a listener that is called back when a boolean array package is received.
 void configurationListener(SCCT_ConfigurationPackage cp)
          This is a listener that is called back when a configuration package is received.
 void digitalDataListener(SCCT_DigitalDataPackage ddp)
          This is a listener of digital data that is called back when a digital data package is received.
 void doubleArrayListener(SCCT_2DDoubleArray doubleArray)
          This is a listener that is called back when a double array package is received.
 void errorListener(SCCT_ErrorPackage errorPackage)
          This is a listener that is called back when it triggers off an error.
 void fileListener(SCCT_FilePackage filePackage)
          This is a listener that is called back when a file package is received.
 void floatArrayListener(SCCT_2DFloatArray floatArray)
          This is a listener that is called back when a float array package is received.
 int getAwaitingPackages()
          Gets the number of package that have to be processed.
 void imageListener(SCCT_ImagePackage imagePackage)
          This is a listener that is called back when an image package is received.
 void integerArrayListener(SCCT_2DIntegerArray integerArray)
          This is a listener that is called back when a integer array package is received.
 void locationListener(SCCT_LocationPackage locationPackage)
          This is a listener that is called back when a new location package is received.
 void longArrayListener(SCCT_2DLongArray longArray)
          This is a listener that is called back when a long array package is received.
 void messageListener(SCCT_MessagePackage ap)
          This is a listener that is called back when a message package is received.
 void onConnected(SCCT_Subject subject)
          This method is called back when a new connection is established.
 void onConnecting(SCCT_Subject subject)
          This method is called back when openCommunication method of SCCT_Subject is called and new connection is trying to start.
 void onDisconnected(SCCT_Subject subject)
          This method is called back when a connection is closed.
 void shortArrayListener(SCCT_2DShortArray shortArray)
          This is a listener that is called back when a short array package is received.
 void stringArrayListener(SCCT_2DStringArray stringArray)
          This is a listener that is called back when a string array package is received.
 void xmlListener(SCCT_XmlPackage xmlPackage)
          This is a listener that is called back when a xml data package is received.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SCCT_Observer

public SCCT_Observer()

SCCT_Observer

public SCCT_Observer(boolean guiThread)
Method Detail

getAwaitingPackages

public int getAwaitingPackages()
Gets the number of package that have to be processed.
If this number grows, means that the application is not processing fast enough packets received.
In this case the developer must optimize code
or ,if is possible, tells the producer's developer to send fewer packets
or stops the data transmission with the stopCommunication method of the Subject.

Returns:
The number of package that have to be processed.

onConnected

public void onConnected(SCCT_Subject subject)
This method is called back when a new connection is established.

Parameters:
subject - The SCCT_Subject that has trigger the event.
See Also:
SCCT_Subject

onDisconnected

public void onDisconnected(SCCT_Subject subject)
This method is called back when a connection is closed. A connection can be closed by calling closeCommunication() method of SCCT_Subject or as a result of a communication error.

Parameters:
subject - The SCCT_Subject that has trigger the event.
See Also:
SCCT_Subject

onConnecting

public void onConnecting(SCCT_Subject subject)
This method is called back when openCommunication method of SCCT_Subject is called and new connection is trying to start.

Parameters:
subject - The SCCT_Subject that has trigger the event.
See Also:
SCCT_Subject

analogDataListener

public void analogDataListener(SCCT_AnalogDataPackage adp)
This is a listener of analog data that is called back when an analog data package is received.

Parameters:
adp - It is an analog data package that contains the data of the channels.
See Also:
AnalogDataPackage

digitalDataListener

public void digitalDataListener(SCCT_DigitalDataPackage ddp)
This is a listener of digital data that is called back when a digital data package is received.

Parameters:
ddp - It is a digital data package that contains the data of the lines.
See Also:
DigitalDataPackage

configurationListener

public void configurationListener(SCCT_ConfigurationPackage cp)
This is a listener that is called back when a configuration package is received.
It is an important method because it shows all configurations of lines and channels to developer.
The ConfigurationPackage object shows how many channels and lines there are.
For each channel and line,it provides an object which contains their configuration.
Each time the configuration changes, the producer sends a new ConfigurationPackage.

Parameters:
cp - It is a configuration package that contains all lines and channels configurations.
See Also:
ConfigurationPackage

messageListener

public void messageListener(SCCT_MessagePackage ap)
This is a listener that is called back when a message package is received.

Parameters:
ap - It is a message package that contains custom message and code sent from the producer.
See Also:
MessagePackage

errorListener

public void errorListener(SCCT_ErrorPackage errorPackage)
This is a listener that is called back when it triggers off an error.
This is a very important method because it warns the developer if there are errors.
You can see which errors are handled by looking constans in the ErrorPackage class.
If this message arrives, the communication is interrupted.

Parameters:
ep - It is a error package that contains the description and the code of the error.
See Also:
ErrorPackage

xmlListener

public void xmlListener(SCCT_XmlPackage xmlPackage)
This is a listener that is called back when a xml data package is received.
The library doesn't check if the xml is correct.
This method isn't abstract and can be overridden only if you need.

Parameters:
xmlPackage - It is a xml package that contains custom xml sent from the producer.
See Also:
XmlPackage

fileListener

public void fileListener(SCCT_FilePackage filePackage)
This is a listener that is called back when a file package is received.
This method isn't abstract and can be overridden only if you need. *This method is available only in PRO version.*

Parameters:
filePackage - It is a file package that contains the file sent from the producer.
See Also:
FilePackage

imageListener

public void imageListener(SCCT_ImagePackage imagePackage)
This is a listener that is called back when an image package is received.
This method isn't abstract and can be overridden only if you need. *This method is available only in PRO version.*

Parameters:
imagePackage - It is an image package that contains the image sent from the producer.
See Also:
ImagePackage

locationListener

public void locationListener(SCCT_LocationPackage locationPackage)
This is a listener that is called back when a new location package is received.
*This method is available only in PRO version.*

Parameters:
locationPackage - It is the location package that contains the locations sent from the producer.
See Also:
LocationPackage

arrayListener

public void arrayListener(SCCT_2DArrayPackage arrayPackage)
This is a listener that is called back when an array package of any type is received.
*This method is available only in PRO version.*

Parameters:
arrayPackage - It's a a generic array package that you have to cast accordingly to its type.
See Also:
SCCT_2DArrayPackage

stringArrayListener

public void stringArrayListener(SCCT_2DStringArray stringArray)
This is a listener that is called back when a string array package is received.
*This method is available only in PRO version.*

Parameters:
stringArray - It's the received string array package.
See Also:
SCCT_2DStringArray

doubleArrayListener

public void doubleArrayListener(SCCT_2DDoubleArray doubleArray)
This is a listener that is called back when a double array package is received.
*This method is available only in PRO version.*

Parameters:
double - It's the received double array package.
See Also:
SCCT_2DDoubleArray

floatArrayListener

public void floatArrayListener(SCCT_2DFloatArray floatArray)
This is a listener that is called back when a float array package is received.
*This method is available only in PRO version.*

Parameters:
floatPackage - It's the received float array package.
See Also:
SCCT_2DFloatArray

integerArrayListener

public void integerArrayListener(SCCT_2DIntegerArray integerArray)
This is a listener that is called back when a integer array package is received.
*This method is available only in PRO version.*

Parameters:
integerArray - It's the received integer array package.
See Also:
SCCT_2DIntegerArray

shortArrayListener

public void shortArrayListener(SCCT_2DShortArray shortArray)
This is a listener that is called back when a short array package is received.
*This method is available only in PRO version.*

Parameters:
shortArray - It's the received short array package.
See Also:
SCCT_2DShortArray

longArrayListener

public void longArrayListener(SCCT_2DLongArray longArray)
This is a listener that is called back when a long array package is received.
*This method is available only in PRO version.*

Parameters:
longArray - It's the received long array package.
See Also:
SCCT_2DLongArray

boolArrayListener

public void boolArrayListener(SCCT_2DBoolArray boolArray)
This is a listener that is called back when a boolean array package is received.
*This method is available only in PRO version.*

Parameters:
boolArray - It's the received boolean array package.
See Also:
SCCT_2DBoolArray