User`s manual

5 Calling Java from MATLAB
5-82
pb_htable.put(pb_keyfilter(name),entry);
disp ' '
disp(sprintf('The entry for %s has been changed', name));
Description of Function pb_listall
The pb_listall function takes one argument, the Properties object
pb_htable. The function calls propertyNames on the pb_htable object to return
to
enum a java.util.Enumeration object, which supports convenient
enumeration of all the keys. In a
while loop, pb_listall calls
hasMoreElements on enum, and if it returns true, pb_listall calls nextElement
on
enum to return the next key. It then calls pb_display to display the key and
entry, which it retrieves by calling
get on pb_htable with the key.
function pb_listall(pb_htable)
enum = pb_htable.propertyNames;
while enum.hasMoreElements
key = enum.nextElement;
pb_display(pb_htable.get(key));
end;
Description of Function pb_display
The pb_display function takes an argument entry, which is a phone book
entry. After displaying a horizontal line,
pb_display calls MATLAB function
strtok to extract the first line the entry, up to the line delimiter (^), into t and
and the remainder into
r. Then, within a while loop that terminates when t is
empty, it displays the current line in
t. Then it calls strtok to extract the next
line from
r, into t. When all lines have been displayed, pb_display indicates
the end of the entry by displaying another horizontal line.
function pb_display(entry)
disp ' '
disp '-------------------------'
[t,r] = strtok(entry,'^');
while ~isempty(t)
disp(sprintf(' %s',t));
[t,r] = strtok(r,'^');
end;
disp '-------------------------'