Example #1
0
  public void removeAll(XnRegion region) {
    if (!(region.coordinateSpace().isEqual(coordinateSpace()))) {
      throw new AboraRuntimeException(AboraRuntimeException.WRONG_COORD_SPACE);
    }
    if (!(region.isSubsetOf(domain()))) {
      throw new AboraRuntimeException(AboraRuntimeException.NOT_IN_TABLE);
    }
    Stepper stomper = region.stepper();
    for (; stomper.hasValue(); stomper.step()) {
      Position p = (Position) stomper.fetch();
      if (p == null) {
        continue;
      }
      remove(p);
    }
    stomper.destroy();
    /*
    udanax-top.st:48058:MuTable methodsFor: 'smalltalk: defaults'!
    {void} removeAll: region {XnRegion}
    	(region coordinateSpace isEqual: self coordinateSpace) ifFalse:
    		[ Heaper BLAST: #WrongCoordSpace ].
    	(region isSubsetOf: self domain) ifFalse:
    		[ Heaper BLAST: #NotInTable ].

    	region stepper forEach: [ :p {Position} | self remove: p]!
    */
  }
Example #2
0
  /**
   * Check that everything in the region is an Edition, which can be certified with the given type
   */
  public static boolean checkSubEditions(
      FeEdition parent, XnRegion keys, FeWrapperSpec spec, boolean required) {
    Stepper stomper = keys.stepper();
    for (; stomper.hasValue(); stomper.step()) {
      Position key = (Position) stomper.fetch();
      if (key == null) {
        continue;
      }
      if (!(checkSubEdition(parent, key, spec, required))) {
        return false;
      }
    }
    stomper.destroy();
    return true;
    /*
    udanax-top.st:23637:FeWrapper class methodsFor: 'protected: checking'!
    {BooleanVar} checkSubEditions: parent {FeEdition}
    	with: keys {XnRegion}
    	with: spec {FeWrapperSpec}
    	with: required {BooleanVar}
    	"Check that everything in the region is an Edition, which can be certified with the given type"

    	keys stepper forEach:
    		[ :key {Position} |
    		(self checkSubEdition: parent with: key with: spec with: required) ifFalse:
    			[^false]].
    	^true!
    */
  }
Example #3
0
  /** I 'wipe' from myself all associations whose key is in 'region'. See MuTable::wipe */
  public void wipeAll(XnRegion region) {
    if (!(region.coordinateSpace().isEqual(coordinateSpace()))) {
      throw new AboraRuntimeException(AboraRuntimeException.WRONG_COORD_SPACE);
    }
    Stepper stomper = region.stepper();
    for (; stomper.hasValue(); stomper.step()) {
      Position p = (Position) stomper.fetch();
      if (p == null) {
        continue;
      }
      wipe(p);
    }
    stomper.destroy();
    /*
    udanax-top.st:47950:MuTable methodsFor: 'bulk operations'!
    {void} wipeAll: region {XnRegion}
    	"I 'wipe' from myself all associations whose key is in 'region'.  See MuTable::wipe"

    	(region coordinateSpace isEqual: self coordinateSpace) ifFalse:
    		[ Heaper BLAST: #WrongCoordSpace ].
    	region stepper forEach: [ :p {Position} | self wipe: p]!
    */
  }