javax.help
Class TryMap
- Map, Serializable
public class TryMap
extends java.lang.Object
implements Map, Serializable
A Map that can combine a number of other Maps in an
efficient manner.
Currently this is a brute-force implementation.
TryMap() - Creates an empty Map.
|
void | add(Map map) - Adds a map to a "filter" Map.
|
Enumeration | getAllIDs() - Gets an enumeration of all the IDs in a Map.
|
Map.ID | getClosestID(URL url) - Determines the ID that is "closest" to this URL (with a given anchor).
|
Map.ID | getIDFromURL(URL url) - Determines the ID for this URL.
|
Enumeration | getIDs(URL url) - Gets the the IDs related to this URL.
|
Enumeration | getMaps() - Enumerates all the Maps in this TryMap.
|
URL | getURLFromID(Map.ID id) - Gets the URL that corresponds to a given ID in the Map.
|
boolean | isID(URL url) - Determines if the URL corresponds to an ID in the Map.
|
boolean | isValidID(String id, HelpSet hs) - Determines if the ID is valid (known to in the project file).
|
boolean | remove(Map map) - Removes a Map from this "filter" Map.
|
TryMap
public TryMap()
Creates an empty Map.
This is useful for filtering and to add/remove to/from it.
add
public void add(Map map)
Adds a map to a "filter" Map.
Adding a composed map to another is equivalent to
adding the entire Map individually.
map
- The new Map to add. If Map is null it is not added.
getAllIDs
public Enumeration getAllIDs()
Gets an enumeration of all the IDs in a Map.
- getAllIDs in interface Map
getClosestID
public Map.ID getClosestID(URL url)
Determines the ID that is "closest" to this URL (with a given anchor).
- getClosestID in interface Map
- The closest ID in this map to the given URL
getIDFromURL
public Map.ID getIDFromURL(URL url)
Determines the ID for this URL.
- getIDFromURL in interface Map
url
- The URL to get the ID for.
- The ID (Map.ID), or null if URL is not an ID
getIDs
public Enumeration getIDs(URL url)
Gets the the IDs related to this URL.
- getIDs in interface Map
- Enumeration of IDs (Strings)
getMaps
public Enumeration getMaps()
Enumerates all the Maps in this TryMap.
- An enumeration of the Maps added.
getURLFromID
public URL getURLFromID(Map.ID id)
throws MalformedURLException
Gets the URL that corresponds to a given ID in the Map.
- getURLFromID in interface Map
id
- The ID for which to get the URL. If id is null it is
treated as an unresolved ID and returns null.
- URL The matching URL. Null if this Map cannot resolve the ID.
isID
public boolean isID(URL url)
Determines if the URL corresponds to an ID in the Map.
- isID in interface Map
url
- The URL to check on.
- True if this is an ID, false otherwise.
isValidID
public boolean isValidID(String id,
HelpSet hs)
Determines if the ID is valid (known to in the project file).
- isValidID in interface Map
id
- The ID to check. A null ID is a valid parameterhs
- The HelpSet against which to resolve the string.
- True if id is valid, false if not valid.
remove
public boolean remove(Map map)
Removes a Map from this "filter" Map.
- Whether the Map is already present. If the Map is
null or was not previously added, returns "false".