Exemple #1
0
 /**
  * assuming that the argument is an emotion consisting of only one basic emotion, returns the
  * object's value for that particular basic emotion
  */
 public Double project(Emotion pureemotion) {
   Map targetcomponents = pureemotion.getComponents();
   // assert that emotions are both from matching theory
   assert (this._theory == pureemotion._theory);
   assert (targetcomponents.size() == 1.0);
   Set keys = targetcomponents.keySet();
   Iterator itr = keys.iterator();
   Double result = 0.0;
   BasicEmotion targetcomponent = (BasicEmotion) itr.next();
   result = _components.get(targetcomponent);
   if (result == null) {
     result = 0.0;
   }
   ;
   return result;
 }