UniqueAggregatingHashtable.java :  » Parser » runcc » fri » util » collections » Java Open Source

Java Open Source » Parser » runcc 
runcc » fri » util » collections » UniqueAggregatingHashtable.java
package fri.util.collections;

import java.util.List;

/**
  A hashtable that holds a list of unique values instead of a single value for one key.

  @author Fritz Ritzberger
*/

public class UniqueAggregatingHashtable extends AggregatingHashtable
{
  public UniqueAggregatingHashtable()  {
    super();
  }
  
  public UniqueAggregatingHashtable(int initialCapacity)  {
    super(initialCapacity);
  }
  
  protected boolean shouldAdd(List list, Object value)  {
    return list != null ? list.indexOf(value) < 0 : true;
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.