Record Class GraphLayoutManager.LayoutResult

java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.client.screens.research.graph.GraphLayoutManager.LayoutResult
Record Components:
layers - Ordered nodes per layer (index = layer number).
layerY - Y position of each layer's nodes.
channelsPerZone - Number of routing channels between layer i and layer i+1. Index i corresponds to zone between layer i and i+1.
zoneBaseY - Y position of channel 0 in each routing zone. Channels go downward: channelY = zoneBaseY[i] + channelIndex * CHANNEL_PITCH.
edgeChannelAssignments - For each edge (parent→child), which channel it's assigned in each routing zone it passes through. Key = edgeKey(parent, child), Value = map from zone index to channel index.
Enclosing class:
GraphLayoutManager

public static record GraphLayoutManager.LayoutResult(List<List<ResearchNode>> layers, int[] layerY, int[] channelsPerZone, int[] zoneBaseY, Map<Long,Map<Integer,Integer>> edgeChannelAssignments) extends Record
Result of layout computation. Consumed by the edge router.
  • Constructor Details

    • LayoutResult

      public LayoutResult(List<List<ResearchNode>> layers, int[] layerY, int[] channelsPerZone, int[] zoneBaseY, Map<Long,Map<Integer,Integer>> edgeChannelAssignments)
      Creates an instance of a LayoutResult record class.
      Parameters:
      layers - the value for the layers record component
      layerY - the value for the layerY record component
      channelsPerZone - the value for the channelsPerZone record component
      zoneBaseY - the value for the zoneBaseY record component
      edgeChannelAssignments - the value for the edgeChannelAssignments record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • layers

      public List<List<ResearchNode>> layers()
      Returns the value of the layers record component.
      Returns:
      the value of the layers record component
    • layerY

      public int[] layerY()
      Returns the value of the layerY record component.
      Returns:
      the value of the layerY record component
    • channelsPerZone

      public int[] channelsPerZone()
      Returns the value of the channelsPerZone record component.
      Returns:
      the value of the channelsPerZone record component
    • zoneBaseY

      public int[] zoneBaseY()
      Returns the value of the zoneBaseY record component.
      Returns:
      the value of the zoneBaseY record component
    • edgeChannelAssignments

      public Map<Long,Map<Integer,Integer>> edgeChannelAssignments()
      Returns the value of the edgeChannelAssignments record component.
      Returns:
      the value of the edgeChannelAssignments record component