org.decisiondeck.jmcda.persist.xmcda2
Class XMCDAOrderedIntervals

java.lang.Object
  extended by org.decisiondeck.jmcda.persist.xmcda2.utils.XMCDAHelper
      extended by org.decisiondeck.jmcda.persist.xmcda2.utils.XMCDAHelperWithVarious
          extended by org.decisiondeck.jmcda.persist.xmcda2.XMCDAOrderedIntervals

public class XMCDAOrderedIntervals
extends XMCDAHelperWithVarious

Methods for reading and writing continuous intervals informations (called scales in XMCDA terms) from and to XMCDA fragments.


Constructor Summary
XMCDAOrderedIntervals()
          Creates a new object which will use the default error management strategy XMCDAErrorsManager.ErrorManagement.THROW.
XMCDAOrderedIntervals(XMCDAErrorsManager errorsManager)
          Creates a new object delegating error management to the given error manager in case of unexpected data read.
 
Method Summary
 Criterion.PreferenceDirection read(XPreferenceDirection.Enum xDirection)
          Retrieves the direction equivalent to the given XMCDA direction.
 IOrderedInterval read(XScale xScale)
          Retrieves the given scale as a proper interval.
 XPreferenceDirection.Enum write(Criterion.PreferenceDirection preferenceDirection)
          Retrieves the given preference direction as an XMCDA preference direction.
 XScale write(IOrderedInterval interval)
           Retrieves the given interval as an XMCDA scale.
 
Methods inherited from class org.decisiondeck.jmcda.persist.xmcda2.utils.XMCDAHelper
error, getStrategy, setStrategy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMCDAOrderedIntervals

public XMCDAOrderedIntervals()
Creates a new object which will use the default error management strategy XMCDAErrorsManager.ErrorManagement.THROW.


XMCDAOrderedIntervals

public XMCDAOrderedIntervals(XMCDAErrorsManager errorsManager)
Creates a new object delegating error management to the given error manager in case of unexpected data read.

Parameters:
errorsManager - not null.
Method Detail

write

public XScale write(IOrderedInterval interval)

Retrieves the given interval as an XMCDA scale.

This method does not accept discrete intervals.

Parameters:
interval - not null, with no step size.
Returns:
null iff the given interval contains no information: no preference direction and only infinite bounds.

write

public XPreferenceDirection.Enum write(Criterion.PreferenceDirection preferenceDirection)
Retrieves the given preference direction as an XMCDA preference direction.

Parameters:
preferenceDirection - not null, not unknown.
Returns:
not null.

read

public IOrderedInterval read(XScale xScale)
                      throws InvalidInputException
Retrieves the given scale as a proper interval.

Parameters:
xScale - not null.
Returns:
a continuous scale, or null iff unexpected content has been read and this object does not follow the XMCDAErrorsManager.ErrorManagement.THROW strategy.
Throws:
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW strategy.

read

public Criterion.PreferenceDirection read(XPreferenceDirection.Enum xDirection)
Retrieves the direction equivalent to the given XMCDA direction.

Parameters:
xDirection - not null.
Returns:
not null.


Copyright © 2011. All Rights Reserved.