Class NamedTagsDictionary
- java.lang.Object
-
- com.alachisoft.ncache.runtime.caching.NamedTagsDictionary
-
public class NamedTagsDictionary extends java.lang.ObjectRepresents 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()Initializes the NameTagsDictionary object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String key, boolean value)Adds a boolean value against a key in the NamedTagsDictionary.voidadd(java.lang.String key, char value)Adds a character value against a key in the NamedTagsDictionary.voidadd(java.lang.String key, double value)Adds a double value against a key in the NamedTagsDictionary.voidadd(java.lang.String key, float value)Adds a float value against a key in the NamedTagsDictionary.voidadd(java.lang.String key, int value)Adds an integer value against a key in the NamedTagsDictionary.voidadd(java.lang.String key, long value)Adds a long value against a key in the NamedTagsDictionary.voidadd(java.lang.String key, java.lang.String value)Adds a string value against a key in the NamedTagsDictionary.voidadd(java.lang.String key, java.math.BigDecimal value)Adds a BigDecimal value against a key in NamedTagsDictionary.voidadd(java.lang.String key, java.util.Date value)Adds a Date value against a key in the NamedTagsDictionary.booleancontains(java.lang.String key)This method searches for the key in the NamedTagsDictionary and returns true, if it is found and false, in other case.intgetCount()Returns the number of items in the NamedTagsDictionary.java.util.IteratorgetIterator()Returns an iterator that iterates through the entries of the NamedTagsDictionary.java.util.IteratorgetKeysIterator()Returns an iterator that iterates through the keys of the NamedTagsDictionary.java.lang.ObjectgetType(java.lang.Object key)java.lang.ObjectgetValue(java.lang.String key)Gets the value of the specified key in the NamedTagsDictionary.voidremove(java.lang.String key)Removes the key value pair from the NamedTagsDictionary.
-
-
-
Method Detail
-
add
public void add(java.lang.String key, int value) throws java.lang.IllegalArgumentException, java.lang.IllegalArgumentExceptionAdds an integer value against a key in the NamedTagsDictionary.- Parameters:
key- Key of an item.value- Integer Value of an item.- Throws:
java.lang.IllegalArgumentExceptionjava.lang.IllegalArgumentException
-
add
public void add(java.lang.String key, long value) throws java.lang.IllegalArgumentException, java.lang.IllegalArgumentExceptionAdds a long value against a key in the NamedTagsDictionary.- Parameters:
key- Key of an item.value- Long Value of an item.- Throws:
java.lang.IllegalArgumentExceptionjava.lang.IllegalArgumentException
-
add
public void add(java.lang.String key, float value) throws java.lang.IllegalArgumentException, java.lang.IllegalArgumentExceptionAdds a float value against a key in the NamedTagsDictionary.- Parameters:
key- Key of an item.value- Float Value of an item.- Throws:
java.lang.IllegalArgumentExceptionjava.lang.IllegalArgumentException
-
add
public void add(java.lang.String key, double value) throws java.lang.IllegalArgumentException, java.lang.IllegalArgumentExceptionAdds a double value against a key in the NamedTagsDictionary.- Parameters:
key- Key of an item.value- Double Value of an item.- Throws:
java.lang.IllegalArgumentExceptionjava.lang.IllegalArgumentException
-
add
public void add(java.lang.String key, java.lang.String value) throws java.lang.IllegalArgumentException, java.lang.IllegalArgumentExceptionAdds a string value against a key in the NamedTagsDictionary.- Parameters:
key- Key of an item.value- String Value of an item.- Throws:
java.lang.IllegalArgumentExceptionjava.lang.IllegalArgumentException
-
add
public void add(java.lang.String key, char value) throws java.lang.IllegalArgumentException, java.lang.IllegalArgumentExceptionAdds a character value against a key in the NamedTagsDictionary.- Parameters:
key- Key of an item.value- Character Value of an item.- Throws:
java.lang.IllegalArgumentExceptionjava.lang.IllegalArgumentException
-
add
public void add(java.lang.String key, boolean value) throws java.lang.IllegalArgumentException, java.lang.IllegalArgumentExceptionAdds a boolean value against a key in the NamedTagsDictionary.- Parameters:
key- Key of an item.value- Boolean Value of an item.- Throws:
java.lang.IllegalArgumentExceptionjava.lang.IllegalArgumentException
-
add
public void add(java.lang.String key, java.util.Date value) throws java.lang.IllegalArgumentException, java.lang.IllegalArgumentExceptionAdds a Date value against a key in the NamedTagsDictionary.- Parameters:
key- Key of an item.value- Date value of an item.- Throws:
java.lang.IllegalArgumentExceptionjava.lang.IllegalArgumentException
-
add
public void add(java.lang.String key, java.math.BigDecimal value) throws java.lang.IllegalArgumentExceptionAdds a BigDecimal value against a key in NamedTagsDictionary.- Parameters:
key- Key of an item.value- BigDecimal Value of an item.- Throws:
java.lang.IllegalArgumentExceptionjava.lang.IllegalArgumentException
-
remove
public void remove(java.lang.String key)
Removes the key value pair from the NamedTagsDictionary.- Parameters:
key- Key of an item.
-
getCount
public int getCount()
Returns the number of items in the NamedTagsDictionary.- Returns:
- The number of items in the NamedTagsDictionary.
-
getIterator
public java.util.Iterator getIterator()
Returns an iterator that iterates through the entries of the NamedTagsDictionary.- Returns:
- An Iterator instance.
-
getKeysIterator
public java.util.Iterator getKeysIterator()
Returns an iterator that iterates through the keys of the NamedTagsDictionary.- Returns:
- An Iterator instance.
-
contains
public boolean contains(java.lang.String key)
This method searches for the key in the NamedTagsDictionary and returns true, if it is found and false, in other case.- 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 NamedTagsDictionary. 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)
-
-