Class LastNObjects<E>


  • public class LastNObjects<E>
    extends java.lang.Object
    Speichert die letzten n Objekte vom Typ E.
    Implementation Cirkular abgelegte Daten im Array.
    Keine Daten werden entnommen, Groesse kann nicht geaendert werden
    Author:
    ws
    • Constructor Summary

      Constructors 
      Constructor Description
      LastNObjects​(int capacity)  
      LastNObjects​(int capacity, LastNObjects<E> referenzVersion)
      Copy-XTor
      referenzVersion sollte nicht von einem anderen Thread geaendert werden!
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean addElement​(E element)
      true if size changed due to addElement, else false
      int getCapacity()
      0 <= getCapacity()
      E getElementAt​(int index)  
      java.util.List<E> getEntries()
      never null
      int getSize()
      0 <= getSize() <= getCapacity()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LastNObjects

        public LastNObjects​(int capacity)
      • LastNObjects

        public LastNObjects​(int capacity,
                            LastNObjects<E> referenzVersion)
        Copy-XTor
        referenzVersion sollte nicht von einem anderen Thread geaendert werden!
    • Method Detail

      • getCapacity

        public int getCapacity()
        0 <= getCapacity()
      • getSize

        public int getSize()
        0 <= getSize() <= getCapacity()
      • getElementAt

        public E getElementAt​(int index)
      • getEntries

        public java.util.List<E> getEntries()
        never null
      • addElement

        public boolean addElement​(E element)
        true if size changed due to addElement, else false