Record Class BaseTopologicalOrderGraph.NodeTopologicalOrder
java.lang.Object
java.lang.Record
ai.timefold.solver.core.impl.domain.variable.declarative.BaseTopologicalOrderGraph.NodeTopologicalOrder
- All Implemented Interfaces:
Comparable<BaseTopologicalOrderGraph.NodeTopologicalOrder>
- Enclosing interface:
- BaseTopologicalOrderGraph
public static record BaseTopologicalOrderGraph.NodeTopologicalOrder(int nodeId, int order)
extends Record
implements Comparable<BaseTopologicalOrderGraph.NodeTopologicalOrder>
Stores a graph node id along its topological order.
Comparisons ignore node id and only use the topological order.
For instance, for x = (0, 0) and y = (1, 5), x is before y, whereas for
x = (0, 5) and y = (1, 0), y is before x. Note
BaseTopologicalOrderGraph
is not guaranteed to return every topological order index (i.e.
it might be the case no nodes has order 0).-
Constructor Summary
ConstructorsConstructorDescriptionNodeTopologicalOrder(int nodeId, int order) Creates an instance of aNodeTopologicalOrderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintbooleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.intnodeId()Returns the value of thenodeIdrecord component.intorder()Returns the value of theorderrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NodeTopologicalOrder
public NodeTopologicalOrder(int nodeId, int order) Creates an instance of aNodeTopologicalOrderrecord class.- Parameters:
nodeId- the value for thenodeIdrecord componentorder- the value for theorderrecord component
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<BaseTopologicalOrderGraph.NodeTopologicalOrder>
-
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 with '=='. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
nodeId
public int nodeId()Returns the value of thenodeIdrecord component.- Returns:
- the value of the
nodeIdrecord component
-
order
public int order()Returns the value of theorderrecord component.- Returns:
- the value of the
orderrecord component
-