EqualityKey[] keys = new EqualityKey[assertMap.size()];
org.drools.core.util.Iterator it = assertMap.iterator();
int i = 0;
for ( org.drools.core.util.ObjectHashMap.ObjectEntry entry = (org.drools.core.util.ObjectHashMap.ObjectEntry) it.next(); entry != null; entry = (org.drools.core.util.ObjectHashMap.ObjectEntry) it.next() ) {
EqualityKey key = (EqualityKey) entry.getKey();
keys[i++] = key;
}
Arrays.sort( keys,
EqualityKeySorter.instance );
// write the assert map of Equality keys
for ( EqualityKey key : keys ) {
stream.writeShort( PersisterEnums.EQUALITY_KEY );
stream.writeInt( key.getStatus() );
InternalFactHandle handle = key.getFactHandle();
stream.writeInt( handle.getId() );
// context.out.println( "EqualityKey int:" + key.getStatus() + " int:" + handle.getId() );
if ( key.getOtherFactHandle() != null && !key.getOtherFactHandle().isEmpty() ) {
for ( InternalFactHandle handle2 : key.getOtherFactHandle() ) {
stream.writeShort( PersisterEnums.FACT_HANDLE );
stream.writeInt( handle2.getId() );
// context.out.println( "OtherHandle int:" + handle2.getId() );
}
}