Class URLHashSet

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.Set

    public class URLHashSet
    extends java.util.HashSet
    Class URLHashSet
    Author:
    Davanum Srinivas (dims@apache.org)
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      URLHashSet()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(java.net.URL url)
      Adds the specified URL to this set if it is not already present.
      boolean contains​(java.net.URL url)
      Returns true if this set contains the specified element.
      static java.net.URL normalize​(java.net.URL url)
      if the url points to a file then make sure we cleanup ".." "." etc.
      boolean remove​(java.net.URL url)
      Removes the given URL from this set if it is present.
      • Methods inherited from class java.util.HashSet

        add, clear, clone, contains, isEmpty, iterator, remove, size, spliterator
      • Methods inherited from class java.util.AbstractSet

        equals, hashCode, removeAll
      • Methods inherited from class java.util.AbstractCollection

        addAll, containsAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Set

        addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
    • Constructor Detail

      • URLHashSet

        public URLHashSet()
    • Method Detail

      • add

        public boolean add​(java.net.URL url)
        Adds the specified URL to this set if it is not already present.
        Parameters:
        url - url to be added to this set.
        Returns:
        true if the set did not already contain the specified element.
      • remove

        public boolean remove​(java.net.URL url)
        Removes the given URL from this set if it is present.
        Parameters:
        url - url to be removed from this set, if present.
        Returns:
        true if the set contained the specified element.
      • contains

        public boolean contains​(java.net.URL url)
        Returns true if this set contains the specified element.
        Parameters:
        url - url whose presence in this set is to be tested.
        Returns:
        true if this set contains the specified element.
      • normalize

        public static java.net.URL normalize​(java.net.URL url)
        if the url points to a file then make sure we cleanup ".." "." etc.
        Parameters:
        url - url to be normalized
        Returns:
        normalized url