|
|
|
| |
Adapter
Adapter
is a class in Java that implements an interface
with a set of dummy methods. You can then subclass
the adapter class and override just the methods
you need. If you implemented the interface directly,
you would have to write all the dummy methods
yourself. Most commonly an adapter is used to
help you rapidly construct your own Listener
class to field events.
Adapter is also a design pattern. The Adapter
pattern is used so that two unrelated interfaces
can work together. The joining between them
is called an Adapter. This is something like
we convert interface of one class into interface
expected by the client. We do that using an
Adapter, for more detail refer java design patterns
adapter
pattern.
|
|