|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectanonymizer.Interval
public class Interval
Data struture for generalized numeric attributes (intervals). Each interval has its high and low value. Inc/exclusiveness of the lower and upper bounds are determined by the incType property. For easy storage, and/or hashing purposes a string representation is included. The string representation consists of low and high values, separated by ":". The boundary conditions are represented mathematically, e.g., [3,4).
Field Summary | |
---|---|
double |
high
upper bound of the interval |
int |
incType
inclusion type (e.g., [low, high) vs. |
double |
low
lower bound of the interval |
private java.lang.String |
str
string representation |
static int |
TYPE_ExcLowExcHigh
lower bound exclusive, upper bound exclusive (e.g., (3,4)) |
static int |
TYPE_ExcLowIncHigh
lower bound exclusive, upper bound inclusive (e.g., (3,4]) |
static int |
TYPE_IncLowExcHigh
lower bound inclusive, upper bound exclusive (e.g., [3,4)) |
static int |
TYPE_IncLowIncHigh
lower bound inclusive, upper bound inclusive (e.g., [3,4]) |
Constructor Summary | |
---|---|
Interval(java.lang.String stringRep)
Class constructor specifying the string representation |
Method Summary | |
---|---|
boolean |
compareTo(double d)
Compares numeric values to intervals |
boolean |
compareTo(java.lang.String val)
Compares numeric values to intervals |
boolean |
contains(Interval that)
Checks whether one interval contains within itself another interval |
boolean |
equals(java.lang.Object o)
String values are parsed to double and checked for inclusion in the interval (returns true if within the interval). |
java.lang.String |
getPredicate(java.lang.String comparator)
Builds a predicate that tests for inclusion into this interval. |
private boolean |
incLowerBound()
|
private boolean |
incUpperBound()
|
boolean |
isSingleton()
Singleton intervals are categories assigned integer values (e.g., "[35]" or "[35)"). |
Interval[] |
splitInclusive(double value)
Splits this interval into two new intervals such that all values <= to the parameter value reside in the first interval and > the parameter value reside in the second interval (e.g., given (3:5] to be split at 4, the result would be (3:4] and (4:5]). |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double low
public double high
private java.lang.String str
public int incType
public static final int TYPE_IncLowIncHigh
public static final int TYPE_IncLowExcHigh
public static final int TYPE_ExcLowIncHigh
public static final int TYPE_ExcLowExcHigh
Constructor Detail |
---|
public Interval(java.lang.String stringRep) throws java.lang.Exception
stringRep
- lower and upper bounds separated by ":" OR a double value
java.lang.Exception
Method Detail |
---|
public boolean compareTo(java.lang.String val)
val
- numeric value that can be parsed into a double
public boolean compareTo(double d)
d
- numeric value
private boolean incLowerBound()
private boolean incUpperBound()
public boolean contains(Interval that)
that
- an interval object
public boolean isSingleton()
public Interval[] splitInclusive(double value) throws java.lang.Exception
value
- boundary of the split
java.lang.Exception
public java.lang.String getPredicate(java.lang.String comparator)
comparator
- Name of the object being compared with the interval
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |