Esempio n. 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]!
    */
  }
Esempio n. 2
0
  /** Checks that the domain is in the right coordinate space and a subset of the given region */
  public static boolean checkDomainIn(FeEdition edition, XnRegion limit) {
    return (edition.coordinateSpace().isEqual(limit.coordinateSpace()))
        && (edition.domain().isSubsetOf(limit));
    /*
    udanax-top.st:23617:FeWrapper class methodsFor: 'protected: checking'!
    {BooleanVar} checkDomainIn: edition {FeEdition}
    	with: limit {XnRegion}
    	"Checks that the domain is in the right coordinate space and a subset of the given region"

    	^(edition coordinateSpace isEqual: limit coordinateSpace)
    		and: [edition domain isSubsetOf: limit]!
    */
  }
Esempio n. 3
0
  /**
   * Checks that the domain is in the right coordinate space and is a superset of the given region
   */
  public static boolean checkDomainHas(FeEdition edition, XnRegion required) {
    return (edition.coordinateSpace().isEqual(required.coordinateSpace()))
        && (required.isSubsetOf(edition.domain()));
    /*
    udanax-top.st:23610:FeWrapper class methodsFor: 'protected: checking'!
    {BooleanVar} checkDomainHas: edition {FeEdition}
    	with: required {XnRegion}
    	"Checks that the domain is in the right coordinate space and is a superset of the given region"

    	^(edition coordinateSpace isEqual: required coordinateSpace)
    		and: [required isSubsetOf: edition domain]!
    */
  }
Esempio n. 4
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]!
    */
  }