org.coffeecrew.mobile.oop.impl
Class ObjectReceiver
java.lang.Object
org.coffeecrew.mobile.oop.util.Observable
org.coffeecrew.mobile.oop.impl.ObjectReceiver
- All Implemented Interfaces:
- java.lang.Runnable
public class ObjectReceiver
- extends Observable
- implements java.lang.Runnable
This class should be used on the receiving side of the transfer. This class is
observable, so you can attach an Observer object to it, to be
notified if an object was received.
ObjectReceiver usage is pretty simple, you just have to instance
it like:
new ObjectReceiver(receivedObjects);
or if you want an Observer to be
attached, simply do:
new ObjectReceiver(receivedObjects).addObserver(observer);
- Since:
- 0.1
|
Constructor Summary |
ObjectReceiver(java.util.Vector receivedObjects)
Creates a new instance of ObjectReceiver. |
|
Method Summary |
void |
run()
Starts the receiving thread. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObjectReceiver
public ObjectReceiver(java.util.Vector receivedObjects)
- Creates a new instance of ObjectReceiver.
This class is responsible for receiving the object
that is send to the remote device with the ObjectPusher class
Remember to enable discovery mode, this MAY not be required on a real
phone but if using in WTK this is needed.
- Parameters:
receivedObjects - The received object will be added to this vector
which can hold lots of objects you receive.
run
public void run()
- Starts the receiving thread.
Sets the device discoverable.
- Specified by:
run in interface java.lang.Runnable