bibliothek.gui.dock.common.perspective
Class LocationHistory

java.lang.Object
  extended by bibliothek.gui.dock.common.perspective.LocationHistory

public class LocationHistory
extends Object

An ordered map of ExtendedModes and Locations, ordered by the time when the location was recorded.

Author:
Benjamin Sigg

Constructor Summary
LocationHistory()
           
 
Method Summary
 void add(ExtendedMode mode, Location location)
          Sets the location that is to be used for mode.
 Location get(ExtendedMode mode)
          Gets the location that is to be used for mode.
 ExtendedMode getLastMode()
          Gets the newest entry of this history.
 Map<Path,Location> getLocations()
          Gets all the locations that are stored in this history.
 ExtendedMode getMode(int index)
          Gets the index'th entry of this history, where an index of 0 represents the oldest entry.
 List<Path> getOrder()
          Gets all the identifiers of the ordered ExtendedModes.
 int getSize()
          Gets the number of entries this history has.
 void insert(int index, ExtendedMode mode, Location location)
          Sets the location that is to be used for mode.
 void remove(ExtendedMode mode)
          Removes any entries related to mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationHistory

public LocationHistory()
Method Detail

add

public void add(ExtendedMode mode,
                Location location)
Sets the location that is to be used for mode.

Parameters:
mode - the mode of the location
location - the location to store

insert

public void insert(int index,
                   ExtendedMode mode,
                   Location location)
Sets the location that is to be used for mode.

Parameters:
index - the location of the mode, where 0 represents the oldest entry
mode - the mode of the location
location - the location to store

get

public Location get(ExtendedMode mode)
Gets the location that is to be used for mode.

Parameters:
mode - the mode whose location is searched
Returns:
the location or null if not found

remove

public void remove(ExtendedMode mode)
Removes any entries related to mode.

Parameters:
mode - the mode to remove

getSize

public int getSize()
Gets the number of entries this history has.

Returns:
the number of entries

getMode

public ExtendedMode getMode(int index)
Gets the index'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

public ExtendedMode getLastMode()
Gets the newest entry of this history.

Returns:
the newest mode or null

getOrder

public List<Path> getOrder()
Gets all the identifiers of the ordered ExtendedModes.

Returns:
the order of modes

getLocations

public Map<Path,Location> getLocations()
Gets all the locations that are stored in this history.

Returns:
the locations