001 /* 002 * www.ti.bfh.ch 003 * 004 * Copyright 2007, Berne University of Applied Sciences, 005 * School of Engineering and Information Technology 006 * and individual contributors as indicated by the @authors tag. 007 * 008 * This is free software; you can redistribute it and/or modify it under the terms of the 009 * GNU Lesser General Public License as published by the Free Software Foundation; 010 * either version 3 of the License, or (at your option) any later version. 011 * 012 * This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 013 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 014 * See the GNU Lesser General Public License for more details. 015 * 016 * You should have received a copy of the GNU Lesser General Public License along with this software; 017 * if not, see <http://www.gnu.org/licenses/>. 018 * 019 */ 020 package ch.bfh.algo.core; 021 022 import ch.bfh.algo.BoundaryViolationException; 023 import ch.bfh.algo.EmptySequenceException; 024 import ch.bfh.algo.InvalidAccessorException; 025 import ch.bfh.algo.Position; 026 import ch.bfh.algo.Sequence; 027 import ch.bfh.algo.core.position.PositionListIterator; 028 029 public interface GenericSequence<E,P extends GenericPosition<E,P>> extends GenericContainer<E,P>, Sequence<E>{ 030 031 public P first() throws EmptySequenceException; 032 public P last() throws EmptySequenceException; 033 public P before(Position<?> position) throws InvalidAccessorException, BoundaryViolationException; 034 public P after(Position<?> position) throws InvalidAccessorException, BoundaryViolationException; 035 public P insertBefore(Position<?> position, E element) throws InvalidAccessorException; 036 public P insertAfter(Position<?> position, E element) throws InvalidAccessorException; 037 public P position(int rank) throws IndexOutOfBoundsException; 038 public PositionListIterator<E,P> positionListIterator(); 039 public PositionListIterator<E,P> positionListIterator(int rank) throws IndexOutOfBoundsException; 040 041 }