Methods Summary |
---|
public boolean | equals(java.lang.Object obj)
if(obj==this)
{
return true;
}
if (!(obj instanceof NumberHashMap))
{
return false;
}
NumberHashMap that = (NumberHashMap) obj;
return
EqualsUtil.areEqual(hasEmptyValue, that.hasEmptyValue) &&
EqualsUtil.areEqual(keyToValue, that.keyToValue) &&
EqualsUtil.areEqual(valueToKey, that.valueToKey) &&
super.equals(that);
|
public java.util.Map | getKeyToValue()
return keyToValue;
|
public java.util.Map | getValueToKey()
return valueToKey;
|
public java.util.Iterator | iterator()
if (keyToValue == null)
{
return null;
}
else
{
// put them in a treeset first to sort them
TreeSet<String> treeSet = new TreeSet<String>(keyToValue.values());
if (hasEmptyValue)
{
treeSet.add("");
}
return treeSet.iterator();
}
|
public void | readByteArray(byte[] arr, int offset)Read the key from the buffer.
super.readByteArray(arr, offset);
//Mismatch:Superclass uses Long, but maps expect Integer
Integer intValue = ((Long) value).intValue();
if (!keyToValue.containsKey(intValue))
{
if (!hasEmptyValue)
{
throw new InvalidDataTypeException(ErrorMessage.MP3_REFERENCE_KEY_INVALID.getMsg(identifier, intValue));
}
else if (identifier.equals(DataTypes.OBJ_PICTURE_TYPE))
{
logger.warning(ErrorMessage.MP3_PICTURE_TYPE_INVALID.getMsg(value));
}
}
|
public void | setValue(java.lang.Object value)
if (value instanceof Byte)
{
this.value = (long) ((Byte) value).byteValue();
}
else if (value instanceof Short)
{
this.value = (long) ((Short) value).shortValue();
}
else if (value instanceof Integer)
{
this.value = (long) ((Integer) value).intValue();
}
else
{
this.value = value;
}
|
public java.lang.String | toString()
if (value == null)
{
return "";
}
else if (keyToValue.get(value) == null)
{
return "";
}
else
{
return keyToValue.get(value);
}
|