com.tonbeller.jpivot.table.span
Class SpanConfigSupport

java.lang.Object
  extended by com.tonbeller.jpivot.table.span.SpanConfigSupport
All Implemented Interfaces:
SpanConfig, SpanDirections

public class SpanConfigSupport
extends java.lang.Object
implements SpanConfig

Created on 29.10.2002

Author:
av

Field Summary
 
Fields inherited from interface com.tonbeller.jpivot.table.span.SpanDirections
HIERARCHY_SPAN, HIERARCHY_THEN_POSITION_SPAN, NO_SPAN, POSITION_SPAN, POSITION_THEN_HIERARCHY_SPAN
 
Constructor Summary
SpanConfigSupport()
           
 
Method Summary
 int chooseSpanDirection(Span span)
          returns the direction for span.
 boolean equals(Span span1, Span span2)
          returns true, if the objects returned by getObject() are equal.
 int getDefaultDirection()
          Returns the defaultDirection.
 void setDefaultDirection(int defaultDirection)
          Sets the defaultDirection.
 void setDirection(java.lang.Class clazz, int direction)
          sets the span direction for a specific class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpanConfigSupport

public SpanConfigSupport()
Method Detail

setDirection

public void setDirection(java.lang.Class clazz,
                         int direction)
sets the span direction for a specific class. The direction will be applied to all span, whose getObject() returns an instance of clazz.

The order is significant, its the order that chooseDirection will use to test. So you *must* call setDirection with a more specific class before the less specific, e.g. after setDirection(Object.class) no other classes will be recognized, because every class is assignable to object.


chooseSpanDirection

public int chooseSpanDirection(Span span)
returns the direction for span. The class of the spans object will be tested against

Specified by:
chooseSpanDirection in interface SpanConfig

getDefaultDirection

public int getDefaultDirection()
Returns the defaultDirection.

Returns:
int

setDefaultDirection

public void setDefaultDirection(int defaultDirection)
Sets the defaultDirection.

Parameters:
defaultDirection - The defaultDirection to set

equals

public boolean equals(Span span1,
                      Span span2)
returns true, if the objects returned by getObject() are equal.

Specified by:
equals in interface SpanConfig