|
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 objectpublic LinkedListStat(Collection c, String name)
c
- collection containing elements to fill in this list withname
- name for the list objectMethod Detail |
---|
public void clear()
clear
in interface Collection
clear
in interface List
clear
in class LinkedList
public void addFirst(Object obj)
addFirst
in interface Deque
addFirst
in class LinkedList
public void addLast(Object obj)
addLast
in interface Deque
addLast
in class LinkedList
public void add(int index, Object obj)
add
in interface List
add
in class LinkedList
public boolean add(Object obj)
add
in interface Collection
add
in interface Deque
add
in interface List
add
in interface Queue
add
in class LinkedList
public boolean addAll(Collection c)
addAll
in interface Collection
addAll
in interface List
addAll
in class LinkedList
public boolean addAll(int index, Collection c)
addAll
in interface List
addAll
in class LinkedList
public Object getFirst()
getFirst
in interface Deque
getFirst
in class LinkedList
public Object getLast()
getLast
in interface Deque
getLast
in class LinkedList
public Object get(int index)
get
in interface List
get
in class LinkedList
public boolean contains(Object obj)
contains
in interface Collection
contains
in interface Deque
contains
in interface List
contains
in class LinkedList
public int size()
size
in interface Collection
size
in interface Deque
size
in interface List
size
in class LinkedList
public Object removeFirst()
removeFirst
in interface Deque
removeFirst
in class LinkedList
public Object removeLast()
removeLast
in interface Deque
removeLast
in class LinkedList
public boolean remove(Object o)
remove
in interface Collection
remove
in interface Deque
remove
in interface List
remove
in class LinkedList
public Object remove(int index)
remove
in interface List
remove
in class LinkedList
public int indexOf(Object obj)
indexOf
in interface List
indexOf
in class LinkedList
public int lastIndexOf(Object obj)
lastIndexOf
in interface List
lastIndexOf
in class LinkedList
public Object clone()
clone
in class LinkedList
public Object[] toArray()
toArray
in interface Collection
toArray
in interface List
toArray
in class LinkedList
public Object[] toArray(Object[] a)
toArray
in interface Collection
toArray
in interface List
toArray
in class LinkedList
public ListIterator listIterator(int index)
listIterator
in interface List
listIterator
in class LinkedList
public 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 |