synesketch.emotion
Class Emotion

java.lang.Object
  extended by synesketch.emotion.Emotion
All Implemented Interfaces:
java.lang.Comparable<Emotion>

public class Emotion
extends java.lang.Object
implements java.lang.Comparable<Emotion>

Represents one emotion, with it's type and weight.

Emotion types are the ones defined by Ekman: happiness, sadness, fear, anger, disgust, surprise. These types are defines by the static attributes of this class.

Version:
1.0
Author:
Uros Krcadinac email: uros@krcadinac.com

Field Summary
static int ANGER
           
static int DISGUST
           
static int FEAR
           
static int HAPPINESS
           
static int NEUTRAL
           
static int SADNESS
           
static int SURPRISE
           
 
Constructor Summary
Emotion(double weight, int type)
          Class constructor which sets weight and type of the emotion.
 
Method Summary
 int compareTo(Emotion arg0)
          Compares weights of current object and the one from the argument.
 int getType()
          Getter for the emotion type
 double getWeight()
          Getter for the emotional weight
 void setType(int type)
          Setter for the emotion type
 void setWeight(double value)
          Setter for the emotional weight
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NEUTRAL

public static int NEUTRAL

HAPPINESS

public static int HAPPINESS

SADNESS

public static int SADNESS

FEAR

public static int FEAR

ANGER

public static int ANGER

DISGUST

public static int DISGUST

SURPRISE

public static int SURPRISE
Constructor Detail

Emotion

public Emotion(double weight,
               int type)
Class constructor which sets weight and type of the emotion.

Parameters:
weight - double which represents the intensity of the emotion (can take values between 0 and 1)
type - type of the emotion (happiness, sadness, fear, anger, disgust, or surprise)
Method Detail

compareTo

public int compareTo(Emotion arg0)
Compares weights of current object and the one from the argument.

Specified by:
compareTo in interface java.lang.Comparable<Emotion>
Parameters:
arg0 - Emotion which is to compared to the current one
Returns:
integer representing the result

getType

public int getType()
Getter for the emotion type

Returns:
emotion type (integer constant defined by this class)

setType

public void setType(int type)
Setter for the emotion type

Parameters:
type - emotion type (integer constant defined by this class)

getWeight

public double getWeight()
Getter for the emotional weight

Returns:
double representing the emotional weight

setWeight

public void setWeight(double value)
Setter for the emotional weight

Parameters:
value - double representing the emotional weight

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object