org.abora.gold.spaces.basic
Class Mapping

java.lang.Object
  |
  +--org.abora.gold.java.AboraHeaper
        |
        +--org.abora.gold.xpp.basic.Heaper
              |
              +--org.abora.gold.spaces.basic.Mapping
Direct Known Subclasses:
CompositeMapping, ConstantMapping, Dsp, EmptyMapping, SimpleMapping

public class Mapping
extends Heaper

A mapping is a general mapping from one coordinate space to another, with few of the
guarantees provided by Dsps. In particular, the source and destination coordinate spaces
can be different, and the mapping doesn''t have to be everywhere defined (but it has to
say where it is defined via "domain" and "range" messages). A mapping doesn''t have to be
unique--the same domain position may map to multiple range positions and vice versa. A
mapping of a XuRegion must yield another XuRegion, but a mapping of a simple region
doesn''t have to yield a simple region.
A useful and valid way to think of a Mapping is as a (possibly infinite) set of pairs (a
mathematical set, not a ScruSet). The domain region consists of the first elements of
each pair, and the range region consists of the second elements.
A mapping is most useful as a representation of a version comparison of two different
organizations of common elements. The mapping would tell how positions in one
organization correspond to positions in the other.


Field Summary
 
Fields inherited from class org.abora.gold.xpp.basic.Heaper
AllBlasts, BecomeMap, GarbageCount, InGC, InitializedClasses, InitializingClasses, LastMemory, NextClientRequestNumber, NotOneElementSignal, PackageTable, PromiseNameTable, StringHashSBoxes
 
Fields inherited from class org.abora.gold.java.AboraHeaper
ActiveClubs, CurrentAuthor, CurrentBertCanopyCache, CurrentBertCrum, CurrentChunk, CurrentGrandMap, CurrentKeyMaster, CurrentPacker, CurrentSensorCanopyCache, CurrentServer, CurrentSession, CurrentSessions, CurrentTrace, InitialEditClub, InitialOwner, InitialReadClub, InitialSponsor, InsideTransactionFlag
 
Constructor Summary
Mapping()
           
 
Method Summary
 int actualHashForEqual()
           
 Mapping appliedAfter(Dsp dsp)
          Defined by the equivalence:
M->transformedBy(D)->of(R) isEqual (M->of(D->of(R)))
for all regions R in the domainSpace of M.
 Mapping combine(Mapping other)
          Essential.
 CoordinateSpace coordinateSpace()
          the coordinate space of the domain of the Mapping
 XnRegion domain()
          Essential.
 CoordinateSpace domainSpace()
          The coordinate space of the domain of the Mapping
 PrimArray export()
           
 Mapping fetchCombine(Mapping mapping)
          if I know how to combine the two into a single mapping, then I do so
 Dsp fetchDsp()
          if this is a Dsp or a Dsp retricted to some domain, return the underlying Dsp.
static void info()
          {Mapping CLIENT} combine: other {Mapping}
{XuRegion CLIENT} domain
{CoordinateSpace CLIENT} domainSpace
{Mapping CLIENT} inverse
{BooleanVar CLIENT} isComplete
{BooleanVar CLIENT} isIdentity
{Position CLIENT} of: before {Position}
{XuRegion CLIENT} ofAll: before {XuRegion}
{XuRegion CLIENT} range
{CoordinateSpace CLIENT} rangeSpace
{Mapping CLIENT} restrict: region {XuRegion}
{Stepper CLIENT of: Mapping} simplerMappings
{Mapping CLIENT} unrestricted
 Mapping inverse()
          Essential.
 Position inverseOf(Position after)
          Inverse transform a position.
 XnRegion inverseOfAll(XnRegion after)
          Inverse transform of a region.
'a->isEqual (this->of (b))' iff 'b->isEqual (this->inverseOf (a))'.
 IntegerVar inverseOfInt(IntegerVar pos)
          Unboxed version of 'this->inverseOf (xuInteger(pos))'.
 boolean isComplete()
          Essential.
 boolean isIdentity()
          Essential.
static Heaper make(CoordinateSpace cs, CoordinateSpace rs)
          Make an empty mapping from cs to rs.
static Heaper make(CoordinateSpace cs, CoordinateSpace rs, ImmuSet mappings)
          The combine of all the mappings in 'mappings' All domains must be
in cs and all ranges in rs.
static Heaper make(CoordinateSpace cs, XnRegion values)
          Make a constant mapping from all positions in cs to all positions in values.
static Heaper make(java.lang.Object a, java.lang.Object b)
           
static Heaper make(XnRegion region, Mapping mapping)
           
 Position of(Position before)
          Transform a position.
 XnRegion ofAll(XnRegion before)
          Essential.
 IntegerVar ofInt(IntegerVar pos)
          Unboxed version of 'this->of (xuInteger(pos))'.
 Mapping preCompose(Dsp dsp)
          There is no sensible explanation for what this message does on Mappings
which aren't Dsps.
 XnRegion range()
          Essential.
 CoordinateSpace rangeSpace()
          The coordinate space of the range of the transformation
 Mapping restrict(XnRegion region)
          Essential.
 Mapping restrictRange(XnRegion region)
          Restrict the range.
 ImmuSet simpleMappings()
          return a set of simple mappings that would combine to this one
 ImmuSet simpleRegionMappings()
          return a set of mappings with simple regions as their domains that would combine
to this one.
 Stepper simplerMappings()
          Essential.
 Mapping transformedBy(Dsp dsp)
          Defined by the equivalence:
M->transformedBy(D)->of(R) isEqual (D->of(M->of(R)))
for all regions R in the domainSpace of M.
 Mapping unrestricted()
          Essential.
 
Methods inherited from class org.abora.gold.xpp.basic.Heaper
abstractDeclarationFor, abstractTypeFor, addMethodAttributeToInOf, addPackage, addPackageCategory, allClientProtocolOn, argumentTypesFor, arrow, blast, blast, BLAST, cachePromiseNameTable, cachePromiseNameTableIn, canYouBecome, cast, cleanPromiseClasses, cleanupGarbage, clientClassesDo, clientFunctionsOn, clientMethodsOn, clientProtocol, clientProtocolDo, clientProtocolOn, clientProtocolOn, collectibleClasses, compare, compileClientSubclasses, compileConstantPromiseMethods, compileCreateFromRcvr, compileEQ, compileGeneratedClassMethod, compileGeneratedMethod, compileHook, compilePromise, compilePromiseDefaultMethods, compilePromiseFluidDeclarations, compilePromiseHandlers, compilePromiseMethods, compileRequestCreateMsgInArguments, compileRequestEvaluateMsgInReturningArguments, compileRPCSpecialistEvaluateMsgForReturningArguments, compileSendSelfTo, compileSendSelfToSendHook, compileStubbleMethods, compileSubclassStubbleMethods, computeMangle, computePreorder, constantTypeValue, convert, convertCopyDeclarations, convertDeferredDeclarations, convertProxyDeclarations, convertSubclassCopyDeclarations, convertSubclassDeferredDeclarations, convertSubclassProxyDeclarations, copyReferencesToType, create, create, create, create, create, create, create, create, create, create, createRequestClassArguments, definesProxyMethods, delete, deref, destroy, destruct, destructor, enum, enumFlags, equals, exportName, fetchAttribute, fetchPackage, fetchSuperCategory, fileOutClientProtocol, findCategory, findSenderAndReceiverMethods, findTailInto, flushPromiseNameTable, foo, freezeClientClasses, freezeClientProtocol, freezeStProtocol, frozenClasses, garbageCollect, garbageCollectFrom, gcOpportunity, gcOpportunity, generatedCategory, generatePromiseNames, getCategory, getOrMakePackage, getSuperCategory, handlerSignaturesFrom, hash, hashForEqual, hasProxyMethods, info_clientClasses, info_clientSideClasses, info_promiseClasses, info_stProtocol, inGC, initializedClasses, initializingClasses, initPackages, initStringHashSBoxes, inspectPieces, instanceSize, IntegerVar, isByProxy, isConstructed, isDestructed, isEqual, isEqualOrSubclassOf, isGenerated, isIntType, isKindOf, isRawType, isUnlocked, linkTimeNonInherited, make, makeClassTable, makeFillTable, makeRequestTable, mangle, markChildren, markCount, markInstances, mayBecome, mayBecomeAnySubclassOf, new1, newX, nonCopyVariables, notWorking, pack, packageClasses, packagingCategory, parseExportName, passe, pointerToStaticMember, pointerToStaticMember, pointerToVirtualMember, preorderMax, preorderNumber, printOn, PROBLEM, problems, promiseClass, promiseDefaultValue, promiseName, promiseNameTable, promiseToAbstract, registerPackageCategory, removeGeneratedCode, removeStubbleMethods, removeSubclassGeneratedCode, removeSubclassStubbleMethods, requestProcedure, requestProceduresFrom, returnTypeFor, rootName, scheduleTermination, sendProxyTo, sendSelfTo, serverNameFor, setGC, signal, signals, smalltalkSelector, stClientProtocol, stubbleSelectorTokenReturnsArguments, subclassNonCopyVariables, takeOop, togglePromiseName, togglePromiseOfParse, unimplemented, unmangle, verifyFreeze, wipeStubble
 
Methods inherited from class org.abora.gold.java.AboraHeaper
asOop, basicInspect, displayString, error, hack, halt, inspect, knownBug, mightNotImplement, REQUIRES, shouldImplement, shouldNotImplement, stubbleForSubclassResponsibility, thingToDo, willNotImplement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mapping

public Mapping()
Method Detail

coordinateSpace

public CoordinateSpace coordinateSpace()
the coordinate space of the domain of the Mapping


domain

public XnRegion domain()
Essential. region in which it is valid.


domainSpace

public CoordinateSpace domainSpace()
The coordinate space of the domain of the Mapping


fetchDsp

public Dsp fetchDsp()
if this is a Dsp or a Dsp retricted to some domain, return the underlying Dsp. Otherwise
NULL.


isComplete

public boolean isComplete()
Essential. Return true if each Position in the domain is mapped to every Position in the
range.


isIdentity

public boolean isIdentity()
Essential. True if this is the identify mapping on the entire space.


range

public XnRegion range()
Essential. region in which inverse is valid. Same as the region that the domain region
maps to. For you mathematicians, it is the image of the domain under the mapping.


rangeSpace

public CoordinateSpace rangeSpace()
The coordinate space of the range of the transformation


simpleMappings

public ImmuSet simpleMappings()
return a set of simple mappings that would combine to this one


simpleRegionMappings

public ImmuSet simpleRegionMappings()
return a set of mappings with simple regions as their domains that would combine
to this one.


simplerMappings

public Stepper simplerMappings()
Essential. Break this Mapping up into simpler Mappings which can be combined together to
get this one.


unrestricted

public Mapping unrestricted()
Essential. If this is a 'simpler' Mapping, and not isFull, then return a yet simpleMapping
of some class from which you can get more information. Note that m->restrict
(region)->unrestricted () is not necessarily the same as m, since information may be lost.


inverseOf

public Position inverseOf(Position after)
Inverse transform a position. Must BLAST if there isn't a unique inverse.
'a->isEqual (this->of (b))' iff 'b->isEqual (this->inverseOf (a))'.


inverseOfAll

public XnRegion inverseOfAll(XnRegion after)
Inverse transform of a region.
'a->isEqual (this->of (b))' iff 'b->isEqual (this->inverseOf (a))'.


inverseOfInt

public IntegerVar inverseOfInt(IntegerVar pos)
Unboxed version of 'this->inverseOf (xuInteger(pos))'. See
discussion in the XuInteger class comment about boxed and unboxed
protocols


of

public Position of(Position before)
Transform a position. 'before' must be a Position of my domain space. Iff 'before' is in
the domain region over which I am defined and it maps to a unique range Position then the
result will be that Position. Otherwise BLAST. For example, if I map 1 to 4, 1 to 5, and 2
to 5 (and nothing else), then this method will yield 5 given 2, but BLAST given anything
else. To find all the values 1 maps to, use the 'ofAll' operation on the singleton region
whose member is 1.


ofAll

public XnRegion ofAll(XnRegion before)
Essential. Transform a region. The result region has exactly those positions which are
the mappings of the positions in 'before'. This must be the case even if these positions
cannot be enumerated. If the mapping for a given position is multiply defined, then (if
that position is in 'before') all position it maps to must be in the result. Because of
this property, the behavior of this method must be taken as really defining the nature of
a particular mapping (with other method's behavior being defined in terms of this one),
despite the fact that it would have been more natural to take Mapping::of(Position *) as
the defining behavior.


ofInt

public IntegerVar ofInt(IntegerVar pos)
Unboxed version of 'this->of (xuInteger(pos))'. See discussion in the XuInteger class
comment about boxed and unboxed protocols


appliedAfter

public Mapping appliedAfter(Dsp dsp)
Defined by the equivalence:
M->transformedBy(D)->of(R) isEqual (M->of(D->of(R)))
for all regions R in the domainSpace of M. Equivalent to Dsp::compose, except that it is
between a Mapping and a Dsp.


combine

public Mapping combine(Mapping other)
Essential. Result will do both mine and other's mappings. It will do my mapping where I
am defined, and it will do the other's where his is defined. If we are both defined over
some domain positions, then the result is a multi-valued mapping. If you think of a
Mapping simply as a set of pairs (see class comment), then 'combine' yields a Mapping
consisting of the union of these two sets.


inverse

public Mapping inverse()
Essential. Return the inverse of this transformation. Considering the Mapping as a set of
pairs (see class comment), return the Dsp which has the mirror image of all my pairs.


preCompose

public Mapping preCompose(Dsp dsp)
There is no sensible explanation for what this message does on Mappings
which aren't Dsps. In the future, we will probably retire this message,
so don't use it.


restrict

public Mapping restrict(XnRegion region)
Essential. Restrict the domain. The domain of the result will be the intersection of my
domain and 'region'. Otherwise we are the same.


restrictRange

public Mapping restrictRange(XnRegion region)
Restrict the range. The range of the result will be the intersection of my range and
'region'. Otherwise we are the same.


transformedBy

public Mapping transformedBy(Dsp dsp)
Defined by the equivalence:
M->transformedBy(D)->of(R) isEqual (D->of(M->of(R)))
for all regions R in the domainSpace of M. Equivalent to Dsp::preCompose, except that it
is between a Mapping and a Dsp.


fetchCombine

public Mapping fetchCombine(Mapping mapping)
if I know how to combine the two into a single mapping, then I do so


export

public PrimArray export()

actualHashForEqual

public int actualHashForEqual()
Overrides:
actualHashForEqual in class Heaper

make

public static Heaper make(CoordinateSpace cs,
                          CoordinateSpace rs)
Make an empty mapping from cs to rs. The domain will consist of an
empty region in cs, and the range will consist of an empty region in rs


make

public static Heaper make(CoordinateSpace cs,
                          XnRegion values)
Make a constant mapping from all positions in cs to all positions in values.


make

public static Heaper make(CoordinateSpace cs,
                          CoordinateSpace rs,
                          ImmuSet mappings)
The combine of all the mappings in 'mappings' All domains must be
in cs and all ranges in rs. cs and rs must be provided in case
'mappings' is empty.


make

public static Heaper make(java.lang.Object a,
                          java.lang.Object b)

make

public static Heaper make(XnRegion region,
                          Mapping mapping)

info

public static void info()
{Mapping CLIENT} combine: other {Mapping}
{XuRegion CLIENT} domain
{CoordinateSpace CLIENT} domainSpace
{Mapping CLIENT} inverse
{BooleanVar CLIENT} isComplete
{BooleanVar CLIENT} isIdentity
{Position CLIENT} of: before {Position}
{XuRegion CLIENT} ofAll: before {XuRegion}
{XuRegion CLIENT} range
{CoordinateSpace CLIENT} rangeSpace
{Mapping CLIENT} restrict: region {XuRegion}
{Stepper CLIENT of: Mapping} simplerMappings
{Mapping CLIENT} unrestricted



Translation - Copyright © 2003 David G Jones. All Rights Reserved.
Original Udanax-Gold - Copyright © 1979-1999 Udanax.com. All rights reserved.