1 /* 2 * Copyright (c) 2004-2007 Creative Sphere Limited. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * 10 * Creative Sphere - initial API and implementation 11 * 12 */ 13 package org.abstracthorizon.mercury.imap.util; 14 15 16 17 /** 18 * An interface representing a sequence. Sequence is any ordered sequence of 19 * integers. 20 * 21 * @author Daniel Sendula 22 */ 23 public interface Sequence extends Comparable<Sequence> { 24 25 /** 26 * Minimum element in the sequence 27 * @return minimum element in the sequence 28 */ 29 public int getMin(); 30 31 /** 32 * Maximum element in the sequence 33 * @return maximum element in the sequence 34 */ 35 public int getMax(); 36 37 /** 38 * Sets the lower limit 39 * @param lower lower limit 40 */ 41 public void setLowerLimit(int lower); 42 43 /** 44 * Sets upper limit 45 * @param upper upper limit 46 */ 47 public void setUpperLimit(int upper); 48 49 /** 50 * Resets internal iterator 51 */ 52 public void first(); 53 54 /** 55 * Returns <code>true</code> if there are more elements in internal interator 56 * @return <code>true</code> if there are more elements in internal interator 57 */ 58 public boolean more(); 59 60 /** 61 * Returns next element from the internal interator 62 * @return next element from the internal interator 63 */ 64 public int next(); 65 66 }