Package megameklab.printing
Record Class IntrinsicPhysicalInventoryEntry
java.lang.Object
java.lang.Record
megameklab.printing.IntrinsicPhysicalInventoryEntry
- All Implemented Interfaces:
InventoryEntry
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface megameklab.printing.InventoryEntry
DAGGER, DASH, DOUBLE_DAGGER, MINUS -
Constructor Summary
ConstructorsConstructorDescriptionIntrinsicPhysicalInventoryEntry(String name, String location, String damage, String mod, boolean optional) Creates an instance of aIntrinsicPhysicalInventoryEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondamage()Returns the value of thedamagerecord component.final booleanIndicates whether some other object is "equal to" this one.getDamageField(int row) static ArrayList<InventoryEntry>getEntriesFor(megamek.common.units.Entity entity) getExtremeField(int row) getHeatField(int row) getLocationField(int row) getLongField(int row) getMediumField(int row) getMinField(int row) getModField(int row, boolean baseOnly) getNameField(int row) getQuantityField(int row) getShortField(int row) final inthashCode()Returns a hash code value for this object.booleanbooleanbooleanlocation()Returns the value of thelocationrecord component.mod()Returns the value of themodrecord component.name()Returns the value of thenamerecord component.intnRows()booleanoptional()Returns the value of theoptionalrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface megameklab.printing.InventoryEntry
aeroAVMod, aeroAVMod, getModField
-
Constructor Details
-
IntrinsicPhysicalInventoryEntry
public IntrinsicPhysicalInventoryEntry(String name, String location, String damage, String mod, boolean optional) Creates an instance of aIntrinsicPhysicalInventoryEntryrecord class.- Parameters:
name- the value for thenamerecord componentlocation- the value for thelocationrecord componentdamage- the value for thedamagerecord componentmod- the value for themodrecord componentoptional- the value for theoptionalrecord component
-
-
Method Details
-
getEntriesFor
-
optional
public boolean optional()Returns the value of theoptionalrecord component.- Returns:
- the value of the
optionalrecord component
-
nRows
public int nRows()- Specified by:
nRowsin interfaceInventoryEntry- Returns:
- The number of rows this entry takes on the table. This does not consider text that is wrapped due to insufficient field width.
-
getUniqueId
- Specified by:
getUniqueIdin interfaceInventoryEntry
-
getQuantityField
- Specified by:
getQuantityFieldin interfaceInventoryEntry- Parameters:
row- The row index within the entry. Should be < nRows()- Returns:
- The number of identical equipment pieces represented by this entry
-
getNameField
- Specified by:
getNameFieldin interfaceInventoryEntry- Parameters:
row- The row index within the entry. Should be < nRows()- Returns:
- The name of the equipment
-
isDamaged
public boolean isDamaged()- Specified by:
isDamagedin interfaceInventoryEntry- Returns:
- If is damaged
-
getLocationField
- Specified by:
getLocationFieldin interfaceInventoryEntry- Parameters:
row- The row index within the entry. Should be < nRows()- Returns:
- The location/firing arc
-
getHeatField
- Specified by:
getHeatFieldin interfaceInventoryEntry- Parameters:
row- The row index within the entry. Should be < nRows()- Returns:
- The amount of heat generated
-
getDamageField
- Specified by:
getDamageFieldin interfaceInventoryEntry- Parameters:
row- The row index within the entry. Should be < nRows()- Returns:
- The damage caused by the weapon, as well as its type code
-
getMinField
- Specified by:
getMinFieldin interfaceInventoryEntry- Parameters:
row- The row index within the entry. Should be < nRows()- Returns:
- The upper limit of the minimum range
-
getShortField
- Specified by:
getShortFieldin interfaceInventoryEntry- Parameters:
row- The row index within the entry. Should be < nRows()- Returns:
- The upper limit of the short range (ground units) or SRV (aero units)
-
getMediumField
- Specified by:
getMediumFieldin interfaceInventoryEntry- Parameters:
row- The row index within the entry. Should be < nRows()- Returns:
- The upper limit of the medium range (ground units) or MRV (aero units)
-
getLongField
- Specified by:
getLongFieldin interfaceInventoryEntry- Parameters:
row- The row index within the entry. Should be < nRows()- Returns:
- The upper limit of the long range (ground units) or LRV (aero units)
-
getExtremeField
- Specified by:
getExtremeFieldin interfaceInventoryEntry- Parameters:
row- The row index within the entry. Should be < nRows()- Returns:
- The ERV (aero units)
-
getModField
- Specified by:
getModFieldin interfaceInventoryEntry- Parameters:
row- The row index within the entry- Returns:
- The to-hit modifier of the item
-
indentMultiline
public boolean indentMultiline()- Specified by:
indentMultilinein interfaceInventoryEntry- Returns:
- Whether lines after the first line should be indented
-
hasQuirks
public boolean hasQuirks()- Specified by:
hasQuirksin interfaceInventoryEntry- Returns:
- Whether the entry has any quirks that need to be printed
-
getQuirksField
- Specified by:
getQuirksFieldin interfaceInventoryEntry- Returns:
- The quirk text to print, if any
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-
damage
Returns the value of thedamagerecord component.- Returns:
- the value of the
damagerecord component
-
mod
Returns the value of themodrecord component.- Returns:
- the value of the
modrecord component
-