Class FlowConnection<T>
- Type Parameters:
T- type (class or interface) whose instances represent materials
FlowElements.
When a connection is established between two flow elements, material can be sent from one to another.
The 'source' and 'destination' flow elements of a connection are set upon the creation of a connection instance and cannot be changed later.
Instances of this class are created by calling the FlowElement.connectToElement(FlowElement) method.
- Author:
- Alexander Morozov
-
Method Summary
Modifier and TypeMethodDescriptionReturns the current material proportions of the material flow of this flow connection.Returns the destination (receiver)FlowElementof this flow connection.doubleReturns the sum of quantities of all materials that have passed through the connection.Returns anAccumulatorthat contains the quantities of each material that has passed through the connection.Returns the sourceFlowElementof this flow connection.doublegetRate()Returns the current flow rate through this flow connection.
-
Method Details
-
getRate
public double getRate()Returns the current flow rate through this flow connection.- Returns:
- current flow rate through this flow connection
-
getPassedMaterialsAmount
public double getPassedMaterialsAmount()Returns the sum of quantities of all materials that have passed through the connection.- Returns:
- sum of quantities of all materials that have passed through the connection
- See Also:
-
getPassedMaterialsDescriptor
Returns anAccumulatorthat contains the quantities of each material that has passed through the connection.The returned
Accumulatorinstance contains all such materials and their respective quantities. The sum of all quantities in the Accumulator is equal to the value returned by thegetPassedMaterialsAmount()method.- Returns:
- sum of all materials that have passed through the connection as an
Accumulatorinstance - See Also:
-
getNextElement
Returns the destination (receiver)FlowElementof this flow connection.- Returns:
- destination
flow element - See Also:
-
getPrevElement
Returns the sourceFlowElementof this flow connection.- Returns:
- source flow element
- See Also:
-
getFlowProportions
Returns the current material proportions of the material flow of this flow connection.Each element of the returned
Accumulatorcorresponds to a material in the current material flow of this connection. The amount of each material in the Accumulator is the ratio of that material's partial flow to the overall flow of this connection. The sum of amounts in the Accumulator is equal to 1.- Returns:
- current material flow proportions
-