ostore.introspect
Class SemanticDistanceModel.Segment

java.lang.Object
  |
  +--ostore.introspect.SemanticDistanceModel.Segment
All Implemented Interfaces:
QueueElementIF, QuickSerializable, SegmentedModel.Segment
Enclosing class:
SemanticDistanceModel

public static class SemanticDistanceModel.Segment
extends Object
implements SegmentedModel.Segment

A Segment object contains the internal model state associated with a single state. It can be used to swap the information to/from a SemanticDistanceModel.

Version:
$Id: SemanticDistanceModel.java,v 1.11 2003/11/17 23:52:43 emilong Exp $
Author:
Jeff Pang

Constructor Summary
SemanticDistanceModel.Segment(InputBuffer buffer)
          Constructs a Segment from its serialized form.
SemanticDistanceModel.Segment(QuickSerializable type, SemanticDistanceModel.BoundedPrioQueue queue, Distance age, int clients)
          Create a new Segment.
 
Method Summary
protected  Distance getAge()
          Get the age
protected  int getClients()
          Get the number of clients represented
protected  SemanticDistanceModel.BoundedPrioQueue getQueue()
          Get the queue of distances.
 QuickSerializable id()
          Returns the unique ID for this Segment.
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SemanticDistanceModel.Segment

public SemanticDistanceModel.Segment(QuickSerializable type,
                                     SemanticDistanceModel.BoundedPrioQueue queue,
                                     Distance age,
                                     int clients)
Create a new Segment.

Parameters:
type - TODO
queue - The distances between type and others
age - TODO
clients - TODO

SemanticDistanceModel.Segment

public SemanticDistanceModel.Segment(InputBuffer buffer)
                              throws QSException
Constructs a Segment from its serialized form.

Method Detail

id

public QuickSerializable id()
Description copied from interface: SegmentedModel.Segment
Returns the unique ID for this Segment. This ID serves as the only key identifying a Segment - Segment.equals should never be called. (Segment.id()).equals and (Segment.id()).hashCode, however, may be called quite often. Avoid using QuickSerializable IDs for which those methods are expensive.

Specified by:
id in interface SegmentedModel.Segment
Returns:
the unique ID for this Segment.

getQueue

protected SemanticDistanceModel.BoundedPrioQueue getQueue()
Get the queue of distances.


getAge

protected Distance getAge()
Get the age


getClients

protected int getClients()
Get the number of clients represented


serialize

public void serialize(OutputBuffer buffer)
Description copied from interface: QuickSerializable
Add the object to the buffer.

Specified by:
serialize in interface QuickSerializable
Parameters:
buffer - the output buffer to add the object to

toString

public String toString()
Overrides:
toString in class Object