public void addLocalTagEntry(PropertyDefinition propertyDefinition) throws NullPointerException { if (propertyDefinition == null) throw new NullPointerException("Cannot add a null property definition to a primer pack."); AUID uid = propertyDefinition.getAUID(); if (!reverseMap.containsKey(uid)) { short localTag = propertyDefinition.getLocalIdentification(); if (localTag <= 0) localTag = getNextLocalCounter(); addLocalTagEntry(localTag, propertyDefinition.getAUID()); } }
public Short lookupLocalTag(PropertyDefinition propertyDefinition) throws NullPointerException { if (propertyDefinition == null) throw new NullPointerException( "Cannot look up a property to find its local tag using a null value."); AUID propertyID = propertyDefinition.getAUID(); // if (!(reverseMap.containsKey(propertyID))) // addLocalTagEntry(propertyDefinition); Short localTag = reverseMap.get(propertyID); if (localTag == null) { System.err.println( "Cannot map the given property " + propertyDefinition.getMemberOf().getName() + "." + propertyDefinition.getName() + " to a tag."); return null; } else return localTag; }