FileDocCategorySizeDatePackage
Answer.javaAPI DocGlassfish v2 API4000Tue May 22 16:54:34 BST 2007oracle.toplink.essentials.internal.helper

Answer

public class Answer extends Object
Purpose:Stores the answer to a simple yes/no question.

Superior to Boolean in that you can pass it to a method as a parameter, that method sets the value to either true or false, and then see the answer after.

I.e. if a method finds the answer to a question while doing some calculations, it can mark the answer so another method doesn't need to do those calculations again just to see what the answer is.

I.e. in a method that gets something, might want some clue after as to from where that something was gotten from.

author
Stephen McRitchie
since
release specific (what release of product did this appear in)

Fields Summary
int
answer
Constructors Summary
public Answer()

        answer = FalseUndefinedTrue.Undefined;
    
Methods Summary
public intgetAnswer()

        return answer;
    
public booleanisFalse()

        return (answer == FalseUndefinedTrue.False);
    
public booleanisTrue()

        return (answer == FalseUndefinedTrue.True);
    
public booleanisUndefined()

        return (answer == FalseUndefinedTrue.Undefined);
    
public voidsetFalse()

        answer = FalseUndefinedTrue.False;
    
public voidsetTrue()

        answer = FalseUndefinedTrue.True;
    
public voidsetUndefined()

        answer = FalseUndefinedTrue.Undefined;