- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
public boolean setBit(byte _position, boolean _state) {
if ( !valid ) {
LOG.error("value is INVALID");
return false;
} else if ( _position<0 ) {
LOG.error("NEGATIVE _position");
return false;
} else if ( _position > capacity ) {
LOG.warn("_position("+_position+") > cacity("+capacity+") "+
"for value "+this);
return false;
}
value|=( (_state ? 1 : 0) << (_position+1) );
return true;
}
тем более, один символ короче пяти
озабоченный автор =\