org.fuzzydb.dto.attributes.FloatRangeAttribute Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.fuzzydb.util Show documentation
Show all versions of org.fuzzydb.util Show documentation
Contains classes not specific to fuzzydb implementation which
could be used in any implementation of fuzzy matching, or as
general utility classes such as those in the geo package.
The newest version!
/******************************************************************************
* Copyright (c) 2005-2008 Whirlwind Match Limited. All rights reserved.
*
* This is open source software; you can use, redistribute and/or modify
* it under the terms of the Open Software Licence v 3.0 as published by the
* Open Source Initiative.
*
* You should have received a copy of the Open Software Licence along with this
* application. if not, contact the Open Source Initiative (www.opensource.org)
*****************************************************************************/
package org.fuzzydb.dto.attributes;
public class FloatRangeAttribute extends Attribute {
private static final long serialVersionUID = 1L;
private float min;
private float max;
private float pref;
public FloatRangeAttribute(String name, float min, float max, float pref) {
super(name);
assert (min <= pref);
assert (pref <= max);
this.setMin(min);
this.setMax(max);
this.setPref(pref);
}
public void setMin(float min) {
this.min = min;
}
public float getMin() {
return min;
}
public void setMax(float max) {
this.max = max;
}
public float getMax() {
return max;
}
public void setPref(float pref) {
this.pref = pref;
}
public float getPref() {
return pref;
}
@Override
public float[] getValueAsObject() {
return new float[]{min,pref,max};
}
}