UPDATE
I think I know what you are looking for. you only want to do stuff if
- x = false and y = true
- x = true and y = false
and not when
- x = false and y = false
- x = true and y = true
in that case I would think that what you want is an XOR
or an Exclusive Or
boolean isNewValueAssigned = newvalue != null;
boolean isCurrentValueAssigned = currentValue != null;
if (isNewValueAssigned ^ isCurrentValueAssigned) {
//Play more Galaga
//do More Work
}
I think that this makes it more clear what you are trying to do.
UPDATE
I think I know what you are looking for. you only want to do stuff if
- x = false and y = true
- x = true and y = false
and not when
- x = false and y = false
- x = true and y = true
in that case I would think that what you want is an XOR
or an Exclusive Or
boolean isNewValueAssigned = newvalue != null;
boolean isCurrentValueAssigned = currentValue != null;
if (isNewValueAssigned ^ isCurrentValueAssigned) {
//Play more Galaga
//do More Work
}
I think that this makes it more clear what you are trying to do.
I think I know what you are looking for. you only want to do stuff if
- x = false and y = true
- x = true and y = false
and not when
- x = false and y = false
- x = true and y = true
in that case I would think that what you want is an XOR
or an Exclusive Or
boolean isNewValueAssigned = newvalue != null;
boolean isCurrentValueAssigned = currentValue != null;
if (isNewValueAssigned ^ isCurrentValueAssigned) {
//Play more Galaga
//do More Work
}
I think that this makes it more clear what you are trying to do.
UPDATE
I think I know what you are looking for. you only want to do stuff if
- x = false and y = true
- x = true and y = false
and not when
- x = false and y = false
- x = true and y = true
in that case I would think that what you want is an XOR
or an Exclusive Or
boolean isNewValueAssigned = newvalue != null;
boolean isCurrentValueAssigned = currentValue != null;
if (isNewValueAssigned ^ isCurrentValueAssigned) {
//Play more Galaga
//do More Work
}
I think that this makes it more clear what you are trying to do.
Reference to this Comment and this Answer
OLD
I was thinking about a new answer and this just came to me.
I assume that you only want to update when newValue
has something in it and you only want to delete when currentValue
has something in it, so why don't you do something like this:
boolean updateRequired = (newValue != null)
boolean deleteRequired = (currentValue != null)
which would actually lead me to change it so that if you have something that needs to happen if one or the other is true then you would write it out like this
if (updateRequired || deleteRequired) {
//play Galaga
//do some stuff
}
UPDATE
I think I know what you are looking for. you only want to do stuff if
- x = false and y = true
- x = true and y = false
and not when
- x = false and y = false
- x = true and y = true
in that case I would think that what you want is an XOR
or an Exclusive Or
boolean isNewValueAssigned = newvalue != null;
boolean isCurrentValueAssigned = currentValue != null;
if (isNewValueAssigned ^ isCurrentValueAssigned) {
//Play more Galaga
//do More Work
}
I think that this makes it more clear what you are trying to do.
Reference to this Comment and this Answer
OLD
I was thinking about a new answer and this just came to me.
I assume that you only want to update when newValue
has something in it and you only want to delete when currentValue
has something in it, so why don't you do something like this:
boolean updateRequired = (newValue != null)
boolean deleteRequired = (currentValue != null)
which would actually lead me to change it so that if you have something that needs to happen if one or the other is true then you would write it out like this
if (updateRequired || deleteRequired) {
//play Galaga
//do some stuff
}
UPDATE
I think I know what you are looking for. you only want to do stuff if
- x = false and y = true
- x = true and y = false
and not when
- x = false and y = false
- x = true and y = true
in that case I would think that what you want is an XOR
or an Exclusive Or
boolean isNewValueAssigned = newvalue != null;
boolean isCurrentValueAssigned = currentValue != null;
if (isNewValueAssigned ^ isCurrentValueAssigned) {
//Play more Galaga
//do More Work
}
I think that this makes it more clear what you are trying to do.
UPDATE
I think I know what you are looking for. you only want to do stuff if
- x = false and y = true
- x = true and y = false
and not when
- x = false and y = false
- x = true and y = true
in that case I would think that what you want is an XOR
or an Exclusive Or
boolean isNewValueAssigned = newvalue != null;
boolean isCurrentValueAssigned = currentValue != null;
if (isNewValueAssigned ^ isCurrentValueAssigned) {
//Play more Galaga
//do More Work
}
I think that this makes it more clear what you are trying to do.
Reference to this Comment Comment and this Answer Answer
OLD
I was thinking about a new answer and this just came to me.
I assume that you only want to update when newValue
has something in it and you only want to delete when currentValue
has something in it, so why don't you do something like this:
boolean updateRequired = (newValue != null)
boolean deleteRequired = (currentValue != null)
which would actually lead me to change it so that if you have something that needs to happen if one or the other is true then you would write it out like this
if (updateRequired || deleteRequired) {
//play Galaga
//do some stuff
}
UPDATE
I think I know what you are looking for. you only want to do stuff if
- x = false and y = true
- x = true and y = false
and not when
- x = false and y = false
- x = true and y = true
in that case I would think that what you want is an XOR
or an Exclusive Or
boolean isNewValueAssigned = newvalue != null;
boolean isCurrentValueAssigned = currentValue != null;
if (isNewValueAssigned ^ isCurrentValueAssigned) {
//Play more Galaga
//do More Work
}
I think that this makes it more clear what you are trying to do.
Reference to this Comment and this Answer
OLD
I was thinking about a new answer and this just came to me.
I assume that you only want to update when newValue
has something in it and you only want to delete when currentValue
has something in it, so why don't you do something like this:
boolean updateRequired = (newValue != null)
boolean deleteRequired = (currentValue != null)
which would actually lead me to change it so that if you have something that needs to happen if one or the other is true then you would write it out like this
if (updateRequired || deleteRequired) {
//play Galaga
//do some stuff
}
UPDATE
I think I know what you are looking for. you only want to do stuff if
- x = false and y = true
- x = true and y = false
and not when
- x = false and y = false
- x = true and y = true
in that case I would think that what you want is an XOR
or an Exclusive Or
boolean isNewValueAssigned = newvalue != null;
boolean isCurrentValueAssigned = currentValue != null;
if (isNewValueAssigned ^ isCurrentValueAssigned) {
//Play more Galaga
//do More Work
}
I think that this makes it more clear what you are trying to do.
Reference to this Comment and this Answer
OLD
I was thinking about a new answer and this just came to me.
I assume that you only want to update when newValue
has something in it and you only want to delete when currentValue
has something in it, so why don't you do something like this:
boolean updateRequired = (newValue != null)
boolean deleteRequired = (currentValue != null)
which would actually lead me to change it so that if you have something that needs to happen if one or the other is true then you would write it out like this
if (updateRequired || deleteRequired) {
//play Galaga
//do some stuff
}