Package megamek.client.bot.princess
Record Class AerospaceGeometry.AltitudeBand
java.lang.Object
java.lang.Record
megamek.client.bot.princess.AerospaceGeometry.AltitudeBand
- Record Components:
lowest- the lowest altitude in the bandhighest- the highest altitude in the band
- Enclosing class:
AerospaceGeometry
An inclusive range of altitudes.
A transient value passed between bot calculations; it is never written to a save file, so it needs
no SerializationHelper converter.
-
Constructor Summary
ConstructorsConstructorDescriptionAltitudeBand(int lowest, int highest) Creates an instance of aAltitudeBandrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(int altitude) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.inthighest()Returns the value of thehighestrecord component.intlowest()Returns the value of thelowestrecord component.intmidpoint()The altitude in this band a unit is likeliest to be found at, used when nothing better is known.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
contains
public boolean contains(int altitude) - Parameters:
altitude- the altitude to test- Returns:
trueif the altitude falls inside this band
-
midpoint
public int midpoint()The altitude in this band a unit is likeliest to be found at, used when nothing better is known.- Returns:
- the midpoint of the band
-
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 with '=='. -
lowest
public int lowest()Returns the value of thelowestrecord component.- Returns:
- the value of the
lowestrecord component
-
highest
public int highest()Returns the value of thehighestrecord component.- Returns:
- the value of the
highestrecord component
-