Created
October 16, 2022 12:31
-
-
Save selvamani-k-8445/a3b28f4817147a5bc9743c5dabc7184f to your computer and use it in GitHub Desktop.
FlyweightPattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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