Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Common Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/cpl-v10.html
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package answers;
  13. import figures.*;
  14. aspect Answer2g {
  15. int around(int val): (set(int Point._x) || set(int Point._y))
  16. && args(val) {
  17. return proceed(trim(val));
  18. }
  19. private int trim(int val) {
  20. return Math.max(Math.min(val, FigureElement.MAX_VALUE),
  21. FigureElement.MIN_VALUE);
  22. }
  23. }