Open main menu

CDOT Wiki β

Changes

Decorator

10 bytes added, 13:54, 1 March 2007
Example
----
Abstract Component class:
public abstract class InputStream {
abstract int read();
}
Concrete Component class:
class FileInputStream extends InputStream
{
public int read();
}
Decorator class:
public
class FilterInputStream extends InputStream {
protected FilterInputStream(InputStream in) {
this.in = in;
}
}
}
Concrete Decorator class:
public
class PushbackInputStream extends FilterInputStream {
1
edit