  A quantum mechanics analogy is used to determine the forces acting on and the
energies of solitons governed by the nonlinear Schr\"odinger equation in finite
intervals with periodic and with homogeneous Dirichlet, Neumann and Robin
boundary conditions. It is shown that the energy densities remain nearly
constant for periodic, while they undergo large variations for homogeneous,
boundary conditions. The largest variations in the force and energy densities
occur for the Neumann boundary conditions, but, for all the boundary conditions
considered in this paper, the magnitudes of these forces and energies recover
their values prior to the interaction of the soliton with the boundary, after
the soliton rebound process is completed. It is also shown that the quantum
momentum changes sign but recovers its original value after the collision of
the soliton with the boundaries. The asymmetry of the Robin boundary conditions
shows different dynamic behaviour at the left and right boundaries of the
finite interval.
