Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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 v 2.0
  7. * which accompanies this distribution and is available at
  8. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  9. *
  10. * ******************************************************************/
  11. package org.aspectj.weaver.tools;
  12. /**
  13. * This class implements a boolean that includes a "maybe"
  14. */
  15. public final 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. }