pl.edu.agh.cast.common
Class HexColor

java.lang.Object
  extended by pl.edu.agh.cast.common.HexColor
All Implemented Interfaces:
Serializable

public class HexColor
extends Object
implements Serializable

Class represents a color as three hex RGB values.

Author:
AGH CAST Team
See Also:
Serialized Form

Constructor Summary
HexColor()
          Default constructor.
HexColor(int red, int green, int blue)
          Initializing constructor.
 
Method Summary
 boolean equals(Object obj)
          
 int getBlue()
           
 int getGreen()
           
 int getRed()
           
 int hashCode()
          
static HexColor parseColor(String hexColor)
          Creates a HexColor instance based on it's string representation of form XXXXXX, where X is a hex digit (0-F).
 void setBlue(int blue)
           
 void setGreen(int green)
           
 void setRed(int red)
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HexColor

public HexColor()
Default constructor.


HexColor

public HexColor(int red,
                int green,
                int blue)
Initializing constructor.

Parameters:
red - amount of red
green - amount of green
blue - amount of blue
Method Detail

parseColor

public static HexColor parseColor(String hexColor)
                           throws Exception
Creates a HexColor instance based on it's string representation of form XXXXXX, where X is a hex digit (0-F).

Parameters:
hexColor - hexadecimal string representation of color
Returns:
instance of HexColor
Throws:
Exception - on parsing error

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()

getRed

public int getRed()

setRed

public void setRed(int red)

getGreen

public int getGreen()

setGreen

public void setGreen(int green)

getBlue

public int getBlue()

setBlue

public void setBlue(int blue)

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.