Class Rect

java.lang.Object
space.maxus.flare.ui.space.Rect
All Implemented Interfaces:
ComposableSpace

public class Rect extends Object implements ComposableSpace
A Rect is a ComposableSpace inside a Rectangle defined by first and last points.
  • Constructor Details

    • Rect

      public Rect(Slot from, Slot to)
      Constructs a new rect with starting and ending slot
      Parameters:
      from - Strictly smallest first slot
      to - Strictly biggest last slot
  • Method Details

    • of

      @NotNull public static @NotNull Rect of(Slot from, Slot to)
      Constructs a new Rect from starting and ending slots. Slots are ordered using MinMaxPair and can be passed in any order.
      Parameters:
      from - First slot
      to - Second slot
      Returns:
      Constructed Rect
    • slots

      public Set<Slot> slots()
      Description copied from interface: ComposableSpace
      Enumerates all slots inside this space
      Specified by:
      slots in interface ComposableSpace
      Returns:
      All slots inside this composable space
    • points

      public org.apache.commons.lang3.tuple.Pair<Slot,Slot> points()
      Description copied from interface: ComposableSpace
      Returns the first and last points of this space. Used mostly within Rect
      Specified by:
      points in interface ComposableSpace
      Returns:
      Pair of first and last points of this space
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object