Record Class MilitaryCampaignAnalyzer.TerrainSegment
java.lang.Object
java.lang.Record
org.episteme.social.history.MilitaryCampaignAnalyzer.TerrainSegment
- Record Components:
name- segment namedistanceKm- length in kilometersterrainDifficulty- weight (1.0 = road, 2.0 = rough, 3.0 = mountain)forageAvailability- availability of resources on land (0.0 to 1.0)hasWaterSource- true if natural water is present along the path
- All Implemented Interfaces:
Serializable
- Enclosing class:
MilitaryCampaignAnalyzer
public static record MilitaryCampaignAnalyzer.TerrainSegment(String name, double distanceKm, double terrainDifficulty, double forageAvailability, boolean hasWaterSource)
extends Record
implements Serializable
Physical characteristics of a geographical segment of a campaign route.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTerrainSegment(String name, double distanceKm, double terrainDifficulty, double forageAvailability, boolean hasWaterSource) Creates an instance of aTerrainSegmentrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thedistanceKmrecord component.final booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of theforageAvailabilityrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasWaterSourcerecord component.name()Returns the value of thenamerecord component.doubleReturns the value of theterrainDifficultyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TerrainSegment
public TerrainSegment(String name, double distanceKm, double terrainDifficulty, double forageAvailability, boolean hasWaterSource) Creates an instance of aTerrainSegmentrecord class.- Parameters:
name- the value for thenamerecord componentdistanceKm- the value for thedistanceKmrecord componentterrainDifficulty- the value for theterrainDifficultyrecord componentforageAvailability- the value for theforageAvailabilityrecord componenthasWaterSource- the value for thehasWaterSourcerecord component
-
-
Method Details
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
distanceKm
public double distanceKm()Returns the value of thedistanceKmrecord component.- Returns:
- the value of the
distanceKmrecord component
-
terrainDifficulty
public double terrainDifficulty()Returns the value of theterrainDifficultyrecord component.- Returns:
- the value of the
terrainDifficultyrecord component
-
forageAvailability
public double forageAvailability()Returns the value of theforageAvailabilityrecord component.- Returns:
- the value of the
forageAvailabilityrecord component
-
hasWaterSource
public boolean hasWaterSource()Returns the value of thehasWaterSourcerecord component.- Returns:
- the value of the
hasWaterSourcerecord component
-