Package megamek.client.ui.advancedsearch
Class MekSearchFilter
java.lang.Object
megamek.client.ui.advancedsearch.MekSearchFilter
Class to perform filtering on units. This class stores a list of
constraints and for a given
MekSummary
it can tell whether
that MekSummary
meets the constraints or not.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
This class allows to create a tree where the leaf nodes contain names and quantities of pieces of equipment while the non-leaf nodes contain boolean operations (AND and OR).static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
boolean
int
int
int
int
int
int
-
Constructor Summary
ConstructorsConstructorDescriptionDeep copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
createFilterExpressionFromTokens
(List<megamek.client.ui.advancedsearch.FilterToken> toks) Creates an Expressiontree from a collection of tokens.boolean
Evalutes the given list of equipment names and quantities against the expression tree in this filter.static boolean
isMatch
(MekSummary mek, MekSearchFilter f)
-
Field Details
-
sStartWalk
-
sEndWalk
-
sStartJump
-
sEndJump
-
iArmor
public int iArmor -
iOmni
public int iOmni -
iMilitary
public int iMilitary -
iIndustrial
public int iIndustrial -
iMountedInfantry
public int iMountedInfantry -
iWaterOnly
public int iWaterOnly -
iDoomedOnGround
public int iDoomedOnGround -
iDoomedInAtmosphere
public int iDoomedInAtmosphere -
iDoomedInSpace
public int iDoomedInSpace -
iDoomedInExtremeTemp
public int iDoomedInExtremeTemp -
iDoomedInVacuum
public int iDoomedInVacuum -
iSupportVehicle
public int iSupportVehicle -
iAerospaceFighter
public int iAerospaceFighter -
sStartTankTurrets
-
sEndTankTurrets
-
sStartLowerArms
-
sEndLowerArms
-
sStartHands
-
sEndHands
-
iClanEngine
public int iClanEngine -
iOfficial
public int iOfficial -
iCanon
public int iCanon -
iPatchwork
public int iPatchwork -
source
-
mulid
-
iInvalid
public int iInvalid -
iFailedToLoadEquipment
public int iFailedToLoadEquipment -
sStartTroopSpace
-
sEndTroopSpace
-
sStartASFBays
-
sEndASFBays
-
sStartASFDoors
-
sEndASFDoors
-
sStartASFUnits
-
sEndASFUnits
-
sStartSmallCraftBays
-
sEndSmallCraftBays
-
sStartSmallCraftDoors
-
sEndSmallCraftDoors
-
sStartSmallCraftUnits
-
sEndSmallCraftUnits
-
sStartMekBays
-
sEndMekBays
-
sStartMekDoors
-
sEndMekDoors
-
sStartMekUnits
-
sEndMekUnits
-
sStartHeavyVehicleBays
-
sEndHeavyVehicleBays
-
sStartHeavyVehicleDoors
-
sEndHeavyVehicleDoors
-
sStartHeavyVehicleUnits
-
sEndHeavyVehicleUnits
-
sStartLightVehicleBays
-
sEndLightVehicleBays
-
sStartLightVehicleDoors
-
sEndLightVehicleDoors
-
sStartLightVehicleUnits
-
sEndLightVehicleUnits
-
sStartProtomekBays
-
sEndProtomekBays
-
sStartProtomekDoors
-
sEndProtomekDoors
-
sStartProtomekUnits
-
sEndProtomekUnits
-
sStartBattleArmorBays
-
sEndBattleArmorBays
-
sStartBattleArmorDoors
-
sEndBattleArmorDoors
-
sStartBattleArmorUnits
-
sEndBattleArmorUnits
-
sStartInfantryBays
-
sEndInfantryBays
-
sStartInfantryDoors
-
sEndInfantryDoors
-
sStartInfantryUnits
-
sEndInfantryUnits
-
sStartSuperHeavyVehicleBays
-
sEndSuperHeavyVehicleBays
-
sStartSuperHeavyVehicleDoors
-
sEndSuperHeavyVehicleDoors
-
sStartSuperHeavyVehicleUnits
-
sEndSuperHeavyVehicleUnits
-
sStartDropshuttleBays
-
sEndDropshuttleBays
-
sStartDropshuttleDoors
-
sEndDropshuttleDoors
-
sStartDropshuttleUnits
-
sEndDropshuttleUnits
-
sStartDockingCollars
-
sEndDockingCollars
-
sStartBattleArmorHandles
-
sEndBattleArmorHandles
-
sStartCargoBayUnits
-
sEndCargoBayUnits
-
sStartYear
-
sEndYear
-
sStartTons
-
sEndTons
-
sStartBV
-
sEndBV
-
isDisabled
public boolean isDisabled -
engineType
-
engineTypeExclude
-
gyroType
-
gyroTypeExclude
-
armorType
-
armorTypeExclude
-
internalsType
-
internalsTypeExclude
-
movemodes
-
movemodeExclude
-
cockpitType
-
cockpitTypeExclude
-
techLevel
-
techLevelExclude
-
techBase
-
techBaseExclude
-
quirkInclude
public int quirkInclude -
quirkExclude
public int quirkExclude -
quirkType
-
quirkTypeExclude
-
weaponQuirkInclude
public int weaponQuirkInclude -
weaponQuirkExclude
public int weaponQuirkExclude -
weaponQuirkType
-
weaponQuirkTypeExclude
-
checkEquipment
public boolean checkEquipment -
filterMek
public int filterMek -
filterBipedMek
public int filterBipedMek -
filterProtomek
public int filterProtomek -
filterLAM
public int filterLAM -
filterTripod
public int filterTripod -
filterQuad
public int filterQuad -
filterQuadVee
public int filterQuadVee -
filterAero
public int filterAero -
filterFixedWingSupport
public int filterFixedWingSupport -
filterConvFighter
public int filterConvFighter -
filterSmallCraft
public int filterSmallCraft -
filterDropship
public int filterDropship -
filterJumpship
public int filterJumpship -
filterWarship
public int filterWarship -
filterSpaceStation
public int filterSpaceStation -
filterInfantry
public int filterInfantry -
filterBattleArmor
public int filterBattleArmor -
filterTank
public int filterTank -
filterVTOL
public int filterVTOL -
filterSupportVTOL
public int filterSupportVTOL -
filterGunEmplacement
public int filterGunEmplacement -
filterSupportTank
public int filterSupportTank -
filterLargeSupportTank
public int filterLargeSupportTank -
filterSuperHeavyTank
public int filterSuperHeavyTank -
equipmentCriteria
-
-
Constructor Details
-
MekSearchFilter
public MekSearchFilter() -
MekSearchFilter
Deep copy constructor. New instantiations of all state variables are created.- Parameters:
sf
- TheMekSearchFilter
to create a copy of.
-
-
Method Details
-
createFilterExpressionFromTokens
public void createFilterExpressionFromTokens(List<megamek.client.ui.advancedsearch.FilterToken> toks) throws MekSearchFilter.FilterParsingException Creates an Expressiontree from a collection of tokens. -
getEquipmentExpression
-
isMatch
-
evaluate
Evalutes the given list of equipment names and quantities against the expression tree in this filter.- Parameters:
eq
- Collection of equipment namesqty
- The number of each piece of equipment- Returns:
- True if the provided lists satisfy the expression tree
-