Esempio n. 1
0
  /** Main test subroutine for Instance slot. */
  private boolean testInstance(int testIndex, Instance instance, Slot slot, String value) {

    boolean testResult = false;
    if (instance == null) return testResult;
    if (slot == null) {
      return false;
    }

    Instance tmpInstance = (Instance) instance.getOwnSlotValue(slot);
    if (tmpInstance == null && testIndex == 0) return false;
    if (tmpInstance == null && testIndex == 1) return true;

    switch (testIndex) {
      case 0: // is equal to
        return containInstance(instance, slot, itsInstance);
      case 1: // is not equal to
        return (!containInstance(instance, slot, itsInstance));
      default:
        break;
    }
    return testResult;
  }