|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.tinyradius.dictionary.MemoryDictionary
public class MemoryDictionary
A dictionary that keeps the values and names in hash maps
in the memory. The dictionary has to be filled using the
methods addAttributeType
and
addVendor
.
addAttributeType(AttributeType)
,
addVendor(int, String)
,
Dictionary
,
WritableDictionary
Constructor Summary | |
---|---|
MemoryDictionary()
|
Method Summary | |
---|---|
void |
addAttributeType(AttributeType attributeType)
Adds an AttributeType object to the cache. |
void |
addVendor(int vendorId,
java.lang.String vendorName)
Adds the given vendor to the cache. |
AttributeType |
getAttributeTypeByCode(int typeCode)
Returns the AttributeType for the vendor -1 from the cache. |
AttributeType |
getAttributeTypeByCode(int vendorCode,
int typeCode)
Returns the specified AttributeType object. |
AttributeType |
getAttributeTypeByName(java.lang.String typeName)
Retrieves the attribute type with the given name. |
int |
getVendorId(java.lang.String vendorName)
Searches the vendor with the given name and returns its code. |
java.lang.String |
getVendorName(int vendorId)
Retrieves the name of the vendor with the given code from the cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MemoryDictionary()
Method Detail |
---|
public AttributeType getAttributeTypeByCode(int typeCode)
getAttributeTypeByCode
in interface Dictionary
typeCode
- attribute type code
Dictionary.getAttributeTypeByCode(int)
public AttributeType getAttributeTypeByCode(int vendorCode, int typeCode)
getAttributeTypeByCode
in interface Dictionary
vendorCode
- vendor ID or -1 for "no vendor"typeCode
- attribute type code
Dictionary.getAttributeTypeByCode(int, int)
public AttributeType getAttributeTypeByName(java.lang.String typeName)
getAttributeTypeByName
in interface Dictionary
typeName
- name of the attribute type
Dictionary.getAttributeTypeByName(java.lang.String)
public int getVendorId(java.lang.String vendorName)
getVendorId
in interface Dictionary
vendorName
- vendor name
Dictionary.getVendorId(java.lang.String)
public java.lang.String getVendorName(int vendorId)
getVendorName
in interface Dictionary
vendorId
- vendor number
Dictionary.getVendorName(int)
public void addVendor(int vendorId, java.lang.String vendorName)
addVendor
in interface WritableDictionary
vendorId
- vendor IDvendorName
- name of the vendor
java.lang.IllegalArgumentException
- empty vendor name, invalid vendor IDpublic void addAttributeType(AttributeType attributeType)
addAttributeType
in interface WritableDictionary
attributeType
- AttributeType object
java.lang.IllegalArgumentException
- duplicate attribute name/type code
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |