added lab13 ex1
This commit is contained in:
27
src/lab13_proxy/ex1/Image.java
Normal file
27
src/lab13_proxy/ex1/Image.java
Normal file
@ -0,0 +1,27 @@
|
||||
package lab13_proxy.ex1;
|
||||
|
||||
public class Image {
|
||||
protected final String path;
|
||||
protected final String resolution;
|
||||
protected boolean loaded = false;
|
||||
|
||||
public Image(String path, String resolution) {
|
||||
this.path = path;
|
||||
this.resolution = resolution;
|
||||
}
|
||||
|
||||
public void load() {
|
||||
if (!loaded) {
|
||||
System.out.println("Image " + path + " is loaded in " + resolution + " resolution");
|
||||
loaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isLoaded() {
|
||||
return loaded;
|
||||
}
|
||||
|
||||
public void showImage(User user) {
|
||||
System.out.println("Image " + path + " is shown in " + resolution + " resolution for user " + user.getName());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user