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 Summary
ConstructorsConstructorDescriptionLayoutResult(List<List<ResearchNode>> layers, int[] layerY, int[] channelsPerZone, int[] zoneBaseY, Map<Long, Map<Integer, Integer>> edgeChannelAssignments) Creates an instance of aLayoutResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionint[]Returns the value of thechannelsPerZonerecord component.Returns the value of theedgeChannelAssignmentsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.layers()Returns the value of thelayersrecord component.int[]layerY()Returns the value of thelayerYrecord component.final StringtoString()Returns a string representation of this record class.int[]Returns the value of thezoneBaseYrecord component.
-
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 aLayoutResultrecord class.- Parameters:
layers- the value for thelayersrecord componentlayerY- the value for thelayerYrecord componentchannelsPerZone- the value for thechannelsPerZonerecord componentzoneBaseY- the value for thezoneBaseYrecord componentedgeChannelAssignments- the value for theedgeChannelAssignmentsrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
layers
Returns the value of thelayersrecord component.- Returns:
- the value of the
layersrecord component
-
layerY
public int[] layerY()Returns the value of thelayerYrecord component.- Returns:
- the value of the
layerYrecord component
-
channelsPerZone
public int[] channelsPerZone()Returns the value of thechannelsPerZonerecord component.- Returns:
- the value of the
channelsPerZonerecord component
-
zoneBaseY
public int[] zoneBaseY()Returns the value of thezoneBaseYrecord component.- Returns:
- the value of the
zoneBaseYrecord component
-
edgeChannelAssignments
Returns the value of theedgeChannelAssignmentsrecord component.- Returns:
- the value of the
edgeChannelAssignmentsrecord component
-