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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accumulate
(ItemType itemType, int amount) Add an item to this Difference.void
accumulate
(ItemStack stack) Add an item to this difference.static Difference
Calculate the Difference from a 'before' and 'after' view of a list of items.Get the difference map.boolean
isEmpty()
Get whether the difference is zero (no items added or removed).void
merge
(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
-