On Thu, 5 Jun 2014 18:19:13 +0200 (CEST) obruce@users.chorem.org wrote:
Added: branches/ng-jtimer/src/main/java/org/chorem/jtimer/entities/Pair.java
On pourrait peut-être plutôt utiliser une classe qui existe déjà ? org.apache.commons.lang3.tuple.Pair
=================================================================== --- branches/ng-jtimer/src/main/java/org/chorem/jtimer/entities/Pair.java (rev 0) +++ branches/ng-jtimer/src/main/java/org/chorem/jtimer/entities/Pair.java 2014-06-05 16:19:13 UTC (rev 2995) @@ -0,0 +1,46 @@ +package org.chorem.jtimer.entities; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Created by olivia on 05/06/14. + * <p/> + * Project name : jtimer + * <p/> + * Package name : org.chorem.jtimer.entities + * + * Cette classe represente un duo d'element type cle/valeur + * @param <K> la cle + * @param <V> la valeur + */ +public class Pair<K,V>{ + + protected static final Log log = LogFactory.getLog(Pair.class); + + private K key; //la clef de la pair + private V value; //la valeur de la pair + + public Pair(K key, V value){ + this.key = key; + this.value = value; + + log.info(this.key.toString() + this.value.toString()); + } + + public V getValue() { + return value; + } + + public void setValue(V value) { + this.value = value; + } + + public K getKey() { + return key; + } + + public void setKey(K key) { + this.key = key; + } +}
-- Tony Chemit -------------------- tél: +33 (0) 2 40 50 29 28 http://www.codelutin.com email: chemit@codelutin.com twitter: https://twitter.com/tchemit