| 1 | package tmcsim.cadsimulator.videocontrol; |
|---|
| 2 | |
|---|
| 3 | /** |
|---|
| 4 | * DVDStatusUpdate is a container class used to notify observers of a DVD |
|---|
| 5 | * Controller when a status update occurs. The DVD's connection is used to |
|---|
| 6 | * uniquely identify a DVD player. So this connection information String should |
|---|
| 7 | * always be the same for all updates. The Abstract DVDController defines a |
|---|
| 8 | * getConnectionInfo() method that may be used for this purpise. The isConnected |
|---|
| 9 | * should also always be set. However, the Throwable object may be unused (null) |
|---|
| 10 | * if the DVDStatusUpdate is not reporting an exception. Otherwise, the Throwable |
|---|
| 11 | * will be the cause of the status update. |
|---|
| 12 | * |
|---|
| 13 | * @author Matthew Cechini |
|---|
| 14 | * @version |
|---|
| 15 | */ |
|---|
| 16 | public class DVDStatusUpdate { |
|---|
| 17 | |
|---|
| 18 | /** DVD player connection info. */ |
|---|
| 19 | public String connectionInfo = null; |
|---|
| 20 | |
|---|
| 21 | /** Boolean flag to designate whether the DVD Controller is connected. */ |
|---|
| 22 | public boolean isConnected = false; |
|---|
| 23 | |
|---|
| 24 | /** An Exception that has been thrown from the DVD controller. (Optional) */ |
|---|
| 25 | public Throwable exception = null; |
|---|
| 26 | |
|---|
| 27 | /** |
|---|
| 28 | * Constructor. |
|---|
| 29 | * |
|---|
| 30 | * @param connInfo DVD connection info. |
|---|
| 31 | * @param connected Boolean connected flag. |
|---|
| 32 | * @param e Exception caught in DVD Controller. |
|---|
| 33 | */ |
|---|
| 34 | public DVDStatusUpdate(String connInfo, boolean connected, Throwable e) |
|---|
| 35 | { |
|---|
| 36 | connectionInfo = connInfo; |
|---|
| 37 | isConnected = connected; |
|---|
| 38 | exception = e; |
|---|
| 39 | |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 42 | /** |
|---|
| 43 | * Constructor. |
|---|
| 44 | * |
|---|
| 45 | * @param connInfo DVD connection info. |
|---|
| 46 | * @param connected Boolean connected flag. |
|---|
| 47 | */ |
|---|
| 48 | public DVDStatusUpdate(String connInfo, boolean connected) |
|---|
| 49 | { |
|---|
| 50 | connectionInfo = connInfo; |
|---|
| 51 | isConnected = connected; |
|---|
| 52 | exception = null; |
|---|
| 53 | |
|---|
| 54 | } |
|---|
| 55 | |
|---|
| 56 | } |
|---|