GridSim 5.0 beta

gridsim
Class GridletList

Object
  extended by AbstractCollection<E>
      extended by AbstractList<E>
          extended by AbstractSequentialList<E>
              extended by LinkedList<Gridlet>
                  extended by GridletList
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Gridlet>, Collection<Gridlet>, Deque<Gridlet>, List<Gridlet>, Queue<Gridlet>

public class GridletList
extends LinkedList<Gridlet>

Gridsim GridletList class is used to maintain a list of Gridlets (in linked-list) and support methods for organizing them

Since:
GridSim Toolkit 1.0
Author:
Manzur Murshed and Rajkumar Buyya
See Also:
Serialized Form
Invariant:
$none

Field Summary
 
Fields inherited from class AbstractList
modCount
 
Constructor Summary
GridletList()
           
 
Method Summary
 Gridlet get(int gridletId, int userId)
          Returns a given Gridlet.
 int indexOf(int gridletId, int userId)
          Finds the index of a Gridlet inside the list.
 void sort()
          Sorts the Gridlets in a list based on their lengths
 
Methods inherited from class LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray
 
Methods inherited from class AbstractSequentialList
iterator
 
Methods inherited from class AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 
Methods inherited from interface Deque
iterator
 

Constructor Detail

GridletList

public GridletList()
Method Detail

sort

public void sort()
Sorts the Gridlets in a list based on their lengths

Pre Condition:
$none
Post Condition:
$none

indexOf

public int indexOf(int gridletId,
                   int userId)
Finds the index of a Gridlet inside the list. This method needs a combination of Gridlet Id and User Id because each Grid User might have exactly the same Gridlet Id.

Parameters:
gridletId - a Gridlet Id
userId - an User Id
Returns:
the index in this list of the first occurrence of the specified Gridlet, or -1 if the list does not contain this Gridlet.
Pre Condition:
gridletId >= 0, userId >= 0
Post Condition:
$none

get

public Gridlet get(int gridletId,
                   int userId)
Returns a given Gridlet. This method needs a combination of Gridlet Id and User Id because each Grid Users might have exactly same Gridlet Ids.

Parameters:
gridletId - a Gridlet Id
userId - an User Id
Returns:
the Gridlet.
Throws:
IndexOutOfBoundsException - - if a Gridlet with specified Id and user id is not in the list.
Pre Condition:
gridletId >= 0, userId >= 0
Post Condition:
$none

GridSim 5.0 beta

The University of Melbourne, Australia, 2009