|
SSJ V. 1.2.5. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
java.util.LinkedList
umontreal.iro.lecuyer.simevents.LinkedListStat
public class LinkedListStat
This class extends LinkedList, with statistical
probes integrated in the class to provide automatic collection of
statistics on the sojourn times of objects in the list and the
size of the list as a function of time.
The automatic statistical collection can be
enabled or disabled for each list, to reduce overhead.
The iterators returned by the listIterator() method are
fail-fast: if
the list is structurally modified at any time after the iterator is created,
in any way except through the iterator's own
remove or
add
methods, the iterator will throw a ConcurrentModificationException.
| Nested Class Summary | |
|---|---|
static interface |
LinkedListStat.ListIterator2
This interface is for internal use only. |
| Constructor Summary | |
|---|---|
LinkedListStat()
Constructs a new list, initially empty. |
|
LinkedListStat(Collection c)
Constructs a list containing the elements of the specified collection. |
|
LinkedListStat(Collection c,
String name)
Constructs a new list containing the elements of the specified collection c and with name name. |
|
LinkedListStat(String name)
Constructs a new list with name name. |
|
| Method Summary | |
|---|---|
void |
add(int index,
Object obj)
|
boolean |
add(Object obj)
|
boolean |
addAll(Collection c)
|
boolean |
addAll(int index,
Collection c)
|
void |
addFirst(Object obj)
|
void |
addLast(Object obj)
|
void |
clear()
|
Object |
clone()
|
boolean |
contains(Object obj)
|
Object |
get(int index)
|
Object |
getFirst()
|
Object |
getLast()
|
String |
getName()
Returns the name associated to this list, or null if no name was assigned. |
int |
indexOf(Object obj)
|
void |
initStat()
Reinitializes the two statistical probes created by setStatCollecting (true) and makes an update for the
probe on the list size. |
int |
lastIndexOf(Object obj)
|
ListIterator |
listIterator(int index)
|
Object |
remove(int index)
|
boolean |
remove(Object o)
|
Object |
removeFirst()
|
Object |
removeLast()
|
String |
report()
Returns a string containing a statistical report on the list, provided that setStatCollecting (true) has been
called before for this list. |
void |
setStatCollecting(boolean b)
Starts or stops collecting statistics on this list. |
int |
size()
|
Accumulate |
statSize()
Returns the statistical probe on the evolution of the size of the list as a function of the simulation time. |
Tally |
statSojourn()
Returns the statistical probe on the sojourn times of the objects in the list. |
Object[] |
toArray()
|
Object[] |
toArray(Object[] a)
|
| Methods inherited from class java.util.LinkedList |
|---|
descendingIterator, element, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, removeFirstOccurrence, removeLastOccurrence, set |
| Methods inherited from class java.util.AbstractSequentialList |
|---|
iterator |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, isEmpty, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList |
| Methods inherited from interface java.util.Deque |
|---|
iterator |
| Constructor Detail |
|---|
public LinkedListStat()
public LinkedListStat(Collection c)
c - collection containing elements to fill in this list withpublic LinkedListStat(String name)
name - name for the list object
public LinkedListStat(Collection c,
String name)
c - collection containing elements to fill in this list withname - name for the list object| Method Detail |
|---|
public void clear()
clear in interface Collectionclear in interface Listclear in class LinkedListpublic void addFirst(Object obj)
addFirst in interface DequeaddFirst in class LinkedListpublic void addLast(Object obj)
addLast in interface DequeaddLast in class LinkedList
public void add(int index,
Object obj)
add in interface Listadd in class LinkedListpublic boolean add(Object obj)
add in interface Collectionadd in interface Dequeadd in interface Listadd in interface Queueadd in class LinkedListpublic boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface ListaddAll in class LinkedList
public boolean addAll(int index,
Collection c)
addAll in interface ListaddAll in class LinkedListpublic Object getFirst()
getFirst in interface DequegetFirst in class LinkedListpublic Object getLast()
getLast in interface DequegetLast in class LinkedListpublic Object get(int index)
get in interface Listget in class LinkedListpublic boolean contains(Object obj)
contains in interface Collectioncontains in interface Dequecontains in interface Listcontains in class LinkedListpublic int size()
size in interface Collectionsize in interface Dequesize in interface Listsize in class LinkedListpublic Object removeFirst()
removeFirst in interface DequeremoveFirst in class LinkedListpublic Object removeLast()
removeLast in interface DequeremoveLast in class LinkedListpublic boolean remove(Object o)
remove in interface Collectionremove in interface Dequeremove in interface Listremove in class LinkedListpublic Object remove(int index)
remove in interface Listremove in class LinkedListpublic int indexOf(Object obj)
indexOf in interface ListindexOf in class LinkedListpublic int lastIndexOf(Object obj)
lastIndexOf in interface ListlastIndexOf in class LinkedListpublic Object clone()
clone in class LinkedListpublic Object[] toArray()
toArray in interface CollectiontoArray in interface ListtoArray in class LinkedListpublic Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface ListtoArray in class LinkedListpublic ListIterator listIterator(int index)
listIterator in interface ListlistIterator in class LinkedListpublic void setStatCollecting(boolean b)
Accumulate, measures the evolution
of the size of the list as a function of time.
It can be accessed by the method statSize.
The second one, of the class Tally, and accessible via
statSojourn, samples the sojourn times in the list of the
objects removed during the observation period,
i.e., between the last initialization time of this statistical
probe and the current time.
The method automatically calls initStat to
initialize these two probes.
When this method is used, it is normally invoked immediately after
calling the constructor of the list.
IllegalStateException - if the statistical collection
is in the same state as the caller requirespublic void initStat()
setStatCollecting (true) and makes an update for the
probe on the list size.
IllegalStateException - if the statistical collection is disabledpublic Accumulate statSize()
setStatCollecting (true)
has been called for this list.
public Tally statSojourn()
setStatCollecting (true) has been called for this list.
public String report()
setStatCollecting (true) has been
called before for this list.
Even If setStatCollecting was called with false
afterward, the report will be made for
the collected observations.
If the probes do not exist, i.e., setStatCollecting was never called
for this object, an illegal state exception will be thrown.
IllegalStateException - if no statistical probes existpublic String getName()
|
SSJ V. 1.2.5. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||