Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 54443 invoked from network); 17 Feb 2002 02:48:34 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 17 Feb 2002 02:48:34 -0000 Received: (qmail 6920 invoked by uid 97); 17 Feb 2002 02:48:38 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 6910 invoked by uid 97); 17 Feb 2002 02:48:38 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 26658 invoked by uid 97); 16 Feb 2002 23:20:46 -0000 Date: 16 Feb 2002 23:20:32 -0000 Message-ID: <20020216232032.89243.qmail@icarus.apache.org> From: asmuts@apache.org To: jakarta-commons-sandbox-cvs@apache.org Subject: cvs commit: jakarta-commons-sandbox/util/src/java/org/apache/commons/util/lru LRUElementImp.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N asmuts 02/02/16 15:20:32 Added: util/src/java/org/apache/commons/util/lru LRUElementImp.java Log: specialized LRUElement Revision Changes Path 1.1 jakarta-commons-sandbox/util/src/java/org/apache/commons/util/lru/LRUElementImp.java Index: LRUElementImp.java =================================================================== package org.apache.commons.util.lru; import java.io.Serializable; import org.apache.commons.util.lru.ILRUElement; /** * Generic element wrapper. Often stuffed inside another. Can extend and use * the LRUStore put method. Can get out of the LRUStore with the wrapper on as * well. Pulled from JCS project for ease of use. * *@author asmuts *@created January 15, 2002 */ public class LRUElementImp implements ILRUElement, Serializable { /** * Description of the Field */ public final Serializable key; /** * Description of the Field */ public final Serializable val; /** * Creation time */ public final long createTime; ////////////////////////////////////////////////////////////////// /** * Constructor for the LRUElement object * *@param key Description of the Parameter *@param val Description of the Parameter */ public LRUElementImp( Serializable key, Serializable val ) { this.key = key; this.val = val; // may want to disable this. createTime = System.currentTimeMillis(); } ////////////////////////////////////////// /** * Constructor for the LRUElement object * *@param key Description of the Parameter *@param val Description of the Parameter */ public LRUElementImp( Serializable key, Object val ) { this( key, ( Serializable ) val ); } ///////////////////////////////////// /** * Gets the key attribute of the LRUElement object * *@return The key value */ public Serializable getKey() { return this.key; } ////////////////////////////////////// /** * Gets the val attribute of the LRUElement object * *@return The val value */ public Serializable getVal() { return this.val; } ////////////////////////////////////// /** * Gets the createTime attribute of the LRUElement object * *@return The createTime value */ public long getCreateTime() { return this.createTime; } /////////////////////////////////////////////////////////// /** * Description of the Method * *@return Description of the Return Value */ public int hashCode() { return key.hashCode(); } /////////////////////////////////////////////////// /** * Description of the Method * *@return Description of the Return Value */ public String toString() { return "[key=" + key + ", val=" + val + " createTime " + this.createTime + "]"; } } // end class -- To unsubscribe, e-mail: For additional commands, e-mail: