pops.ale.engine.com
Class GtinPool

java.lang.Object
  extended by pops.ale.engine.com.GtinPool

 class GtinPool
extends java.lang.Object

A pool of gtin members.

Author:
rdagher

Field Summary
protected  int current
          Current free index
protected  Gtin[] pool
          Pool of reusable Gtin elements
 
Constructor Summary
GtinPool(int maxCapacity)
           
 
Method Summary
(package private)  int contains(Gtin gtin)
          Tests if a gtin is present in pool.
(package private)  Gtin getGtin()
          get a free gtin from the pool
(package private)  void reset()
          Invalidates all pool members.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

current

protected int current
Current free index


pool

protected Gtin[] pool
Pool of reusable Gtin elements

Constructor Detail

GtinPool

public GtinPool(int maxCapacity)
Method Detail

getGtin

Gtin getGtin()
get a free gtin from the pool

Returns:

contains

int contains(Gtin gtin)
Tests if a gtin is present in pool.

Parameters:
gtin -
Returns:
the index of the gtin in the pool if present, -1 otherwise.

reset

void reset()
Invalidates all pool members.