Class AtomicCounter

java.lang.Object
ch.hslu.exercises.sw08.ex2.AtomicCounter
All Implemented Interfaces:
Counter

public final class AtomicCounter extends Object implements Counter
  • Constructor Summary

    Constructors
    Constructor
    Description
    Erzeugt einen Zähler mit Zählerstand 0.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    see ch.hslu.ad.exercise.sw07.count.Counter#decrement()
    int
    get()
    see ch.hslu.ad.exercise.sw07.count.Counter#get()
    int
    see ch.hslu.ad.exercise.sw07.count.Counter#increment()

    Methods inherited from class java.lang.Object

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

    • AtomicCounter

      public AtomicCounter()
      Erzeugt einen Zähler mit Zählerstand 0.
  • Method Details

    • increment

      public int increment()
      see ch.hslu.ad.exercise.sw07.count.Counter#increment()
      Specified by:
      increment in interface Counter
      Returns:
      gibt den neuen Zählerstand zurück.
    • decrement

      public int decrement()
      see ch.hslu.ad.exercise.sw07.count.Counter#decrement()
      Specified by:
      decrement in interface Counter
      Returns:
      gibt den neuen Zählerstand zurück.
    • get

      public int get()
      see ch.hslu.ad.exercise.sw07.count.Counter#get()
      Specified by:
      get in interface Counter
      Returns:
      aktueller Zählerstand.