From da731d2bb81666b9c697d9099da632e7dfcdc0f7 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Tue, 9 Sep 2014 12:13:21 +0200 Subject: Replaced int sysKey Item identifier with UUID, which is now portable. ItemPath objects are now used to identify Items throughout the kernel, replacing ints and Integers. --- .../com/c2kernel/collection/AggregationInstance.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/main/java/com/c2kernel/collection/AggregationInstance.java') diff --git a/src/main/java/com/c2kernel/collection/AggregationInstance.java b/src/main/java/com/c2kernel/collection/AggregationInstance.java index 47e7c41..f46b691 100644 --- a/src/main/java/com/c2kernel/collection/AggregationInstance.java +++ b/src/main/java/com/c2kernel/collection/AggregationInstance.java @@ -6,6 +6,7 @@ package com.c2kernel.collection; */ import com.c2kernel.graph.model.GraphPoint; +import com.c2kernel.lookup.ItemPath; import com.c2kernel.utils.CastorHashMap; public class AggregationInstance extends Aggregation @@ -23,23 +24,23 @@ public class AggregationInstance extends Aggregation @Override - public AggregationMember addMember(int entityKey, CastorHashMap props, String classProps) + public AggregationMember addMember(ItemPath itemPath, CastorHashMap props, String classProps) throws MembershipException { - if( entityKey!=-1 && exists(entityKey)) - throw new MembershipException(entityKey+" already exists in this collection."); + if( itemPath != null && exists(itemPath)) + throw new MembershipException(itemPath+" already exists in this collection."); else - return super.addMember(entityKey, props, classProps); + return super.addMember(itemPath, props, classProps); } @Override - public AggregationMember addMember(int entityKey, CastorHashMap props, String classProps, GraphPoint location, int w, int h) + public AggregationMember addMember(ItemPath itemPath, CastorHashMap props, String classProps, GraphPoint location, int w, int h) throws MembershipException { - if( entityKey!=-1 && exists(entityKey)) - throw new MembershipException(entityKey+" already exists in this collection."); + if( itemPath != null && exists(itemPath)) + throw new MembershipException(itemPath+" already exists in this collection."); else - return super.addMember(entityKey, props, classProps, location, w, h); + return super.addMember(itemPath, props, classProps, location, w, h); } } -- cgit v1.2.3