Class FeatureInputPairObjects

All Implemented Interfaces:
FeatureInput, FeatureInputDictionary, FeatureInputWithResolution

public class FeatureInputPairObjects extends FeatureInputEnergy
A pair of objects (first and second) and optionally a merged version of both.

Note that first and second simply identify two parts of the pair (tuple). It has no physical meaning related to where the objects are located in the scene.

If a merged version doesn't exist, it is created and cached on demand.

Author:
Owen Feehan
  • Constructor Details

    • FeatureInputPairObjects

      public FeatureInputPairObjects(ObjectMask first, ObjectMask second)
      Constructs a FeatureInputPairObjects with two ObjectMasks.
      Parameters:
      first - the first ObjectMask
      second - the second ObjectMask
    • FeatureInputPairObjects

      public FeatureInputPairObjects(ObjectMask first, ObjectMask second, EnergyStack energyStack)
      Constructs a FeatureInputPairObjects with two ObjectMasks and an EnergyStack.
      Parameters:
      first - the first ObjectMask
      second - the second ObjectMask
      energyStack - the EnergyStack
    • FeatureInputPairObjects

      public FeatureInputPairObjects(ObjectMask first, ObjectMask second, Optional<EnergyStack> energyStack)
      Constructs a FeatureInputPairObjects with two ObjectMasks and an optional EnergyStack.
      Parameters:
      first - the first ObjectMask
      second - the second ObjectMask
      energyStack - an optional EnergyStack
    • FeatureInputPairObjects

      public FeatureInputPairObjects(ObjectMask first, ObjectMask second, Optional<EnergyStack> energyStack, Optional<ObjectMask> merged)
      Constructs a FeatureInputPairObjects with two ObjectMasks, an optional EnergyStack, and an optional merged ObjectMask.
      Parameters:
      first - the first ObjectMask
      second - the second ObjectMask
      energyStack - an optional EnergyStack
      merged - an optional merged ObjectMask
    • FeatureInputPairObjects

      protected FeatureInputPairObjects(FeatureInputPairObjects src)
      Copy constructor for FeatureInputPairObjects.
      Parameters:
      src - the FeatureInputPairObjects to copy
  • Method Details

    • getFirst

      public ObjectMask getFirst()
      Gets the first ObjectMask.
      Returns:
      the first ObjectMask
    • getSecond

      public ObjectMask getSecond()
      Gets the second ObjectMask.
      Returns:
      the second ObjectMask
    • getMerged

      public ObjectMask getMerged()
      Returns a merged version of the two objects.

      If a merged version doesn't exist, it is created and cached.

      Returns:
      the merged ObjectMask
    • getMergedOptional

      public Optional<ObjectMask> getMergedOptional()
      Gets the optional merged ObjectMask.
      Returns:
      an Optional containing the merged ObjectMask, or empty if not present
    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object, showing the center of gravity of both ObjectMasks
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class FeatureInputEnergy
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class FeatureInputEnergy
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class FeatureInputEnergy