Consider the fashionable subject of JavaBeans. (It
doesn't actually matter if you have never heard of JavaBeans.) Their only
feature of interest for the present exercise is that a rigid convention
is used to classify the names that programmers define when they
construct a JavaBean. If PropName is what they call
a property name, then there will be some methods associated
with it. In particular, there will be a method whose name is of the
form getPropName, which is called a get
method for PropName. Similarly, setPropName is
a set
method for PropName. If PropName is the name of a
Boolean property, though, its get method is called
isPropName, and is a test method.
If EvName is something called an event name, then
addEvNameListener is a listener adding
method, while removeEvNameListener is
a listener removing method. Property and event names always begin with
an upper-case letter. Write a Perl script that takes a file of method
names and classifies them, identifying the property and event names.
Your script should produce output like the following:
addTimerListener : listener adder for Timer event
setFileName : set method for FileName property
isFileOpen : test method for Boolean property FileOpen
[Hints/Solution |
Test data for 4.2]