Top Description Fields Constructors Methods
org.jboss.marshalling.util

public final Class IntSet<T>

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
java.util.Arrays

An efficient object set.

Field Summary

Modifier and TypeField and Description
private int
private Object[]
private int

Constructor Summary

AccessConstructor and Description
public
IntSet(int
the initial capacity
initialCapacity
,
final float
the load factor
loadFactor
)

Construct a new instance with the given initial capacity and load factor.

public
IntSet(final float
the load factor
loadFactor
)

Construct a new instance with the given load factor and an initial capacity of 64.

public
IntSet(final int
the initial capacity
initialCapacity
)

Construct a new instance with the given initial capacity and a load factor of 0.5.

public
IntSet()

Construct a new instance with an initial capacity of 64 and a load factor of 0.5.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the object was added, or false if it was already in the set
add
(T
the key
key
)

Add a value into the set, if it's not already in there.

public void
public IntSet<T>

Returns:

a cloned set
clone
()

Overrides java.lang.Object.clone.

Clone this set.
public boolean

Returns:

true if the object is present in the set
contains
(T
the key
key
)

Check to see if this set contains a value.

private void
public String

Returns:

a string representation
toString
()

Overrides java.lang.Object.toString.

Get a string summary representation of this map.
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

countback to summary
private int count
keysback to summary
private Object[] keys
resizeCountback to summary
private int resizeCount

Constructor Detail

IntSetback to summary
public IntSet(int initialCapacity, final float loadFactor)

Construct a new instance with the given initial capacity and load factor.

Parameters
initialCapacity:int

the initial capacity

loadFactor:float

the load factor

IntSetback to summary
public IntSet(final float loadFactor)

Construct a new instance with the given load factor and an initial capacity of 64.

Parameters
loadFactor:float

the load factor

IntSetback to summary
public IntSet(final int initialCapacity)

Construct a new instance with the given initial capacity and a load factor of 0.5.

Parameters
initialCapacity:int

the initial capacity

IntSetback to summary
public IntSet()

Construct a new instance with an initial capacity of 64 and a load factor of 0.5.

Method Detail

addback to summary
public boolean add(T key)

Add a value into the set, if it's not already in there.

Parameters
key:T

the key

Returns:boolean

true if the object was added, or false if it was already in the set

clearback to summary
public void clear()
cloneback to summary
public IntSet<T> clone()

Overrides java.lang.Object.clone.

Clone this set.

Returns:IntSet<T>

a cloned set

Annotations
@SuppressWarnings:unchecked
containsback to summary
public boolean contains(T key)

Check to see if this set contains a value.

Parameters
key:T

the key

Returns:boolean

true if the object is present in the set

resizeback to summary
private void resize()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Get a string summary representation of this map.

Returns:String

a string representation