Piece - PendulumProject2020/PendulumProject GitHub Wiki

Version: 0.1.9+

public class Piece

This class belongs to the main package. This class belongs to the Methodological layer.

The Piece class is the central part of the Piece-Slot model. Each Piece subclass is a component of code that can be freely attached, detached, or replaced from the body of the program. The Piece subclasses are the primary building blocks of the project, and almost every class outside the Methodological layer itself is a Piece subclass. Each Piece subclass has two components: the Body and the Slots. In order to become assimilated as part of the program, a Piece subclass is to, using a PieceProjection instance as a proxy, occupy a slot with its body.

Each Piece subclass must specify the following properties:

  1. What slot types (i.e. paths/names) its body can fit in
  2. A list of slots it has and the name of each slot
  3. A list of Piece subclasses (represented by names instead of class objects) it is directly dependent on

Piece subclasses are separated into Object Pieces and Method Pieces. Similarly, slots are separated into Object Slots and Method Slots. In addition, slots are separated into regular slots, each of which fits exactly one Piece subclass and which must all be filled, and mega-slots, which can fit any number of Piece subclasses and do not need to be filled.

An assembled collection of Piece subclasses forms a Piece-Tree. Below is an example of a Piece Tree. The names of the slots are on top of the slots and the names of the occupant Piece subclasses are at the bottom. Squares represent Method Pieces and Slots, while circles represent Object Pieces and Slots.

Notice that there is a root slot ("_ROOTSLOT") that does not belong to any Piece subclass. The root slot is a Method Piece Slot, so the root Piece (the Piece subclass that fits in the root slot) must be a Method Piece.

Method Summary

public static ArrayList<SlotPath> getPossibleFits() Returns a list of slot paths that the body of this Piece subclass can fit in. A slot path is a combination of a slot name and the path of Piece subclasses leading to the slot.

public static Map<String, Integer> getMethodPieceSlots() Returns a list of Method Piece Slots that this Piece subclass has. The return type is Map<String, Integer> instead of ArrayList in anticipation of the possibility of multiplicity.

public static Map<String, Integer> getObjectPieceSlots() Returns a list of Object Piece Slots that this Piece subclass has. The return type is Map<String, Integer> instead of ArrayList in anticipation of the possibility of multiplicity.

public static ArrayList<String> getDependentPieceNames() Returns a list of Piece subclasses that this Piece class is directly dependent on (i.e. direct reference instead of reference through slots/piece tree). The return type is ArrayList instead of ArrayList since the contents and location of the class file may change.

public static void executeProcess(String processName) Does the action specified by processName.

public static void executeProcessWithDataSet(String processName, DataSet dataSet) Does the action specified by processName, with the help of dataSet.

public static DataSet evaluateStaticInformation(String informationName) Returns the desired information as specified by informationName.

public static DataSet evaluateStaticInformationWithDataSet(String informationName, DataSet dataSet) Returns the desired information as specified by informationName, with the help of dataSet.

public static Map<String, Integer> makeSimpleSlotList(String... slotNames) Helper method; For easy creation of a slot list in the case where no multiplicity is present in the slot types.

⚠️ **GitHub.com Fallback** ⚠️