@Test public void add_parent_and_childlink_simultaenously() { LinkLineTestObject linkLineTestObject = new LinkLineTestObject(); MapGroup.OnItemListChangedListener itemListChangedListener = linkLineTestObject .getItemListChangedListener(); LinkLineHandler linkLineHandler = linkLineTestObject .getLinkLineHandler(); MapItem parentItem = createParent(parentUid); MapItem childItem = createChild(childUid); boolean processResult = linkLineHandler.processLink(parentUid, parentItem, childUid, childItem); Assert.assertTrue(processResult); }
public boolean processLink(String parentUid, MapItem parentItem, String childUid, MapItem childItem) { if (parentItem == null || childItem == null) { boolean successDeferred = beginMonitoringDeferred(parentUid, parentItem, childUid, childItem); if (!successDeferred) { return false; } } else if (parentUid != null && childUid != null) { if (!_removeLink(parentUid, childUid)) { String currentParentUid = findObjectInMap(childUid); if (currentParentUid != null) { _removeLink(currentParentUid, childUid); } return _addLink(parentItem, childItem); } } else { Log.e(TAG, "---------------------------------------------------"); Log.e(TAG, "One or both of child and parent UID is null."); Log.e(TAG, "---------------------------------------------------"); } return false; }
LinkLineHandler implements MapEventDispatcher.MapEventDispatchListener { public boolean processLink(String parentUid, MapItem parentItem, String childUid, MapItem childItem) { if (parentItem == null || childItem == null) { boolean successDeferred = beginMonitoringDeferred(parentUid, parentItem, childUid, childItem); if (!successDeferred) { return false; } } else if (parentUid != null && childUid != null) { if (!_removeLink(parentUid, childUid)) { String currentParentUid = findObjectInMap(childUid); if (currentParentUid != null) { _removeLink(currentParentUid, childUid); } return _addLink(parentItem, childItem); } } else { Log.e(TAG, "---------------------------------------------------"); Log.e(TAG, "One or both of child and parent UID is null."); Log.e(TAG, "---------------------------------------------------"); } return false; } }
LinkLineHandler implements MapEventDispatcher.MapEventDispatchListener { public boolean processLink(String parentUid, MapItem parentItem, String childUid, MapItem childItem) { if (parentItem == null || childItem == null) { boolean successDeferred = beginMonitoringDeferred(parentUid, parentItem, childUid, childItem); if (!successDeferred) { return false; } } else if (parentUid != null && childUid != null) { if (!_removeLink(parentUid, childUid)) { String currentParentUid = findObjectInMap(childUid); if (currentParentUid != null) { _removeLink(currentParentUid, childUid); } return _addLink(parentItem, childItem); } } else { Log.e(TAG, "---------------------------------------------------"); Log.e(TAG, "One or both of child and parent UID is null."); Log.e(TAG, "---------------------------------------------------"); } return false; } LinkLineHandler(final MapEventDispatcher mapEventDispatcher,
            final MapGroup linkGroup); }
LinkLineHandler implements MapEventDispatcher.MapEventDispatchListener { public boolean processLink(String parentUid, MapItem parentItem, String childUid, MapItem childItem) { if (parentItem == null || childItem == null) { boolean successDeferred = beginMonitoringDeferred(parentUid, parentItem, childUid, childItem); if (!successDeferred) { return false; } } else if (parentUid != null && childUid != null) { if (!_removeLink(parentUid, childUid)) { String currentParentUid = findObjectInMap(childUid); if (currentParentUid != null) { _removeLink(currentParentUid, childUid); } return _addLink(parentItem, childItem); } } else { Log.e(TAG, "---------------------------------------------------"); Log.e(TAG, "One or both of child and parent UID is null."); Log.e(TAG, "---------------------------------------------------"); } return false; } LinkLineHandler(final MapEventDispatcher mapEventDispatcher,
            final MapGroup linkGroup); boolean processLink(String parentUid, MapItem parentItem,
            String childUid, MapItem childItem); @Override void onMapEvent(MapEvent event); int getNumDeferredLinks(); int getNumLinks(); }
LinkLineHandler implements MapEventDispatcher.MapEventDispatchListener { public boolean processLink(String parentUid, MapItem parentItem, String childUid, MapItem childItem) { if (parentItem == null || childItem == null) { boolean successDeferred = beginMonitoringDeferred(parentUid, parentItem, childUid, childItem); if (!successDeferred) { return false; } } else if (parentUid != null && childUid != null) { if (!_removeLink(parentUid, childUid)) { String currentParentUid = findObjectInMap(childUid); if (currentParentUid != null) { _removeLink(currentParentUid, childUid); } return _addLink(parentItem, childItem); } } else { Log.e(TAG, "---------------------------------------------------"); Log.e(TAG, "One or both of child and parent UID is null."); Log.e(TAG, "---------------------------------------------------"); } return false; } LinkLineHandler(final MapEventDispatcher mapEventDispatcher,
            final MapGroup linkGroup); boolean processLink(String parentUid, MapItem parentItem,
            String childUid, MapItem childItem); @Override void onMapEvent(MapEvent event); int getNumDeferredLinks(); int getNumLinks();  }