|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.miso.util.ObjectSet
public class ObjectSet
Used to store an (arbitrarily) ordered, low-impact iteratable (doesn't
require object creation), set of ObjectInfo instances.
| Field Summary | |
|---|---|
protected Object[] |
_objs
Our sorted array of objects. |
protected int |
_size
The number of objects in the set. |
protected static int |
DEFAULT_SIZE
We start big because we know these will in general contain at least in the tens of objects. |
protected static Comparator<Object> |
INFO_COMP
We simply sort the objects in order of their hash code. |
| Constructor Summary | |
|---|---|
ObjectSet()
|
|
| Method Summary | |
|---|---|
void |
clear()
Clears out the contents of this set. |
boolean |
contains(ObjectInfo info)
Returns true if the specified object is in the set, false if it is not. |
ObjectInfo |
get(int index)
Returns the object with the specified index. |
protected int |
indexOf(ObjectInfo info)
Returns the index of the object or its insertion index if it is not in the set. |
boolean |
insert(ObjectInfo info)
Inserts the supplied object into the set. |
void |
remove(int index)
Removes the object at the specified index. |
boolean |
remove(ObjectInfo info)
Removes the specified object from the set. |
int |
size()
Returns the number of objects in this set. |
ObjectInfo[] |
toArray()
Converts the contents of this object set to an array. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Object[] _objs
protected int _size
protected static final Comparator<Object> INFO_COMP
protected static final int DEFAULT_SIZE
| Constructor Detail |
|---|
public ObjectSet()
| Method Detail |
|---|
public boolean insert(ObjectInfo info)
public boolean contains(ObjectInfo info)
public int size()
public ObjectInfo get(int index)
0 and size()-1.
public void remove(int index)
public boolean remove(ObjectInfo info)
public void clear()
public ObjectInfo[] toArray()
public String toString()
toString in class Objectprotected final int indexOf(ObjectInfo info)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||