Class LocationHistory
java.lang.Object
bibliothek.gui.dock.common.perspective.LocationHistory
An ordered map of
ExtendedModes and Locations, ordered by
the time when the location was recorded.- Author:
- Benjamin Sigg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ExtendedMode mode, Location location) Sets thelocationthat is to be used formode.get(ExtendedMode mode) Gets the location that is to be used formode.Gets the newest entry of this history.Gets all the locations that are stored in this history.getMode(int index) Gets theindex'th entry of this history, where an index of 0 represents the oldest entry.getOrder()Gets all the identifiers of the orderedExtendedModes.intgetSize()Gets the number of entries this history has.voidinsert(int index, ExtendedMode mode, Location location) Sets thelocationthat is to be used formode.voidremove(ExtendedMode mode) Removes any entries related tomode.
-
Constructor Details
-
LocationHistory
public LocationHistory()
-
-
Method Details
-
add
Sets thelocationthat is to be used formode.- Parameters:
mode- the mode of the locationlocation- the location to store
-
insert
Sets thelocationthat is to be used formode.- Parameters:
index- the location of the mode, where 0 represents the oldest entrymode- the mode of the locationlocation- the location to store
-
get
Gets the location that is to be used formode.- Parameters:
mode- the mode whose location is searched- Returns:
- the location or
nullif not found
-
remove
Removes any entries related tomode.- Parameters:
mode- the mode to remove
-
getSize
public int getSize()Gets the number of entries this history has.- Returns:
- the number of entries
-
getMode
Gets theindex'th entry of this history, where an index of 0 represents the oldest entry.- Parameters:
index- the location of the entry- Returns:
- the mode at
index
-
getLastMode
Gets the newest entry of this history.- Returns:
- the newest mode or
null
-
getOrder
Gets all the identifiers of the orderedExtendedModes.- Returns:
- the order of modes
-
getLocations
Gets all the locations that are stored in this history.- Returns:
- the locations
-