@Override public T getValueAt(int row) { if(circularBuffer != null) { // special circular handling return circularBuffer.getRelative(row); } return buffer.get(row); }
@Override public T getValueAt(int row) { if(circularBuffer != null) { // special circular handling return circularBuffer.getRelative(row); } return buffer.get(row); }
@Override public boolean equals(Object o) { if(this == o) return true; if(o == null) return false; if(!(o instanceof CircularBuffer)) return false; final CircularBuffer that = (CircularBuffer) o; long availableElements = getAvailableElements(); if(availableElements != that.getAvailableElements()) return false; for(int i = 0; i < availableElements; i++) { Object thisValue = getRelative(i); Object thatValue = that.getRelative(i); if(thisValue == null) { if(thatValue != null) { return false; } } else { if(!thisValue.equals(thatValue)) { return false; } } } return true; }
@Override public boolean equals(Object o) { if(this == o) return true; if(o == null) return false; if(!(o instanceof CircularBuffer)) return false; final CircularBuffer that = (CircularBuffer) o; long availableElements = getAvailableElements(); if(availableElements != that.getAvailableElements()) return false; for(int i = 0; i < availableElements; i++) { Object thisValue = getRelative(i); Object thatValue = that.getRelative(i); if(thisValue == null) { if(thatValue != null) { return false; } } else { if(!thisValue.equals(thatValue)) { return false; } } } return true; }