language agnostic - Standard name for method to check and set a variable -


i aware 'standard' name methods check , change value of boolean variable x getx(), isx() , setx().

is there standard name method returns value , changes after returning first time (i.e. cannot use togglex() because toggle first time)? want have method returns true first time called, like:

public boolean isfirstexecution() {     if (misfirstexecution) {         misfirstexecution = false;         return true;     } else {         return misfirstexecution;     } } 

the problem think might confusing have method called isx() changing value of variable.

i not think there's specific name function intend make. specify purpose of function when name it. not long specific enough others can recognize when see code.


Comments