all integrations pass

This commit is contained in:
Henry Schimke
2022-12-29 17:58:42 -06:00
parent 1c94af40ee
commit ed0dcefa79
3 changed files with 8 additions and 0 deletions

View File

@@ -203,6 +203,12 @@ impl BitMatrix {
return ((self.bits[offset] >> (x & 0x1f)) & 1) != 0;
}
pub fn try_get(&self, x: u32, y: u32) -> Result<bool,Exceptions> {
let offset = y as usize * self.row_size + (x as usize / 32);
if offset > self.bits.len() { return Err(Exceptions::IndexOutOfBoundsException("".to_owned()))}
return Ok(((self.bits[offset] >> (x & 0x1f)) & 1) != 0);
}
/**
* <p>Sets the given bit to true.</p>
*