- // there are four cases to consider here
- // 1. we found a summary tuple and no oldest tuple
- // Here we just pass the summary unchanged
- // 2. we found an oldest tuple, no summary
- // Make a new, arity-one summary tuple
- // 3. we found both a summary and an oldest
- // Merge them by increasing arity of summary
- // 4. (not handled) we found neither, do nothing
- if ( ttSummary != null && !foundOldest ) {
- ttsOut.tokenTuples.add( ttSummary );
-
- } else if( ttSummary == null && foundOldest ) {
- ttsOut.tokenTuples.add( new TokenTuple( as.getSummary(),
- true,
- TokenTuple.ARITY_ONE ).makeCanonical() );
-
- } else if( ttSummary != null && foundOldest ) {
- ttsOut.tokenTuples.add( ttSummary.increaseArity() );
+ } else {
+ // otherwise, we change this token to the
+ // next older token
+ Integer tokenToChangeTo = as.getIthOldest(age + 1);
+ TokenTuple ttAged = tt.changeTokenTo(tokenToChangeTo);
+ ttsOut.tokenTuples.add(ttAged);