Holger's Java API

## com.antelmann.math
Class DefaultDataParser<T>

    java.lang.Object
      com.antelmann.math.DefaultDataParser<T>

All Implemented Interfaces:
  DataParser<T>

    public class DefaultDataParser<T>

extends Object
implements DataParser<T>

a default implementation of a DataParser based on PatternExtractor instances. As a parser should provide stable results, the instance cannot be altered while in use.

Since:
  13.02.2009, 21:45:58
Author:
  Holger Antelmann

Constructor Summary
`DefaultDataParser()`
`DefaultDataParser(PatternExtractor<? super T,? extends Number> numberExtractor)`
`DefaultDataParser(PatternExtractor<? super T,? extends Number> numberExtractor, DefaultDataParser<T> parser)` initializes this parser with all data from the given one but uses a different number extractor

Method Summary

`

`<P> void`

`

`addAxis(String name, PatternExtractor<? super T,P> pe)`
uses Object.class as the type

`

`<P> void`

`

`addAxis(String name, PatternExtractor<? super T,P> pe, Class<P> type)`

`Object` `extractAxisValue(T entry, int axis)`
`Number` `extractNumber(T entry)`
`int` `getAxisCount()`
`String` `getAxisName(int axis)`
`Class<?>` `getAxisType(int axis)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultDataParser

    public DefaultDataParser()

### DefaultDataParser

    public DefaultDataParser(PatternExtractor<? super T,? extends Number> numberExtractor)

### DefaultDataParser

    public DefaultDataParser(PatternExtractor<? super T,? extends Number> numberExtractor,
                             DefaultDataParser<T> parser)

  initializes this parser with all data from the given one but uses a different number extractor

Method Detail

### addAxis

    public <P> void addAxis(String name,
                            PatternExtractor<? super T,P> pe)
                 throws IllegalArgumentException,
                        IllegalStateException

  uses Object.class as the type

  Throws:
    `IllegalArgumentException`
    `IllegalStateException`

### addAxis

    public <P> void addAxis(String name,
                            PatternExtractor<? super T,P> pe,
                            Class<P> type)
                 throws IllegalStateException,
                        IllegalArgumentException

  Throws:
    `IllegalStateException`
    `IllegalArgumentException`

### extractAxisValue

    public Object extractAxisValue(T entry,
                                   int axis)

  Specified by:
    `extractAxisValue` in interface `DataParser<T>`

### extractNumber

    public Number extractNumber(T entry)

  Specified by:
    `extractNumber` in interface `DataParser<T>`

### getAxisCount

    public int getAxisCount()

  Specified by:
    `getAxisCount` in interface `DataParser<T>`

### getAxisName

    public String getAxisName(int axis)

  Specified by:
    `getAxisName` in interface `DataParser<T>`

### getAxisType

    public Class<?> getAxisType(int axis)

  Specified by:
    `getAxisType` in interface `DataParser<T>`

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads