edu.mit.csail.sdg.alloy4viz
Class StaticProjector

java.lang.Object
  extended by edu.mit.csail.sdg.alloy4viz.StaticProjector

public final class StaticProjector
extends java.lang.Object

This utility class performs projection of AlloyModel and AlloyInstance.

Thread Safety: Can be called only by the AWT event thread.


Method Summary
static AlloyInstance project(AlloyInstance oldInstance, AlloyProjection projection)
          Project an instance over the given list of types (and their associated chosen atom).
static AlloyModel project(AlloyModel unprojectedModel, java.util.Collection<AlloyType> typesToBeProjected)
          Given an unprojected model, project it over the given collection of AlloyType(s).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

project

public static AlloyModel project(AlloyModel unprojectedModel,
                                 java.util.Collection<AlloyType> typesToBeProjected)
Given an unprojected model, project it over the given collection of AlloyType(s).

Parameters:
unprojectedModel - - the original unprojected model
typesToBeProjected - - the collection of types to project over

project

public static AlloyInstance project(AlloyInstance oldInstance,
                                    AlloyProjection projection)
Project an instance over the given list of types (and their associated chosen atom).

Parameters:
oldInstance - - the original unprojected instance
projection - - the list of types to be projected and their associated chosen atoms

For each type t in projection.getProjectedTypes:

(1) If t doesn't exist in the instance, then we will simply ignore t.

(2) Otherwise, if t has one or more atoms in the original instance,
then projection.getProjectedAtom(t) must be one of the atoms (indicating the chosen atom for that type)
else projection.getProjectedAtom(t) must be null.
If rule (2) is violated, then some tuples may not show up in the return value.