/** * Computes the minimal and maximal values in this vector. * This is the union of the range of the two concatenated vectors. */ @Override public NumberRange<?> range() { return first.range().unionAny(second.range()); }
/** * Computes the minimal and maximal values in this vector. * This is the union of the range of the two concatenated vectors. */ @Override public NumberRange<?> range() { return first.range().unionAny(second.range()); }
range = categories[0].range; range = range.unionAny(extent);
/** * Tests union and intersection involving a cast from integer to double values. */ @Test public void testDoubleWithIntegerArguments() { NumberRange<Double> r1 = NumberRange.create(10.0, true, 20.0, true); NumberRange<Integer> r2 = NumberRange.create(15, true, 30, true); assertEquals(Double .class, r1.getElementType()); assertEquals(Integer.class, r2.getElementType()); assertEquals(NumberRange.create(10.0, true, 30.0, true), r1.unionAny(r2)); assertEquals(NumberRange.create(15, true, 20, true), r1.intersectAny(r2)); r1 = NumberRange.create(10.0, true, 20.5, true); assertEquals(NumberRange.create(15.0f, true, 20.5f, true), r1.intersectAny(r2)); }
/** * Tests union and intersection involving a cast from integer to double values. */ @Test public void testIntegerWithDoubleArguments() { NumberRange<Integer> r1 = NumberRange.create(10, true, 20, true); NumberRange<Double> r2 = NumberRange.create(15.0, true, 30.0, true); assertEquals(Integer.class, r1.getElementType()); assertEquals(Double .class, r2.getElementType()); assertEquals(NumberRange.create(10.0, true, 30.0, true), r1.unionAny(r2)); assertEquals(NumberRange.create(15, true, 20, true), r1.intersectAny(r2)); r2 = NumberRange.create(15.5, true, 30.0, true); assertEquals(NumberRange.create(15.5f, true, 20.0f, true), r1.intersectAny(r2)); }