/* * Referenced.java - Reference counter for re-usable objects. * * Copyright (c) 1996 Chuck McManis, All Rights Reserved. * * Permission to use, copy, modify, and distribute this software * and its documentation for NON-COMMERCIAL purposes and without * fee is hereby granted provided that this copyright notice * appears in all copies. * * CHUCK MCMANIS MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. CHUCK MCMANIS * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT * OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. */ package util.comm; /** * This interface defines those objects that need to maintain a reference * count so that they can be reused cleanly. */ public interface Referenced { /** * Add one to this object's reference count. * @returns current ref count (post add) */ public abstract int addRefCount(); /** * Subtract one from this object's reference count, * @returns current ref count (post decrement) */ public abstract int decRefCount(); /** * Return the current Reference count. */ public abstract int refCount(); }