|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrita.support.HistoryQueue
public class HistoryQueue
This is an implementation of a growable(by default) or fixed-size array of Objects that implements the java.util.Set & Collection interfaces. In fixed-size mode, a simple first-in, first-out(FIFO) strategy is used to maintain maximum size. The backing structure is an Object[] for fast, unsychronized access. Care should be taken when using this class in a multi-threaded application.
| Constructor Summary | |
|---|---|
HistoryQueue()
|
|
HistoryQueue(java.util.Collection stringList,
boolean growable)
|
|
HistoryQueue(int capacity)
|
|
HistoryQueue(int capacity,
boolean growable)
|
|
HistoryQueue(java.lang.Object[] stringArr,
boolean growable)
|
|
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
boolean |
addAll(java.lang.Object[] s)
|
boolean |
allowDuplicates()
|
java.lang.Object[] |
asArray()
|
void |
clear()
|
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection c)
|
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
get(int index)
|
int |
getCapacity()
|
java.lang.Object |
getNewest()
Returns the oldest item in the queue. |
java.lang.Object |
getOldest()
Returns the oldest item in the queue. |
int |
getTotalAdds()
|
int |
hashCode()
|
int |
indexOf(java.lang.Object s)
|
boolean |
isEmpty()
|
boolean |
isFull()
|
boolean |
isGrowable()
|
java.util.Iterator |
iterator()
Returns an iterator over the Strings in proper sequence. |
long |
lastModifiedAt()
|
static void |
main(java.lang.String[] args)
|
java.lang.Object |
randomElement()
|
java.lang.Object |
remove(int index)
Removes the element at the specified index in this list and shifts any subsequent elements to the left |
boolean |
remove(java.lang.Object s)
|
boolean |
removeAll(java.util.Collection c)
|
java.lang.Object |
removeNewest()
Removes the oldest item in the queue and shifts any subsequent elements appropriately. |
java.lang.Object |
removeOldest()
Removes the oldest item in the queue and shifts any subsequent elements appropriately. |
boolean |
retainAll(java.util.Collection c)
|
void |
setAllowDuplicates(boolean allowDuplicates)
|
void |
setGrowable(boolean growable)
|
void |
shuffle()
|
int |
size()
|
void |
sort()
|
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] arg0)
|
java.lang.String |
toString()
|
void |
trimToSize()
Trims the capacity of this StringSet instance to be the current size. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HistoryQueue()
public HistoryQueue(int capacity)
public HistoryQueue(java.util.Collection stringList,
boolean growable)
public HistoryQueue(java.lang.Object[] stringArr,
boolean growable)
public HistoryQueue(int capacity,
boolean growable)
| Method Detail |
|---|
public java.lang.Object randomElement()
public void sort()
public void shuffle()
public java.lang.Object[] asArray()
public boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Seto - public boolean addAll(java.lang.Object[] s)
s - public void trimToSize()
public boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.Setc - public void clear()
clear in interface java.util.Collectionclear in interface java.util.Setpublic boolean equals(java.lang.Object o)
equals in interface java.util.Collectionequals in interface java.util.Setequals in class java.lang.ObjectObject.equals(java.lang.Object)public java.lang.Object get(int index)
index - public int hashCode()
hashCode in interface java.util.CollectionhashCode in interface java.util.SethashCode in class java.lang.ObjectObject.hashCode()public int indexOf(java.lang.Object s)
s - public boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.Setpublic boolean remove(java.lang.Object s)
remove in interface java.util.Collectionremove in interface java.util.Sets - public java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Setpublic java.lang.Object removeNewest()
public java.lang.Object getNewest()
public java.lang.Object removeOldest()
public java.lang.Object getOldest()
public java.lang.Object remove(int index)
public boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionremoveAll in interface java.util.Setc - public boolean retainAll(java.util.Collection c)
retainAll in interface java.util.CollectionretainAll in interface java.util.Setc - public int size()
size in interface java.util.Collectionsize in interface java.util.Setpublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.Setc - public java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.Setpublic boolean isFull()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public int getCapacity()
public boolean isGrowable()
public void setGrowable(boolean growable)
public boolean allowDuplicates()
public void setAllowDuplicates(boolean allowDuplicates)
public int getTotalAdds()
public boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Setpublic java.lang.Object[] toArray(java.lang.Object[] arg0)
toArray in interface java.util.CollectiontoArray in interface java.util.Setpublic long lastModifiedAt()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||