public class CellAttributes
extends java.lang.Object
hashCode()
function is
overriden for this class, so each CellAttributes
object has
unique hash and may be stored in HashMap
object.
There are no public constructors for CellAttributes
class
and user can get an instance only by using static factory functions.
All these techniques help to reduce overall memory usage.
Together with Cell
class this class
implements "Flyweight" pattern [Gamma94]Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getBkColor()
Returns background color.
|
java.awt.Color |
getFgColor()
Returns foreground color.
|
static CellAttributes |
getInstance()
Returns
CellAttributes object with default parameters:
all character parametrs are false, foreground color is white,
background is black. |
static CellAttributes |
getInstance(boolean bold,
boolean underscored,
boolean blinked,
boolean reversed,
java.awt.Color fgColor,
java.awt.Color bkColor)
Returns instance of
CellAttributes class giving all
needed parameters. |
boolean |
isBlinked()
Returns if 'blinked' is set for current object.
|
boolean |
isBold()
Returns if 'bold' is set in current object.
|
boolean |
isReversed()
Returns if 'reversed' is set for current object.
|
boolean |
isUnderscored()
Returns if 'underscored' is set for current object.
|
public static CellAttributes getInstance(boolean bold, boolean underscored, boolean blinked, boolean reversed, java.awt.Color fgColor, java.awt.Color bkColor)
CellAttributes
class giving all
needed parameters. Function calculates hash for this parameters combination
and seeks for object with same parameters in hash map.
If there is no object with such parameters a new instance will be created
and stored in hash map.bold
- true if screen character must be bold.underscored
- true if screen character must be underscored.blinked
- true if screen character must be blinked.reversed
- true if screen character must be reversed.fgColor
- foreground color.bkColor
- background color.CellAttributes
with specified parameters.public static CellAttributes getInstance()
CellAttributes
object with default parameters:
all character parametrs are false, foreground color is white,
background is black.CellAttributes
with default parameters.public boolean isBold()
public boolean isUnderscored()
public boolean isBlinked()
public boolean isReversed()
public java.awt.Color getFgColor()
public java.awt.Color getBkColor()
Copyright © JSCAPE LLC. 1999-2021. All Rights Reserved