public void meetWith ( LockSet other ) { for ( int i = 0 ; i + 1 < array . length ; i += 2 ) { int valueNumber = array [ i ] ; if ( valueNumber < 0 ) { break ; } int mine = array [ i + 1 ] ; int his = other . getLockCount ( valueNumber ) ; array [ i + 1 ] = mergeValues ( mine , his ) ; } for ( int i = 0 ; i + 1 < other . array . length ; i += 2 ) { int valueNumber = other . array [ i ] ; if ( valueNumber < 0 ) { break ; } int mine = getLockCount ( valueNumber ) ; int his = other . array [ i + 1 ] ; setLockCount ( valueNumber , mergeValues ( mine , his ) ) ; } setDefaultLockCount ( 0 ) ; }
Meet this LockSet with another LockSet storing the result in this object .