You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FuzzyBoolean.java 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  3. * 2004 IBM Corporation.
  4. * All rights reserved.
  5. * This program and the accompanying materials are made available
  6. * under the terms of the Eclipse Public License v1.0
  7. * which accompanies this distribution and is available at
  8. * http://www.eclipse.org/legal/epl-v10.html
  9. *
  10. * ******************************************************************/
  11. package org.aspectj.weaver.tools;
  12. /**
  13. * This class implements a boolean that includes a "maybe"
  14. */
  15. public class FuzzyBoolean {
  16. // Note :- this implementation is not safe under serialization / deserialization
  17. private String name;
  18. public static final FuzzyBoolean YES = new FuzzyBoolean("YES");
  19. public static final FuzzyBoolean NO = new FuzzyBoolean("NO");
  20. public static final FuzzyBoolean MAYBE = new FuzzyBoolean("MAYBE");
  21. public static final FuzzyBoolean fromBoolean(boolean b) {
  22. return b ? YES : NO;
  23. }
  24. public String toString() { return name; }
  25. private FuzzyBoolean() {}
  26. private FuzzyBoolean(String n) { this.name = n; }
  27. }