|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ElementList | Line # 28 | 0 | 0 | - |
-1.0
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| No Tests | |||
| 1 | /* This file is part of the project "Hilbert II" - http://www.qedeq.org | |
| 2 | * | |
| 3 | * Copyright 2000-2010, Michael Meyling <mime@qedeq.org>. | |
| 4 | * | |
| 5 | * "Hilbert II" is free software; you can redistribute | |
| 6 | * it and/or modify it under the terms of the GNU General Public | |
| 7 | * License as published by the Free Software Foundation; either | |
| 8 | * version 2 of the License, or (at your option) any later version. | |
| 9 | * | |
| 10 | * This program is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 13 | * GNU General Public License for more details. | |
| 14 | */ | |
| 15 | ||
| 16 | package org.qedeq.kernel.base.list; | |
| 17 | ||
| 18 | import java.util.List; | |
| 19 | ||
| 20 | /** | |
| 21 | * Every Operator must implement this interface. Each operator deals with arguments. These arguments | |
| 22 | * form an ordered list. So there is the number of arguments, which is told by {@link #size} and the | |
| 23 | * <code>i</code>-th argument, accessible by {@link #getElement(int)}. | |
| 24 | * | |
| 25 | * @version $Revision: 1.3 $ | |
| 26 | * @author Michael Meyling | |
| 27 | */ | |
| 28 | public interface ElementList extends Element { | |
| 29 | ||
| 30 | /** | |
| 31 | * Get the number of arguments. | |
| 32 | * | |
| 33 | * @return Number of arguments. | |
| 34 | */ | |
| 35 | public int size(); | |
| 36 | ||
| 37 | /** | |
| 38 | * Get the operator. | |
| 39 | * | |
| 40 | * @return Operator. | |
| 41 | */ | |
| 42 | public String getOperator(); | |
| 43 | ||
| 44 | /** | |
| 45 | * Get the requested argument. | |
| 46 | * | |
| 47 | * @param i Number of argument (starting with <code>0</code>). | |
| 48 | * @return <code>i</code>-th part formula. | |
| 49 | * @throws IllegalArgumentException <code>i</code> is not between <code>0</code> and | |
| 50 | * <code>{@link #size()} - 1</code> | |
| 51 | */ | |
| 52 | public Element getElement(int i); | |
| 53 | ||
| 54 | /** | |
| 55 | * Get all arguments as an list. | |
| 56 | * | |
| 57 | * @return All elements. | |
| 58 | */ | |
| 59 | public List getElements(); | |
| 60 | ||
| 61 | /** | |
| 62 | * Adds an element to end of list. | |
| 63 | * | |
| 64 | * @param element Element to add. | |
| 65 | * @throws IllegalArgumentException The given element was a NullPointer. | |
| 66 | */ | |
| 67 | public void add(final Element element); | |
| 68 | ||
| 69 | /** | |
| 70 | * Inserts an element to specified position. | |
| 71 | * | |
| 72 | * @param position Position of element to add. | |
| 73 | * @param element Element to add. | |
| 74 | * @throws IllegalArgumentException The given element was a NullPointer or the position was not | |
| 75 | * valid. | |
| 76 | */ | |
| 77 | public void insert(int position, final Element element); | |
| 78 | ||
| 79 | /** | |
| 80 | * Replaces an element at specified position. | |
| 81 | * | |
| 82 | * @param position Position of element to replace. | |
| 83 | * @param element Replacement element. | |
| 84 | * @throws IllegalArgumentException The given element was a NullPointer or the position was not | |
| 85 | * valid. | |
| 86 | */ | |
| 87 | public void replace(int position, final Element element); | |
| 88 | ||
| 89 | /** | |
| 90 | * Deletes an element of element list. | |
| 91 | * | |
| 92 | * @param i Position of element to remove. | |
| 93 | * @throws IllegalArgumentException The given position was not valid. | |
| 94 | */ | |
| 95 | public void remove(final int i); | |
| 96 | ||
| 97 | } | |
|
||||||||||