/plugins/rearranger/src/com/wrq/rearranger/settings/atomicAttributes/VolatileAttribute.java

https://bitbucket.org/nbargnesi/idea · Java · 55 lines · 21 code · 9 blank · 25 comment · 0 complexity · 4237a8211320c220058d963ea070e1e1 MD5 · raw file

  1. /*
  2. * Copyright (c) 2003, 2010, Dave Kriewall
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
  6. * following conditions are met:
  7. *
  8. * 1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following
  9. * disclaimer.
  10. *
  11. * 2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
  12. * disclaimer in the documentation and/or other materials provided with the distribution.
  13. *
  14. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  15. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  16. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  18. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  19. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  20. * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. */
  22. package com.wrq.rearranger.settings.atomicAttributes;
  23. import org.jdom.Element;
  24. import java.lang.reflect.Modifier;
  25. /** Handles the 'volatile' modifier. */
  26. public final class VolatileAttribute
  27. extends AndNotAttribute
  28. {
  29. // -------------------------- STATIC METHODS --------------------------
  30. public static VolatileAttribute readExternal(final Element item) {
  31. final VolatileAttribute result = new VolatileAttribute();
  32. result.loadAttributes(item.getChild(result.getElementName()));
  33. return result;
  34. }
  35. // --------------------------- CONSTRUCTORS ---------------------------
  36. public VolatileAttribute() {
  37. super("volatile", Modifier.VOLATILE);
  38. }
  39. // -------------------------- OTHER METHODS --------------------------
  40. public final /*VolatileAttribute*/AtomicAttribute deepCopy() {
  41. final VolatileAttribute result = new VolatileAttribute();
  42. result.value = value;
  43. result.invert = invert;
  44. return result;
  45. }
  46. }