Class AbstractGroup.ElementMap

  • Enclosing class:
    AbstractGroup

    protected static class AbstractGroup.ElementMap
    extends java.lang.Object
    Stores a 'cached' map of child elements to speed up the access.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ElementMap()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean any()
      Returns true if any element.
      Element get​(java.lang.String name)
      Get the element with name.
      java.util.List<Element> getAll​(java.lang.String name)
      Get a readonly list of all elements with name.
      java.util.Set<java.lang.String> names()
      Returns a readonly set of names of all elements.
      void put​(Element e, Element following)
      Put an element into the map.
      void remove​(Element e)
      Remove e from the map.
      int size()
      Returns the number of elements.
      • Methods inherited from class java.lang.Object

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

      • ElementMap

        protected ElementMap()
    • Method Detail

      • put

        public final void put​(Element e,
                              Element following)
        Put an element into the map. If the "following" argument is assocaied the same name, we will add the element before the "following".
      • get

        public final Element get​(java.lang.String name)
        Get the element with name. If you have many values associated with the same key, it returned the head for you.
      • getAll

        public final java.util.List<Element> getAll​(java.lang.String name)
        Get a readonly list of all elements with name.
      • remove

        public final void remove​(Element e)
        Remove e from the map.
      • any

        public final boolean any()
        Returns true if any element.
      • names

        public final java.util.Set<java.lang.String> names()
        Returns a readonly set of names of all elements.
      • size

        public final int size()
        Returns the number of elements.