Package javax.help

Class FlatMap

  • All Implemented Interfaces:
    java.io.Serializable, Map

    public class FlatMap
    extends java.lang.Object
    implements Map, java.io.Serializable
    A FlatMap is a simple implementation of a Map. It is used to represent a Map for a single file.
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  FlatMap.FlatMapResourceBundle
      FlatMapResourceBundle is a ResourceBundle but unlike most ResourceBundles it is not locale-based and is loaded via the constructor, not getBundle.
      • Nested classes/interfaces inherited from interface javax.help.Map

        Map.ID
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String publicIDString
      PublicID (known to this XML processor) to the DTD for version 1.0 of the Map
      static java.lang.String publicIDString_V2
      PublicID (known to this XML processor) to the DTD for version 1.0 of the Map
    • Constructor Summary

      Constructors 
      Constructor Description
      FlatMap​(java.net.URL base, HelpSet hs)
      Create a FlatMap from a given URL.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Enumeration getAllIDs()
      Gets an enumeration of all the IDs in a Map.
      Map.ID getClosestID​(java.net.URL url)
      Determines the ID that is "closest" to this URL (with a given anchor).
      HelpSet getHelpSet()
      The HelpSet for this Map.
      Map.ID getIDFromURL​(java.net.URL url)
      Gets the ID for this URL.
      java.util.Enumeration getIDs​(java.net.URL url)
      Determines the IDs related to this URL.
      java.net.URL getURLFromID​(Map.ID iden)
      Gets the URL that corresponds to a given ID in the map.
      boolean isID​(java.net.URL url)
      Determines if the URL corresponds to an ID in the Map.
      boolean isValidID​(java.lang.String id, HelpSet hs)
      Determines whether the given ID is valid.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • publicIDString

        public static final java.lang.String publicIDString
        PublicID (known to this XML processor) to the DTD for version 1.0 of the Map
        See Also:
        Constant Field Values
      • publicIDString_V2

        public static final java.lang.String publicIDString_V2
        PublicID (known to this XML processor) to the DTD for version 1.0 of the Map
        See Also:
        Constant Field Values
    • Constructor Detail

      • FlatMap

        public FlatMap​(java.net.URL base,
                       HelpSet hs)
                throws java.io.IOException
        Create a FlatMap from a given URL.
        Parameters:
        source - The URL that is the source for all references in this Map.
        hs - The HelpSet providing "context" for this Map.
        Throws:
        java.lang.IllegalArgumentException - if hs doesn't have nested HelpSets.
        java.io.IOException
    • Method Detail

      • getHelpSet

        public HelpSet getHelpSet()
        The HelpSet for this Map.
      • isValidID

        public boolean isValidID​(java.lang.String id,
                                 HelpSet hs)
        Determines whether the given ID is valid. If hs is null it is ignored.
        Specified by:
        isValidID in interface Map
        Parameters:
        id - The String ID.
        hs - The HelpSet against which to resolve the string.
        Returns:
        True if id is valid, false if not valid.
      • getAllIDs

        public java.util.Enumeration getAllIDs()
        Gets an enumeration of all the IDs in a Map.
        Specified by:
        getAllIDs in interface Map
        Returns:
        An enumeration of all the IDs in a Map.
      • getURLFromID

        public java.net.URL getURLFromID​(Map.ID iden)
                                  throws java.net.MalformedURLException
        Gets the URL that corresponds to a given ID in the map.
        Specified by:
        getURLFromID in interface Map
        Parameters:
        iden - The iden to get the URL for. If iden is null it is treated as an unresolved ID and will return null.
        Returns:
        URL The matching URL. Null if this map cannot solve the ID
        Throws:
        java.net.MalformedURLException - if the URLspecification found is malformed
      • isID

        public boolean isID​(java.net.URL url)
        Determines if the URL corresponds to an ID in the Map.
        Specified by:
        isID in interface Map
        Parameters:
        url - The URL to check on.
        Returns:
        true If this is an ID, otherwise false.
      • getIDFromURL

        public Map.ID getIDFromURL​(java.net.URL url)
        Gets the ID for this URL.
        Specified by:
        getIDFromURL in interface Map
        Parameters:
        url - The URL to get the ID for.
        Returns:
        The id (Map.ID) or null if URL is not an ID.
      • getClosestID

        public Map.ID getClosestID​(java.net.URL url)
        Determines the ID that is "closest" to this URL (with a given anchor). The definition of this is up to the implementation of Map. In particular, it may be the same as getIDFromURL().
        Specified by:
        getClosestID in interface Map
        Parameters:
        url - A URL
        Returns:
        The closest ID in this map to the given URL
      • getIDs

        public java.util.Enumeration getIDs​(java.net.URL url)
        Determines the IDs related to this URL.
        Specified by:
        getIDs in interface Map
        Parameters:
        URL - The URL to compare the Map IDs to.
        Returns:
        Enumeration of Map.IDs