fi.helsinki.dacopan.model
Class Layer

java.lang.Object
  extended by fi.helsinki.dacopan.model.Layer
All Implemented Interfaces:
Identifiable, java.lang.Comparable

public class Layer
extends java.lang.Object
implements java.lang.Comparable, Identifiable

Represents a network layer.

Version:
$Id: Layer.java,v 1.10 2004/05/07 09:19:42 aarniala-dacopan Exp $

Field Summary
protected  long id
          unique layer id
protected  java.lang.String name
          (non-localized) name of the layer
protected  int order
          an arbitrary value for ordering layers
protected  java.util.List protocols
          protocols that operate on this layer
 
Constructor Summary
Layer(long id, java.lang.String name, int order)
          Creates a new layer with the given name and order.
Layer(long id, java.lang.String name, int order, java.util.List protocols)
          Creates a layer with default parameters plus a list of protocols.
 
Method Summary
 int compareTo(java.lang.Object o)
          Implements ordering of layers lower-layer-first.
 boolean equals(java.lang.Object o)
           
 long getId()
          Returns the identifier of this layer.
 java.lang.String getName()
          Returns the name of the layer.
 java.util.List getProtocols()
          Returns all the protocols on this layer.
 int hashCode()
           
 void setProtocols(java.util.List protocols)
          Set the list of protocols on this layer.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected long id
unique layer id


order

protected int order
an arbitrary value for ordering layers


name

protected java.lang.String name
(non-localized) name of the layer


protocols

protected java.util.List protocols
protocols that operate on this layer

Constructor Detail

Layer

public Layer(long id,
             java.lang.String name,
             int order)
Creates a new layer with the given name and order.

Parameters:
id - unique identifier
name - of the layer
order - of the layer in the layer stack

Layer

public Layer(long id,
             java.lang.String name,
             int order,
             java.util.List protocols)
Creates a layer with default parameters plus a list of protocols.

See Also:
Layer(long, String, int)
Method Detail

getId

public long getId()
Returns the identifier of this layer.

Specified by:
getId in interface Identifiable
Returns:
a unique long id

getName

public java.lang.String getName()
Returns the name of the layer.


getProtocols

public java.util.List getProtocols()
Returns all the protocols on this layer.


setProtocols

public void setProtocols(java.util.List protocols)
Set the list of protocols on this layer.


compareTo

public int compareTo(java.lang.Object o)
Implements ordering of layers lower-layer-first.

Specified by:
compareTo in interface java.lang.Comparable

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


© Dacopan2 team, 2005-