Ejemplo 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]!
    */
  }
Ejemplo n.º 2
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]!
    */
  }