uk.co.keang.callerid.driver
Class CallerIDEvent

java.lang.Object
  extended by java.util.EventObject
      extended by uk.co.keang.callerid.driver.CallerIDEvent
All Implemented Interfaces:
java.io.Serializable

public class CallerIDEvent
extends java.util.EventObject

A caller ID event generated when there is an incoming call. The source object is of type CallerIDMessage which contains details about the incoming call. This event also has convenience methods for the commonly required details to save having to directly access the source object

Version:
1.0 - 15 Jan 2014
Author:
Keang
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CallerIDEvent(CallerIDMessage dec)
          Create the event object
 
Method Summary
 java.util.Date getDate()
          Gets the callers date and time
 java.lang.String getNumber()
          Gets the callers telephone number if there is one
 boolean hasNumber()
          true if the message contains a number
 java.lang.String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CallerIDEvent

public CallerIDEvent(CallerIDMessage dec)
Create the event object

Parameters:
dec - The decoder
Method Detail

hasNumber

public boolean hasNumber()
true if the message contains a number

Returns:
true if there is a phone number

getNumber

public java.lang.String getNumber()
Gets the callers telephone number if there is one

Returns:
the callers telephone number or null

getDate

public java.util.Date getDate()
Gets the callers date and time

Returns:
the callers date and time or null

toString

public java.lang.String toString()
Overrides:
toString in class java.util.EventObject