1 22 23 package com.sosnoski.util.hashset; 24 25 import java.lang.reflect.Array ; 26 27 import com.sosnoski.util.PrimitiveHashBase; 28 29 51 52 public abstract class PrimitiveSetBase extends PrimitiveHashBase 53 { 54 61 62 public PrimitiveSetBase(int count, double fill, Class ktype) { 63 super(count, fill, ktype); 64 } 65 66 71 72 public PrimitiveSetBase(PrimitiveSetBase base) { 73 super(base); 74 } 75 76 86 87 protected abstract void restructure(boolean[] flags, Object karray); 88 89 97 98 protected void reallocate(int size) { 99 100 boolean[] flags = m_flagTable; 102 m_flagTable = new boolean[size]; 103 Object keys = getKeyArray();; 104 Class type = keys.getClass().getComponentType(); 105 setKeyArray(Array.newInstance(type, size)); 106 107 restructure(flags, keys); 109 } 110 } 111 | Popular Tags |