added lab13 ex1

This commit is contained in:
2024-11-11 09:41:57 +01:00
parent 3743b47887
commit 7c614b0c5c
5 changed files with 98 additions and 0 deletions

View 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());
}
}