ImmutablePair.java 563 B

12345678910111213141516171819202122232425262728
  1. // Copyright (c) 2008 Per M.A. Bothner.
  2. // This is free software; for terms and warranty disclaimer see ./COPYING.
  3. package gnu.lists;
  4. import java.io.*;
  5. public class ImmutablePair extends Pair
  6. {
  7. public ImmutablePair (Object carval, Object cdrval)
  8. {
  9. super(carval, cdrval);
  10. }
  11. public ImmutablePair ()
  12. {
  13. }
  14. public void setCar (Object car)
  15. {
  16. throw new UnsupportedOperationException("cannot modify read-only pair");
  17. }
  18. public void setCdr (Object cdr)
  19. {
  20. throw new UnsupportedOperationException("cannot modify read-only pair");
  21. }
  22. }