コード例 #1
0
ファイル: IsFarFrom.java プロジェクト: comus/Alice
 protected Object getValue(Transformable subjectValue, Transformable objectValue) {
   double thresholdValue = threshold.doubleValue();
   if (subjectValue.getDistanceSquaredTo(objectValue) > thresholdValue * thresholdValue) {
     return Boolean.TRUE;
   } else {
     return Boolean.FALSE;
   }
 }
コード例 #2
0
ファイル: ItemAtIndex.java プロジェクト: comus/Alice
 public Object getValue(edu.cmu.cs.stage3.alice.core.Array arrayValue) {
   int i = index.intValue();
   int n = arrayValue.size();
   if (i >= 0 && i < n) {
     return arrayValue.itemValueAtIndex(i);
   } else {
     throw new edu.cmu.cs.stage3.alice.core.SimulationException(
         "index out of bounds exception.  " + i + " is not in range [0," + n + ")", null, this);
   }
 }