Class Difference
java.lang.Object
com.janboerman.invsee.spigot.api.logging.Difference
The Difference of a
SpectatorInventoryView is the set of items that were added and removed the SpectatorInventory.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccumulate(ItemType itemType, int amount) Add an item to this Difference.voidaccumulate(ItemStack stack) Add an item to this difference.static DifferenceCalculate the Difference from a 'before' and 'after' view of a list of items.Get the difference map.booleanisEmpty()Get whether the difference is zero (no items added or removed).voidmerge(Difference other) Merge this difference with another: add all differences from the other Difference to this Difference.
-
Constructor Details
-
Difference
public Difference()
-
-
Method Details
-
getDifference
-
isEmpty
public boolean isEmpty()Get whether the difference is zero (no items added or removed).- Returns:
- true if the difference is zero
-
merge
Merge this difference with another: add all differences from the other Difference to this Difference.- Parameters:
other- the other difference
-
accumulate
Add an item to this difference.- Parameters:
stack- the item
-
accumulate
Add an item to this Difference.- Parameters:
itemType- the itemamount- how many of the item
-
calculate
Calculate the Difference from a 'before' and 'after' view of a list of items.- Parameters:
before- the 'before' viewafter- the 'after' view- Returns:
- the difference
-