net.tinyos.sim.script.reflect
Class Packets

java.lang.Object
  |
  +--org.python.core.PyObject
        |
        +--org.python.core.PyDictionary
              |
              +--net.tinyos.sim.script.reflect.Packets
All Implemented Interfaces:
org.python.core.ClassDictInit, java.io.Serializable

public class Packets
extends org.python.core.PyDictionary

The Packets class is a special reflected class to provide access to the simulator's packet transmission history.

This class implements a python dictionary, and as such, should be accessed using the python builtin operators. The index into the dictionary is the transmitting mote id. The contents of each slice is a list of packet information that was sent by that mote.

The class is bound into the simcore module as the packets global instance.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.python.core.PyObject
__class__
 
Constructor Summary
Packets(net.tinyos.sim.script.ScriptInterpreter interp, net.tinyos.sim.SimDriver driver)
           
 
Method Summary
 void __delitem__(org.python.core.PyObject index)
           
 org.python.core.PyObject __finditem__(org.python.core.PyObject key)
           
 int __len__()
           
 void __setitem__(int index, org.python.core.PyObject value)
           
 void __setitem__(org.python.core.PyObject index, org.python.core.PyObject value)
           
 net.tinyos.sim.script.reflect.PacketType addPacketType(net.tinyos.message.Message message)
          Create a new dictionary for packets of a particular message type.
 org.python.core.PyDictionary copy()
           
 org.python.core.PyList items()
           
 org.python.core.PyList keys()
           
 java.lang.String toString()
           
 
Methods inherited from class org.python.core.PyDictionary
__cmp__, __findattr__, __finditem__, __iter__, __nonzero__, classDictInit, clear, get, get, has_key, hashCode, iteritems, iterkeys, itervalues, popitem, safeRepr, setdefault, setdefault, update, update, values
 
Methods inherited from class org.python.core.PyObject
__abs__, __add__, __and__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __coerce__, __coerce_ex__, __complex__, __contains__, __delattr__, __delattr__, __delitem__, __delslice__, __delslice__, __dir__, __div__, __divmod__, __eq__, __findattr__, __finditem__, __float__, __floordiv__, __ge__, __getattr__, __getattr__, __getitem__, __getitem__, __getslice__, __getslice__, __gt__, __hash__, __hex__, __iadd__, __iand__, __idiv__, __idivmod__, __ifloordiv__, __ilshift__, __imod__, __imul__, __int__, __invert__, __ior__, __ipow__, __irshift__, __isub__, __iternext__, __itruediv__, __ixor__, __le__, __long__, __lshift__, __lt__, __mod__, __mul__, __ne__, __neg__, __not__, __oct__, __or__, __pos__, __pow__, __pow__, __radd__, __rand__, __rdiv__, __rdivmod__, __repr__, __rfloordiv__, __rlshift__, __rmod__, __rmul__, __ror__, __rpow__, __rrshift__, __rshift__, __rsub__, __rtruediv__, __rxor__, __setattr__, __setattr__, __setitem__, __setslice__, __setslice__, __str__, __sub__, __tojava__, __truediv__, __xor__, _add, _and, _callextra, _cmp, _div, _divmod, _dodel, _doget, _doget, _doset, _eq, _floordiv, _ge, _gt, _in, _is, _isnot, _jcall, _jcallexc, _jthrow, _le, _lshift, _lt, _mod, _mul, _ne, _notin, _or, _pow, _rshift, _sub, _truediv, _xor, equals, invoke, invoke, invoke, invoke, invoke, isCallable, isMappingType, isNumberType, isSequenceType
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Packets

public Packets(net.tinyos.sim.script.ScriptInterpreter interp,
               net.tinyos.sim.SimDriver driver)
Method Detail

__finditem__

public org.python.core.PyObject __finditem__(org.python.core.PyObject key)
Overrides:
__finditem__ in class org.python.core.PyDictionary

__setitem__

public void __setitem__(int index,
                        org.python.core.PyObject value)
Overrides:
__setitem__ in class org.python.core.PyObject

__setitem__

public void __setitem__(org.python.core.PyObject index,
                        org.python.core.PyObject value)
Overrides:
__setitem__ in class org.python.core.PyDictionary

__delitem__

public void __delitem__(org.python.core.PyObject index)
Overrides:
__delitem__ in class org.python.core.PyDictionary

__len__

public int __len__()
Overrides:
__len__ in class org.python.core.PyDictionary

items

public org.python.core.PyList items()
Overrides:
items in class org.python.core.PyDictionary

toString

public java.lang.String toString()
Overrides:
toString in class org.python.core.PyDictionary

keys

public org.python.core.PyList keys()
Overrides:
keys in class org.python.core.PyDictionary

copy

public org.python.core.PyDictionary copy()
Overrides:
copy in class org.python.core.PyDictionary

addPacketType

public net.tinyos.sim.script.reflect.PacketType addPacketType(net.tinyos.message.Message message)
Create a new dictionary for packets of a particular message type. Note -- in previous versions this would automatically bind a variable into the interpreter for the new dictionary using an internal Jython API. Instead, this method now returns the new dictionary that the caller should store a reference to.

Returns:
the new dictionary