All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.antsr.apps.stats.StatsCapsule
java.lang.Object
   |
   +----edu.utah.janos.antsr.core.Capsule
           |
           +----edu.utah.janos.antsr.apps.stats.StatsCapsule

  Summary

public class  StatsCapsule
     extends edu.utah.janos.antsr.core.Capsule
{
          // Fields 9
     private static final byte[] MID;
     private static final byte[] PID;
     public Vector branches;
     private static final int cachetime;
     public byte depth;
     public short dpt;
     public long keyid;
     public long now;
     public int rootaddress;

          // Constructors 2
     public StatsCapsule();
     public StatsCapsule(int);

          // Methods 8
     private int branch(Node);
     public Xdr decode();
     public Xdr encode();
     private ByteArray encodeNodeInfo(Node);
     public boolean evaluate(Node);
     public int length();
     protected byte[] mid();
     protected byte[] pid();
}

Stats request capsule.

Author:
Janos Ministry of Development




  Fields

· MID

Summary  |  Top

   private static final byte[] MID


· PID

Summary  |  Top
   private static final byte[] PID


· rootaddress

Summary  |  Top
   public int rootaddress


· keyid

Summary  |  Top
   public long keyid


· dpt

Summary  |  Top
   public short dpt


· depth

Summary  |  Top
   public byte depth


· now

Summary  |  Top
   public long now


· cachetime

Summary  |  Top
   private static final int cachetime


· branches

Summary  |  Top
   public Vector branches


  Constructors

· StatsCapsule

Summary  |  Top

   public StatsCapsule() 


· StatsCapsule

Summary  |  Top
   public StatsCapsule(int d) 


  Methods

· mid

Summary  |  Top
   protected byte[] mid() 
Overrides:
mid in class Capsule


· pid

Summary  |  Top
   protected byte[] pid() 
Overrides:
pid in class Capsule


· length

Summary  |  Top
   public int length() 
Overrides:
length in class Capsule


· encode

Summary  |  Top
   public Xdr encode() 

Stats request capsules look like:
4 Address of the root of the tree
4 Unique key id of this request tree
2 Application port
1 Depth
4 Time capsule was sent

Overrides:
encode in class Capsule


· decode

Summary  |  Top
   public Xdr decode() 
Overrides:
decode in class Capsule


· branch

Summary  |  Top
   private int branch(Node n) 

Does the actual process of branching the request packet out to all neighboring nodes except those the have already been visited.

Uses soft-state to persistantly keep track of which nodes have already been visited and to keep from sending back to root or the source of this request capsule

Returns:
The number of requests branched out


· encodeNodeInfo

Summary  |  Top
   private ByteArray encodeNodeInfo(Node n) 

Encode information about this node to be returned to the root of the stats

To change the statistics returned by the tree, change this function



· evaluate

Summary  |  Top
   public boolean evaluate(Node n) 
Overrides:
evaluate in class Capsule


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7