From f6c6f818930a07284ea8424fcf69b0ddb1e745e7 Mon Sep 17 00:00:00 2001 From: Luc Maisonobe <luc@orekit.org> Date: Mon, 9 Feb 2015 12:44:45 +0100 Subject: [PATCH] Renamed dumpInterpolator into storeInterpolator. The previous name was confusing as another mechanism for debugging also use the term 'dump' for something not related to interpolator reuse. --- .../org/orekit/rugged/api/RuggedBuilder.java | 24 +++++++++---------- .../orekit/rugged/api/RuggedBuilderTest.java | 6 ++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/orekit/rugged/api/RuggedBuilder.java b/src/main/java/org/orekit/rugged/api/RuggedBuilder.java index 173039fb..a80d2c95 100644 --- a/src/main/java/org/orekit/rugged/api/RuggedBuilder.java +++ b/src/main/java/org/orekit/rugged/api/RuggedBuilder.java @@ -564,17 +564,17 @@ public class RuggedBuilder { * {@link #setTrajectory(InertialFrameId, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter)}, * or {@link #setTimeSpan(AbsoluteDate, AbsoluteDate, double, double)}. * </p> - * @param dumpStream stream from where to read previous instance dumped interpolator - * (caller opened it and remains responsible for closing it) + * @param storageStream stream from where to read previous instance {@link #storeInterpolator(OutputStream) + * stored interpolator} (caller opened it and remains responsible for closing it) * @return the builder instance - * @exception RuggedException if dump file cannot be loaded - * or if frames do not match the ones referenced in the dump file + * @exception RuggedException if storage stream cannot be parsed + * or if frames do not match the ones referenced in the storage stream * @see #setTrajectory(InertialFrameId, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter) * @see #setTrajectory(Frame, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter) * @see #setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator) - * @see #dumpInterpolator(OutputStream) + * @see #storeInterpolator(OutputStream) */ - public RuggedBuilder setTrajectoryAndTimeSpan(final InputStream dumpStream) + public RuggedBuilder setTrajectoryAndTimeSpan(final InputStream storageStream) throws RuggedException { try { this.inertial = null; @@ -587,7 +587,7 @@ public class RuggedBuilder { this.pvaPropagator = null; this.iStep = Double.NaN; this.iN = -1; - this.scToBody = (SpacecraftToObservedBody) new ObjectInputStream(dumpStream).readObject(); + this.scToBody = (SpacecraftToObservedBody) new ObjectInputStream(storageStream).readObject(); this.minDate = scToBody.getMinDate(); this.maxDate = scToBody.getMaxDate(); this.tStep = scToBody.getTStep(); @@ -603,7 +603,7 @@ public class RuggedBuilder { } } - /** Dump frames transform interpolator. + /** Store frames transform interpolator. * <p> * This method allows to reuse the interpolator built in one instance, to build * another instance by calling {@link #setTrajectoryAndTimeSpan(InputStream)}. @@ -614,9 +614,9 @@ public class RuggedBuilder { * <p> * This method must be called <em>after</em> both the ellipsoid and trajectory have been set. * </p> - * @param dumpStream stream where to dump the interpolator + * @param storageStream stream where to store the interpolator * (caller opened it and remains responsible for closing it) - * @exception RuggedException if interpolator cannot be written to file + * @exception RuggedException if interpolator cannot be written to stream * @see #setEllipsoid(EllipsoidId, BodyRotatingFrameId) * @see #setEllipsoid(OneAxisEllipsoid) * @see #setTrajectory(InertialFrameId, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter) @@ -624,10 +624,10 @@ public class RuggedBuilder { * @see #setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator) * @see #setTrajectoryAndTimeSpan(InputStream) */ - public void dumpInterpolator(final OutputStream dumpStream) throws RuggedException { + public void storeInterpolator(final OutputStream storageStream) throws RuggedException { try { createInterpolatorIfNeeded(); - new ObjectOutputStream(dumpStream).writeObject(scToBody); + new ObjectOutputStream(storageStream).writeObject(scToBody); } catch (IOException ioe) { throw new RuggedException(ioe, LocalizedFormats.SIMPLE_MESSAGE, ioe.getMessage()); } diff --git a/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java b/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java index 4e6b8080..fc528531 100644 --- a/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java +++ b/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java @@ -370,7 +370,7 @@ public class RuggedBuilderTest { addLineSensor(lineSensor); ByteArrayOutputStream bos = new ByteArrayOutputStream(); - original.dumpInterpolator(bos); + original.storeInterpolator(bos); Assert.assertTrue(bos.size() > 100000); Assert.assertTrue(bos.size() < 200000); @@ -434,7 +434,7 @@ public class RuggedBuilderTest { FileOutputStream fos = new FileOutputStream(tempFolder.newFile()); fos.close(); try { - original.dumpInterpolator(fos); + original.storeInterpolator(fos); Assert.fail("an exception should have been thrown"); } catch (RuggedException re) { Assert.assertEquals(IOException.class, re.getCause().getClass()); @@ -482,7 +482,7 @@ public class RuggedBuilderTest { 2, AngularDerivativesFilter.USE_R); ByteArrayOutputStream bos = new ByteArrayOutputStream(); - original.dumpInterpolator(bos); + original.storeInterpolator(bos); Assert.assertTrue(bos.size() > 100000); Assert.assertTrue(bos.size() < 200000); -- GitLab