@Test public void builder3iterator() { final int size = 10000; final KeyFrames.Builder<Integer> b = new KeyFrames.Builder<Integer>(1); for (int i = 2; i <= size; i++) { b.addFrame(i); } final KeyFrames<Integer> kf = b.build(); Assert.assertEquals(size, kf.size()); int value = 1; double timeFraction = 0; final double fractionPerFrame = 1.0 / (kf.size() - 1); for (KeyFrames.Frame<Integer> f : kf) { if (value == 1) Assert.assertNull(f.getInterpolator()); else Assert.assertSame(LinearInterpolator.getInstance(), f.getInterpolator()); Assert.assertEquals(value++, f.getValue().intValue()); Assert.assertEquals(timeFraction, f.getTimeFraction(), 1e-9); timeFraction += fractionPerFrame; } Assert.assertEquals(size + 1, value); }
@Borrowed("this") @RegionEffects("reads this:Instance") public int size() { return f_frames.length; }
KeyFrames implements Iterable<Frame<T>> { @Borrowed("this") @RegionEffects("reads this:Instance") public int size() { return f_frames.length; } }
KeyFrames implements Iterable<Frame<T>> { @Borrowed("this") @RegionEffects("reads this:Instance") public int size() { return f_frames.length; } @RegionEffects("none")  KeyFrames(@Unique Frame<T>[] frames, Evaluator<T> evaluator); }
KeyFrames implements Iterable<Frame<T>> { @Borrowed("this") @RegionEffects("reads this:Instance") public int size() { return f_frames.length; } @RegionEffects("none")  KeyFrames(@Unique Frame<T>[] frames, Evaluator<T> evaluator); @Borrowed("this") @RegionEffects("reads this:Instance") int size(); @NonNull Frame<T> getFrame(int index); @NonNull Class<?> getClassOfValue(); @Borrowed("this") @RegionEffects("reads this:Instance") @Unique("return") Iterator<Frame<T>> iterator(); @RegionEffects("reads any(org.jdesktop.core.animation.timing.KeyFrames.Frame):Instance, this:Instance") int getFrameIndexAt(double fraction); T getInterpolatedValueAt(double fraction); }
KeyFrames implements Iterable<Frame<T>> { @Borrowed("this") @RegionEffects("reads this:Instance") public int size() { return f_frames.length; } @RegionEffects("none")  KeyFrames(@Unique Frame<T>[] frames, Evaluator<T> evaluator); @Borrowed("this") @RegionEffects("reads this:Instance") int size(); @NonNull Frame<T> getFrame(int index); @NonNull Class<?> getClassOfValue(); @Borrowed("this") @RegionEffects("reads this:Instance") @Unique("return") Iterator<Frame<T>> iterator(); @RegionEffects("reads any(org.jdesktop.core.animation.timing.KeyFrames.Frame):Instance, this:Instance") int getFrameIndexAt(double fraction); T getInterpolatedValueAt(double fraction);  }