public boolean contains(Transaction tx, Key key) { if (key == null) { throw new IllegalArgumentException("Key cannot be null"); } boolean found = false; KeyValueEntry<Key, Value> nextEntry = entries.getTail(); while (nextEntry != null) { if (nextEntry.getKey().equals(key)) { found = true; break; } nextEntry = nextEntry.getPrevious(); } return found; }
public Value get(Transaction tx, Key key) { if (key == null) { throw new IllegalArgumentException("Key cannot be null"); } Value result = null; KeyValueEntry<Key, Value> nextEntry = entries.getTail(); while (nextEntry != null) { if (nextEntry.getKey().equals(key)) { result = nextEntry.getValue(); break; } nextEntry = nextEntry.getPrevious(); } return result; }
public boolean contains(Transaction tx, Key key) { if (key == null) { throw new IllegalArgumentException("Key cannot be null"); } boolean found = false; KeyValueEntry<Key, Value> nextEntry = entries.getTail(); while (nextEntry != null) { if (nextEntry.getKey().equals(key)) { found = true; break; } nextEntry = nextEntry.getPrevious(); } return found; }
private void split(Transaction tx, boolean isAddFirst) throws IOException { ListNode<Key, Value> extension = getContainingList().createNode(tx); if (isAddFirst) { // head keeps the first entry, insert extension with the rest extension.setEntries(entries.getHead().splitAfter()); extension.setNext(this.getNext()); extension.store(tx, isAddFirst); this.setNext(extension.getPageId()); } else { extension.setEntries(entries.getTail().getPrevious().splitAfter()); extension.setNext(this.getNext()); extension.store(tx, isAddFirst); getContainingList().setTailPageId(extension.getPageId()); this.setNext(extension.getPageId()); } store(tx, true); }
private void split(Transaction tx, boolean isAddFirst) throws IOException { ListNode<Key, Value> extension = getContainingList().createNode(tx); if (isAddFirst) { // head keeps the first entry, insert extension with the rest extension.setEntries(entries.getHead().splitAfter()); extension.setNext(this.getNext()); extension.store(tx, isAddFirst); this.setNext(extension.getPageId()); } else { extension.setEntries(entries.getTail().getPrevious().splitAfter()); extension.setNext(this.getNext()); extension.store(tx, isAddFirst); getContainingList().setTailPageId(extension.getPageId()); this.setNext(extension.getPageId()); } store(tx, true); }
private void split(Transaction tx, boolean isAddFirst) throws IOException { ListNode<Key, Value> extension = getContainingList().createNode(tx); if (isAddFirst) { // head keeps the first entry, insert extension with the rest extension.setEntries(entries.getHead().splitAfter()); extension.setNext(this.getNext()); extension.store(tx, isAddFirst); this.setNext(extension.getPageId()); } else { extension.setEntries(entries.getTail().getPrevious().splitAfter()); extension.setNext(this.getNext()); extension.store(tx, isAddFirst); getContainingList().setTailPageId(extension.getPageId()); this.setNext(extension.getPageId()); } store(tx, true); }
public Value get(Transaction tx, Key key) { if (key == null) { throw new IllegalArgumentException("Key cannot be null"); } Value result = null; KeyValueEntry<Key, Value> nextEntry = entries.getTail(); while (nextEntry != null) { if (nextEntry.getKey().equals(key)) { result = nextEntry.getValue(); break; } nextEntry = nextEntry.getPrevious(); } return result; }
public Value get(Transaction tx, Key key) { if (key == null) { throw new IllegalArgumentException("Key cannot be null"); } Value result = null; KeyValueEntry<Key, Value> nextEntry = entries.getTail(); while (nextEntry != null) { if (nextEntry.getKey().equals(key)) { result = nextEntry.getValue(); break; } nextEntry = nextEntry.getPrevious(); } return result; }
public boolean contains(Transaction tx, Key key) { if (key == null) { throw new IllegalArgumentException("Key cannot be null"); } boolean found = false; KeyValueEntry<Key, Value> nextEntry = entries.getTail(); while (nextEntry != null) { if (nextEntry.getKey().equals(key)) { found = true; break; } nextEntry = nextEntry.getPrevious(); } return found; }
public boolean contains(Transaction tx, Key key) { if (key == null) { throw new IllegalArgumentException("Key cannot be null"); } boolean found = false; KeyValueEntry<Key, Value> nextEntry = entries.getTail(); while (nextEntry != null) { if (nextEntry.getKey().equals(key)) { found = true; break; } nextEntry = nextEntry.getPrevious(); } return found; }
public Value get(Transaction tx, Key key) { if (key == null) { throw new IllegalArgumentException("Key cannot be null"); } Value result = null; KeyValueEntry<Key, Value> nextEntry = entries.getTail(); while (nextEntry != null) { if (nextEntry.getKey().equals(key)) { result = nextEntry.getValue(); break; } nextEntry = nextEntry.getPrevious(); } return result; }
private void split(Transaction tx, boolean isAddFirst) throws IOException { ListNode<Key, Value> extension = getContainingList().createNode(tx); if (isAddFirst) { // head keeps the first entry, insert extension with the rest extension.setEntries(entries.getHead().splitAfter()); extension.setNext(this.getNext()); extension.store(tx, isAddFirst); this.setNext(extension.getPageId()); } else { extension.setEntries(entries.getTail().getPrevious().splitAfter()); extension.setNext(this.getNext()); extension.store(tx, isAddFirst); getContainingList().setTailPageId(extension.getPageId()); this.setNext(extension.getPageId()); } store(tx, true); }