@Test public void successor() { assertEquals(5, members.indexOf(ring.successor(members.get(4)))); assertEquals(0, members.indexOf(ring.successor(members.get(members.size() - 1)))); for (int i = 0; i < members.size(); i++) { int successor = (i + 1) % members.size(); assertEquals(successor, members.indexOf(ring.successor(members.get(i)))); } }
public Member successor(HashKey hash) { return successor(hash, e -> true); }
Ring implements Iterable<Member> { public Member successor(HashKey hash) { return successor(hash, e -> true); } }
Ring implements Iterable<Member> { public Member successor(HashKey hash) { return successor(hash, e -> true); } Ring(int index); }
Ring implements Iterable<Member> { public Member successor(HashKey hash) { return successor(hash, e -> true); } Ring(int index); Iterable<Member> betweenPredecessors(Member start, Member stop); Iterable<Member> betweenSuccessor(Member start, Member stop); int getIndex(); Member insert(Member m); boolean isBetween(Member predecessor, Member item, Member successor); @Override Iterator<Member> iterator(); NavigableSet<HashKey> members(); Member predecessor(Member m); Member predecessor(Member m, Predicate<Member> predicate); Iterable<Member> predecessors(HashKey location, Predicate<Member> predicate); Iterable<Member> predecessors(Member start, Predicate<Member> predicate); int rank(HashKey item, HashKey dest); int rank(HashKey item, Member dest); int rank(Member item, Member dest); int size(); Stream<Member> streamPredecessors(HashKey location, Predicate<Member> predicate); Stream<Member> streamPredecessors(Member m, Predicate<Member> predicate); Stream<Member> streamSuccessors(HashKey location, Predicate<Member> predicate); Stream<Member> streamSuccessors(Member m, Predicate<Member> predicate); Member successor(HashKey hash); Member successor(HashKey hash, Predicate<Member> predicate); Member successor(Member m); Member successor(Member m, Predicate<Member> predicate); Iterable<Member> successors(HashKey location, Predicate<Member> predicate); Iterable<Member> successors(Member m, Predicate<Member> predicate); @Override String toString(); Iterable<Member> traverse(Member member); }
Ring implements Iterable<Member> { public Member successor(HashKey hash) { return successor(hash, e -> true); } Ring(int index); Iterable<Member> betweenPredecessors(Member start, Member stop); Iterable<Member> betweenSuccessor(Member start, Member stop); int getIndex(); Member insert(Member m); boolean isBetween(Member predecessor, Member item, Member successor); @Override Iterator<Member> iterator(); NavigableSet<HashKey> members(); Member predecessor(Member m); Member predecessor(Member m, Predicate<Member> predicate); Iterable<Member> predecessors(HashKey location, Predicate<Member> predicate); Iterable<Member> predecessors(Member start, Predicate<Member> predicate); int rank(HashKey item, HashKey dest); int rank(HashKey item, Member dest); int rank(Member item, Member dest); int size(); Stream<Member> streamPredecessors(HashKey location, Predicate<Member> predicate); Stream<Member> streamPredecessors(Member m, Predicate<Member> predicate); Stream<Member> streamSuccessors(HashKey location, Predicate<Member> predicate); Stream<Member> streamSuccessors(Member m, Predicate<Member> predicate); Member successor(HashKey hash); Member successor(HashKey hash, Predicate<Member> predicate); Member successor(Member m); Member successor(Member m, Predicate<Member> predicate); Iterable<Member> successors(HashKey location, Predicate<Member> predicate); Iterable<Member> successors(Member m, Predicate<Member> predicate); @Override String toString(); Iterable<Member> traverse(Member member);  }