private int internalRowCount() { if(isPaused()) { return pauseRowCount.get(); } if(circularBuffer != null) { // special circular handling return circularBuffer.getAvailableElements(); } long rows = buffer.getSize(); if(rows > Integer.MAX_VALUE) { if(logger.isWarnEnabled()) logger.warn("Swing can only handle {} rows instead of {}!", Integer.MAX_VALUE, rows); rows = Integer.MAX_VALUE; } return (int) rows; }
private int internalRowCount() { if(isPaused()) { return pauseRowCount.get(); } if(circularBuffer != null) { // special circular handling return circularBuffer.getAvailableElements(); } long rows = buffer.getSize(); if(rows > Integer.MAX_VALUE) { if(logger.isWarnEnabled()) logger.warn("Swing can only handle {} rows instead of {}!", Integer.MAX_VALUE, rows); rows = Integer.MAX_VALUE; } return (int) rows; }
@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; }