/**
* @see com.alkacon.vie.shared.I_Entity#insertAttributeValue(java.lang.String, com.alkacon.vie.shared.I_Entity, int)
*/
public void insertAttributeValue(String attributeName, I_Entity value, int index) {
I_EntityAttribute attribute = getAttribute(attributeName);
if (index < 0) {
throw new IndexOutOfBoundsException("Index should be > 0");
}
if ((attribute == null) && (index > 0)) {
throw new IndexOutOfBoundsException("Index of " + index + " to big.");
}
if (attribute == null) {
setAttributeValue(attributeName, value);
} else {
List<I_Entity> values = attribute.getComplexValues();
if (index > values.size()) {
throw new IndexOutOfBoundsException("Index of " + index + " to big.");
}
if (index == values.size()) {
addAttributeValue(attributeName, value);