org.geotoolkit.util.converter
Class SimpleConverter<S,T>

Object
  extended by SimpleConverter<S,T>
Type Parameters:
S - The base type of source objects.
T - The base type of converted objects.
All Implemented Interfaces:
ObjectConverter<S,T>

public abstract class SimpleConverter<S,T>
extends Object
implements ObjectConverter<S,T>

An abstract class for simple Object Converters. The default implementation assumes that simple converters have no restriction (i.e. they can convert every values) and preserve order (i.e. if A is smaller than B before conversion, the same holds after conversion). However subclasses can change this default by overriding the methods defined in this abstract class.

Since:
3.00
Version:
3.12
Author:
Martin Desruisseaux (Geomatys)
Module:
utility/geotk-utility (download)    View source code for this class

Constructor Summary
protected SimpleConverter()
          Default constructor.
 
Method Summary
 boolean hasRestrictions()
          Returns false by default, assuming that this converter does not have any restriction.
 boolean isOrderPreserving()
          Returns true by default, assuming this converter preserves order.
 boolean isOrderReversing()
          Returns false by default, assuming this converter preserves order.
 String toString()
          Returns a string representation of this converter for debugging purpose.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ObjectConverter
convert, getSourceClass, getTargetClass
 

Constructor Detail

SimpleConverter

protected SimpleConverter()
Default constructor.

Method Detail

hasRestrictions

public boolean hasRestrictions()
Returns false by default, assuming that this converter does not have any restriction. Subclasses may override.

Specified by:
hasRestrictions in interface ObjectConverter<S,T>
Returns:
true if this converter accepts only a subset of source values.

isOrderPreserving

public boolean isOrderPreserving()
Returns true by default, assuming this converter preserves order. Subclasses may override.

Specified by:
isOrderPreserving in interface ObjectConverter<S,T>
Returns:
true if this converter preserve order.

isOrderReversing

public boolean isOrderReversing()
Returns false by default, assuming this converter preserves order. Subclasses may override.

Specified by:
isOrderReversing in interface ObjectConverter<S,T>
Returns:
true if this converter reverse order.

toString

public String toString()
Returns a string representation of this converter for debugging purpose.

Overrides:
toString in class Object


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.