integerfreelist.java

来自「JAVA3D矩陈的相关类」· Java 代码 · 共 41 行

JAVA
41
字号
/* * $RCSfile: IntegerFreeList.java,v $ * * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. * * Use is subject to license terms. * * $Revision: 1.4 $ * $Date: 2007/02/09 17:18:06 $ * $State: Exp $ */package javax.media.j3d;class IntegerFreeList extends MemoryFreeList {    int count = 0;    // default the initial count to 1    IntegerFreeList() {	super("java.lang.Integer");    }    // sets up an initial count and an initial capacity for the freelist    IntegerFreeList(int initialCount, int initCapacity) {	super("java.lang.Integer", initCapacity);	count = initialCount;    }    synchronized Object getObject() {	if (size > 0) return super.removeLastElement();	else return new Integer(++count);    }    public synchronized void clear() {	super.clear();	count = 0;    }    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?