Class NamedTagsDictionary


  • public class NamedTagsDictionary
    extends java.lang.Object
    Represents a dictionary that can be associated with the cache items to provide extra information so that items are grouped together and can be queried efficiently based on the provided information.
    • Constructor Summary

      Constructors 
      Constructor Description
      NamedTagsDictionary()
      Initialize the NameTagsDictionary object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.String key, boolean value)
      Adds boolean value against a key in named tags dictionary.
      void add​(java.lang.String key, char value)
      Adds character value against a key in named tags dictionary.
      void add​(java.lang.String key, double value)
      Adds double value against a key in named tags dictionary.
      void add​(java.lang.String key, float value)
      Adds float value against a key in named tags dictionary.
      void add​(java.lang.String key, int value)
      Adds integer value against a key in named tags dictionary.
      void add​(java.lang.String key, long value)
      Adds long value against a key in named tags dictionary.
      void add​(java.lang.String key, java.lang.String value)
      Adds String value against a key in named tags dictionary.
      void add​(java.lang.String key, java.math.BigDecimal value)
      Adds BigDecimal value against a key in named tags dictionary.
      void add​(java.lang.String key, java.util.Date value)
      Adds Date value against a key in named tags dictionary.
      boolean contains​(java.lang.String key)
      Search for the key in named tags dictionary and return true if it is found and otherwise falsee.
      int getCount()
      Returns the number of items in named tags dictionary.
      java.util.Iterator getIterator()
      Returns an iterator that iterates through the entries of named tags dictionary.
      java.util.Iterator getKeysIterator()
      Returns an iterator that iterates through the keys of named tags dictionary.
      java.lang.Object getType​(java.lang.Object key)  
      java.lang.Object getValue​(java.lang.String key)
      Gets the value of the specified key in the named tags dictionary.If key is not found returns null.
      void remove​(java.lang.String key)
      Removes the key value pair from named tags dictionary.
      • Methods inherited from class java.lang.Object

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

      • NamedTagsDictionary

        public NamedTagsDictionary()
        Initialize the NameTagsDictionary object.
    • Method Detail

      • add

        public void add​(java.lang.String key,
                        int value)
                 throws java.lang.IllegalArgumentException,
                        java.lang.IllegalArgumentException
        Adds integer value against a key in named tags dictionary.
        Parameters:
        key - Key of an item.
        value - integer Value of an item.
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalArgumentException
      • add

        public void add​(java.lang.String key,
                        long value)
                 throws java.lang.IllegalArgumentException,
                        java.lang.IllegalArgumentException
        Adds long value against a key in named tags dictionary.
        Parameters:
        key - Key of an item.
        value - long Value of an item.
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalArgumentException
      • add

        public void add​(java.lang.String key,
                        float value)
                 throws java.lang.IllegalArgumentException,
                        java.lang.IllegalArgumentException
        Adds float value against a key in named tags dictionary.
        Parameters:
        key - Key of an item.
        value - float Value of an item.
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalArgumentException
      • add

        public void add​(java.lang.String key,
                        double value)
                 throws java.lang.IllegalArgumentException,
                        java.lang.IllegalArgumentException
        Adds double value against a key in named tags dictionary.
        Parameters:
        key - Key of an item.
        value - double Value of an item.
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalArgumentException
      • add

        public void add​(java.lang.String key,
                        java.lang.String value)
                 throws java.lang.IllegalArgumentException,
                        java.lang.IllegalArgumentException
        Adds String value against a key in named tags dictionary.
        Parameters:
        key - Key of an item.
        value - String Value of an item.
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalArgumentException
      • add

        public void add​(java.lang.String key,
                        char value)
                 throws java.lang.IllegalArgumentException,
                        java.lang.IllegalArgumentException
        Adds character value against a key in named tags dictionary.
        Parameters:
        key - Key of an item.
        value - character Value of an item.
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalArgumentException
      • add

        public void add​(java.lang.String key,
                        boolean value)
                 throws java.lang.IllegalArgumentException,
                        java.lang.IllegalArgumentException
        Adds boolean value against a key in named tags dictionary.
        Parameters:
        key - Key of an item.
        value - boolean Value of an item.
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalArgumentException
      • add

        public void add​(java.lang.String key,
                        java.util.Date value)
                 throws java.lang.IllegalArgumentException,
                        java.lang.IllegalArgumentException
        Adds Date value against a key in named tags dictionary.
        Parameters:
        key - Key of an item.
        value - Date Value of an item.
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalArgumentException
      • add

        public void add​(java.lang.String key,
                        java.math.BigDecimal value)
                 throws java.lang.IllegalArgumentException
        Adds BigDecimal value against a key in named tags dictionary.
        Parameters:
        key - Key of an item.
        value - BigDecimal Value of an item.
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalArgumentException
      • remove

        public void remove​(java.lang.String key)
        Removes the key value pair from named tags dictionary.
        Parameters:
        key - Key of an item.
      • getCount

        public int getCount()
        Returns the number of items in named tags dictionary.
        Returns:
        the number of items in named tags dictionary.
      • getIterator

        public java.util.Iterator getIterator()
        Returns an iterator that iterates through the entries of named tags dictionary.
        Returns:
        An Iterator instance.
      • getKeysIterator

        public java.util.Iterator getKeysIterator()
        Returns an iterator that iterates through the keys of named tags dictionary.
        Returns:
        An Iterator instance.
      • contains

        public boolean contains​(java.lang.String key)
        Search for the key in named tags dictionary and return true if it is found and otherwise falsee.
        Parameters:
        key - The key to be searched.
        Returns:
        True if key exists otherwise false.
      • getValue

        public java.lang.Object getValue​(java.lang.String key)
        Gets the value of the specified key in the named tags dictionary.If key is not found returns null.
        Parameters:
        key - The key to be searched.
        Returns:
        Associated value of the key if the key exists otherwise null.
      • getType

        public java.lang.Object getType​(java.lang.Object key)