1 changed files with 66 additions and 0 deletions
			
			
		| @ -0,0 +1,66 @@ | |||
| package testat; | |||
| 
 | |||
| /** | |||
|  *  | |||
|  * @author cm  | |||
|  * not provided | |||
|  * | |||
|  * @param <T> | |||
|  */ | |||
| public interface ISimpleStack<T> { | |||
| 
 | |||
| 	/** | |||
| 	 * Nimmt ein Objekt auf, das nicht null ist und noch nicht im Stack enthalten | |||
| 	 * ist. Rückgabe: Anzahl an Elemente im Stack nach der Aufnahme oder 0, falls t | |||
| 	 * == null ist das Objekt bereits enthalten, wird es ganz oben auf den Stapel | |||
| 	 * gelegt. Hinweis: Verwenden Sie entsprechende Operationen der Collection/des | |||
| 	 * Array und nicht pop/push | |||
| 	 *  | |||
| 	 * @param t | |||
| 	 * @return | |||
| 	 */ | |||
| 	public int push(T t); | |||
| 
 | |||
| 	/** | |||
| 	 * Entfernt das oberste Objekt und gibt es zurück. Liefert null, falls der Stack | |||
| 	 * leer ist | |||
| 	 */ | |||
| 	public T pop(); | |||
| 
 | |||
| 	/** | |||
| 	 * gibt einen Verweise auf das i-te Objekt zurück. Das Objekt bleibt im //
 | |||
| 	 * Stack. Falls i nicht existiert, führt dies zur IndexOutOfBoundsException. //
 | |||
| 	 * Das unterste Element hat Index 0, das oberste Index size()-1 | |||
| 	 *  | |||
| 	 * @param i index | |||
| 	 * @return | |||
| 	 */ | |||
| 	public T get(int i); | |||
| 
 | |||
| 	/** | |||
| 	 * Wie get(i), nur wird das Objekt aus dem Stack entfernt | |||
| 	 *  | |||
| 	 * @param i | |||
| 	 * @return | |||
| 	 */ | |||
| 	public T remove(int i); | |||
| 
 | |||
| 	/** | |||
| 	 * Anzahl an Objekte im Stack | |||
| 	 *  | |||
| 	 */ | |||
| 	public int size(); | |||
| 
 | |||
| 	/** | |||
| 	 * true, falls das Objekt im Stack enthalten ist | |||
| 	 *  | |||
| 	 */ | |||
| 	public boolean contains(Object o); | |||
| 
 | |||
| 	/** | |||
| 	 * Wendet action.execute auf alle Objekte im Stack an | |||
| 	 *  | |||
| 	 * @param action | |||
| 	 */ | |||
| 	public void forAll(IAction<T> action); | |||
| } | |||
					Loading…
					
					
				
		Reference in new issue