org.jnetpcap.packet
Class AbstractBinding<H extends JHeader>

java.lang.Object
  extended by org.jnetpcap.packet.AbstractBinding<H>
Type Parameters:
H - the generic type
All Implemented Interfaces:
JBinding, JDependency

public abstract class AbstractBinding<H extends JHeader>
extends java.lang.Object
implements JBinding

The Class AbstractBinding.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jnetpcap.packet.JBinding
JBinding.DefaultJBinding
 
Field Summary
 
Fields inherited from interface org.jnetpcap.packet.JBinding
NULL_ID
 
Constructor Summary
AbstractBinding(java.lang.Class<? extends JHeader> sourceClass, java.lang.Class<H> targetClass)
          Instantiates a new abstract binding.
 
Method Summary
 int getSourceId()
          Gets the source id.
 int getTargetId()
          Gets the target id.
abstract  boolean isBound(JPacket packet, H header)
          Checks if is bound.
 boolean isBound(JPacket packet, int offset)
          Checks if is bound.
 int[] listDependencies()
          List dependencies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBinding

public AbstractBinding(java.lang.Class<? extends JHeader> sourceClass,
                       java.lang.Class<H> targetClass)
Instantiates a new abstract binding.

Parameters:
sourceClass - the source class
targetClass - the target class
Method Detail

getSourceId

public int getSourceId()
Gets the source id.

Specified by:
getSourceId in interface JBinding
Returns:
the source id
See Also:
JBinding.getSourceId()

getTargetId

public int getTargetId()
Gets the target id.

Specified by:
getTargetId in interface JBinding
Returns:
the target id
See Also:
JBinding.getTargetId()

isBound

public boolean isBound(JPacket packet,
                       int offset)
Checks if is bound.

Specified by:
isBound in interface JBinding
Parameters:
packet - the packet
offset - the offset
Returns:
true, if is bound
See Also:
JBinding.isBound(org.jnetpcap.packet.JPacket, int)

isBound

public abstract boolean isBound(JPacket packet,
                                H header)
Checks if is bound.

Parameters:
packet - the packet
header - the header
Returns:
true, if is bound

listDependencies

public int[] listDependencies()
List dependencies.

Specified by:
listDependencies in interface JBinding
Returns:
the int[]
See Also:
JBinding.listDependencies()