//  I guess I have to use the PermutedIndex
//  MR> interface. 

//  Specifically, it is the beginPermuted index-creation method on a Collection.

//  MR> Moreover, how can I tell the index to move - for instance - 5
//  MR> positions on and report the object?

setOffset will do that.  Here's an example:

import swarm.Globals;
import swarm.collections.Index;
import swarm.collections.List;
import swarm.collections.ListImpl;

class Agent {
  int id;
  Agent (int id) {
    this.id = id;
  }
}

public class TestPermutedIndex {
  public static void main (String []args) {
    Globals.env.initSwarm ("TestPermutedIndex", "0.0", "bug-swarm@swarm.org",
                           args);

    List list = new ListImpl (Globals.env.globalZone);

    for (int i = 0; i < 10; i++)
      list.addLast (new Agent (i));

    Index index = list.beginPermuted (Globals.env.globalZone);
    Agent agent;

    index.setOffset (5);
    agent = (Agent) index.get ();

    while (agent != null) {
      System.out.println ("Agent #" + agent.id);
      agent = (Agent) index.next ();
    }
    index.drop ();
  }
}

