TreeMap Java Library

treemap
Interface TMComputeSize

All Known Implementing Classes:
TMComputeSizeAdapter, TMFileModelSize, TMFileSize, TMFileSizeDate

public interface TMComputeSize

The TMComputeSize interface should be implemented by every class that implements algorithms for computing size of TMNode.

As computing the size of a TMNode is dependant of the kind of TMNode, a TMComputeSize should test the kind of TMNode given, and throw an TMExceptionBadTMNodeKind if there is incompatibility. The isCompatibleWith method should test the kind of TMNode passed in parameter and return true if this TMComputeSize is compatible with it.

Version:
2.5
Author:
Christophe Bouthier [bouthier@loria.fr]

Method Summary
 float getSize(TMNode node)
          Returns the size of the TMNode.
 boolean isCompatibleWith(TMNode node)
          Test if this TMComputeSize could be used with the kind of TMNode passed in parameter.
 

Method Detail

isCompatibleWith

boolean isCompatibleWith(TMNode node)
Test if this TMComputeSize could be used with the kind of TMNode passed in parameter.

Parameters:
node - the TMNode to test the compatibility with
Returns:
true if this kind of node is compatible; false otherwise

getSize

float getSize(TMNode node)
              throws TMExceptionBadTMNodeKind
Returns the size of the TMNode.

Parameters:
node - we will compute the size of this TMNode
Returns:
the computed size of the TMNode
Throws:
TMExceptionBadTMNodeKind - If this kind of TMNode is incompatible with this TMComputeSize.

TreeMap Java Library

TreeMap Java Library - www.bouthier.net - treemap.sf.net - 2001