Record Class MilitaryCampaignAnalyzer.Army
java.lang.Object
java.lang.Record
org.episteme.social.history.MilitaryCampaignAnalyzer.Army
- Record Components:
name- army identifierinfantry- number of foot soldierscavalry- number of mounted soldiersartillery- number of artillery piecessupportPersonnel- number of camp followers and logistics staffdailyMarchKm- average march speed in km per day
- All Implemented Interfaces:
Serializable
- Enclosing class:
MilitaryCampaignAnalyzer
public static record MilitaryCampaignAnalyzer.Army(String name, int infantry, int cavalry, int artillery, int supportPersonnel, double dailyMarchKm)
extends Record
implements Serializable
Composition and capabilities of a military force.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theartilleryrecord component.intcavalry()Returns the value of thecavalryrecord component.doubleReturns the value of thedailyMarchKmrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intinfantry()Returns the value of theinfantryrecord component.name()Returns the value of thenamerecord component.intReturns the value of thesupportPersonnelrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Army
public Army(String name, int infantry, int cavalry, int artillery, int supportPersonnel, double dailyMarchKm) Creates an instance of aArmyrecord class.- Parameters:
name- the value for thenamerecord componentinfantry- the value for theinfantryrecord componentcavalry- the value for thecavalryrecord componentartillery- the value for theartilleryrecord componentsupportPersonnel- the value for thesupportPersonnelrecord componentdailyMarchKm- the value for thedailyMarchKmrecord 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
-
infantry
-
cavalry
-
artillery
-
supportPersonnel
public int supportPersonnel()Returns the value of thesupportPersonnelrecord component.- Returns:
- the value of the
supportPersonnelrecord component
-
dailyMarchKm
public double dailyMarchKm()Returns the value of thedailyMarchKmrecord component.- Returns:
- the value of the
dailyMarchKmrecord component
-