Skip to content

Instantly share code, notes, and snippets.

@MaxxselvaK
Created October 16, 2022 12:31
Show Gist options
  • Save MaxxselvaK/a3b28f4817147a5bc9743c5dabc7184f to your computer and use it in GitHub Desktop.
Save MaxxselvaK/a3b28f4817147a5bc9743c5dabc7184f to your computer and use it in GitHub Desktop.
FlyweightPattern
package FlyWeight;
public class Cell {
private final int row;
private final int column;
private String content;
private CellProperty properties;
public Cell(int row, int column,CellProperty properties) {
this.row = row;
this.column = column;
this.properties = properties;
}
public String getContent() {
return content;
}
public CellProperty getProperties() {
return properties;
}
public void setProperties(CellProperty properties) {
this.properties = properties;
}
public void setContent(String content) {
this.content = content;
}
public void render() {
System.out.printf("(%d, %d): %s [%s]\n", row, column, content,properties);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment