External Interfaces/API |
Description of Function pb_lookup
Arguments passed to pb_lookup
are the Properties
object pb_htable
and the name
key for the requested entry. The pb_lookup
function first calls get
on pb_htable
with the name
key, on which support function pb_keyfilter
is called to change spaces to underscores. The get
method returns the entry (or null, if the entry is not found) to variable entry
. Note that get
takes an argument of type java.lang.Object
and also returns an argument of that type. In this invocation, the key passed to get
and the entry returned from it are actually character arrays.
pb_lookup
then calls isempty
to determine whether entry
is null
. If it is, it uses disp
to display an message stating that the name was not found. If entry
is not null
, it calls pb_display
to display the entry.
function pb_lookup(pb_htable,name) entry = pb_htable.get(pb_keyfilter(name)); if isempty(entry), disp(sprintf('The name %s is not in the phone book',name)); else pb_display(entry); end
Description of Function phonebook | Description of Function pb_add |