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]! */ }
/** * 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]! */ }
/** * 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! */ }
/** 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]! */ }
/** 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]! */ }