com.slytechs.jnetstream.file
Class PacketCounterModel

java.lang.Object
  extended by com.slytechs.jnetstream.file.PacketCounterModel
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public final class PacketCounterModel
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

Enum structure which defines statistical model for packet counter. Since packet counting, especially in a large pcap file can be very expensive and time consuming, if the user does not require an accurate count, he can use one of the available statistical models to estimate packet count using the FilePacketCounter.getCountEsimte() method.

Since:
0.2.4
Author:
Mark Bednarczyk, Sly Technologies, Inc.
See Also:
Serialized Form

Field Summary
static PacketCounterModel full
          This model counts every packet in the capture file.
static PacketCounterModel iostream
          Using samples from within the file, jump around and gather statistics to use to more accurately estimate the actual packet count in the file.
static PacketCounterModel max
          This model simply divides the file size by packet snaplen, which is the maximum size any packet can be in the file and thus come up with minimum number of packets that can exist in this file.
static PacketCounterModel statistical
          Using samples from within the file, jump around and gather statistics to use to more accurately estimate the actual packet count in the file.
static PacketCounterModel[] values
          Array of contants for this enum
 
Method Summary
 int compareTo(java.lang.Object arg0)
           
 java.lang.String getPath()
          A path component that can be used in filenames to incorporate suite information.
 int ordinal()
          Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero).
 java.lang.String toString()
          Returns the name of this enum constant, as contained in the declaration.
static PacketCounterModel valueOf(java.lang.String name)
          Retruns the enum constant with the specified name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

full

public static final PacketCounterModel full
This model counts every packet in the capture file. The resultant count will contain accurate count of all the packets in the file.

Since:
0.2.4

max

public static final PacketCounterModel max
This model simply divides the file size by packet snaplen, which is the maximum size any packet can be in the file and thus come up with minimum number of packets that can exist in this file. No more packets can exist in this file then the number calculated by this model.

Since:
0.2.4

statistical

public static final PacketCounterModel statistical
Using samples from within the file, jump around and gather statistics to use to more accurately estimate the actual packet count in the file.

Since:
0.2.4

iostream

public static final PacketCounterModel iostream
Using samples from within the file, jump around and gather statistics to use to more accurately estimate the actual packet count in the file.

Since:
0.2.4

values

public static final PacketCounterModel[] values
Array of contants for this enum

Method Detail

getPath

public java.lang.String getPath()
A path component that can be used in filenames to incorporate suite information.

Returns:
Returns the path.

ordinal

public int ordinal()
Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero).

Returns:
the ordinal of this enumeration constant

valueOf

public static PacketCounterModel valueOf(java.lang.String name)
Retruns the enum constant with the specified name. The name must match exactly an identifier used to declar an enum contants in this type. (Extraneous white space characters are not permitted.)

Parameters:
name - the name of the constant to return
Returns:
the enum constant with the specified name

toString

public java.lang.String toString()
Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum type should override this method when a more "programmer-friendly" string form exists.

Overrides:
toString in class java.lang.Object
Returns:
the name of this enum constant

compareTo

public int compareTo(java.lang.Object arg0)
Specified by:
compareTo in interface java.lang.Comparable