GridSim 5.0 beta

gridsim
Class ResGridletList

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

public class ResGridletList
extends LinkedList<ResGridlet>

GridSim ResGridletList maintains a linked-list of Gridlet

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
ResGridletList()
           
 
Method Summary
 ResGridlet get(int gridletId, int userId)
          Returns a given Gridlet.
 int indexOf(int gridletId, int userId)
          Finds the index of a Gridlet inside the list.
 boolean move(ResGridlet obj, ResGridletList list)
          Move a ResGridlet object from this linked-list into a specified one
 
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

ResGridletList

public ResGridletList()
Method Detail

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 ResGridlet 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

move

public boolean move(ResGridlet obj,
                    ResGridletList list)
Move a ResGridlet object from this linked-list into a specified one

Parameters:
obj - a ResGridlet object to be moved
list - a ResGridletList object to store the new ResGridlet object
Returns:
true if the moving operation successful, otherwise return false
Pre Condition:
obj != null, list != null
Post Condition:
$result == true || $result == false

GridSim 5.0 beta

The University of Melbourne, Australia, 2009