|
Josh Native console access wrapper for Java |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.yifanlu.Josh.ConsoleAttribute
public class ConsoleAttribute
Stores the attribute of a character.
The attribute is composed of the text color (foreground color),
the highlighting (background color), and it's byte changes.
If you are just going to modify color attributes, we suggest using
the superclass ConsoleColor.
JoshOutBuffer| Field Summary | |
|---|---|
protected int |
attributes
|
static int |
COMMON_LVB_GRID_HORIZONTAL
Character byte change. |
static int |
COMMON_LVB_GRID_LVERTICAL
Character byte change. |
static int |
COMMON_LVB_GRID_RVERTICAL
Character byte change. |
static int |
COMMON_LVB_LEADING_BYTE
Character byte change. |
static int |
COMMON_LVB_REVERSE_VIDEO
Character byte change. |
static int |
COMMON_LVB_TRAILING_BYTE
Character byte change. |
static int |
COMMON_LVB_UNDERSCORE
Character byte change. |
| Constructor Summary | |
|---|---|
ConsoleAttribute()
Create a new object with no attributes. |
|
ConsoleAttribute(int attributes)
Create a new attribute object with an int. |
|
| Method Summary | |
|---|---|
void |
addAttributes(int attribute)
Mixes another attribute Use the constants like COMMON_LVB_LEADING_BYTE for the attribute and this
will use the OR operator to add the attribute to the object. |
boolean |
equals(java.lang.Object anObject)
Compares two Objects, if both are ConsoleAttribute and have the same attributes, they are equal. |
int |
getAttributes()
Gets the attributes stored in the object. |
int |
hashCode()
Returns a hash code. |
void |
setAttributes(int attributes)
Sets the attributes |
java.lang.String |
toString()
A String representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int attributes
public static final int COMMON_LVB_LEADING_BYTE
public static final int COMMON_LVB_TRAILING_BYTE
public static final int COMMON_LVB_GRID_HORIZONTAL
public static final int COMMON_LVB_GRID_LVERTICAL
public static final int COMMON_LVB_GRID_RVERTICAL
public static final int COMMON_LVB_REVERSE_VIDEO
public static final int COMMON_LVB_UNDERSCORE
| Constructor Detail |
|---|
public ConsoleAttribute()
public ConsoleAttribute(int attributes)
ConsoleAttribute.COMMON_LVB_LEADING_BYTE | ConsoleAttribute.COMMON_LVB_TRAILING_BYTE |
ConsoleAttribute.COMMON_LVB_GRID_LVERTICAL is valid for the int attribute
parameter.
attributes - The attribute(s) of the character which can be mixed with the OR operator.| Method Detail |
|---|
public void addAttributes(int attribute)
COMMON_LVB_LEADING_BYTE for the attribute and this
will use the OR operator to add the attribute to the object.
This is equivalent to setAttributes(getAttributes() | attribute) .
attribute - The attribute to mix.public int getAttributes()
public void setAttributes(int attributes)
attributes - The attribute(s) of the character which can be mixed with the OR operator.public boolean equals(java.lang.Object anObject)
equals in class java.lang.ObjectanObject - Another ConsoleAttribute object.
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
String representation of this object.
toString in class java.lang.Object
|
Copyright © 2010 Yifan Lu | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||