Package com.persistit

Examples of com.persistit.Exchange


            Exchange ex = setupExchange();
            return ex.getKey();
        }

        private Value getValue() throws PersistitException, IOException {
            Exchange ex = setupExchange();
            ex.fetch();
            return ex.getValue();
        }
View Full Code Here


            ex.fetch();
            return ex.getValue();
        }

        private String getKeyString() {
            Exchange ex = setupExchange();
            ex.getKey().setIndex(0);
            return ex.getKey().toString();
        }
View Full Code Here

            ex.getKey().setIndex(0);
            return ex.getKey().toString();
        }

        private Exchange setupExchange() {
            Exchange ex = PersistitTableModel.this.getExchange();
            Key key = ex.getKey();
            System.arraycopy(_rootKey.getEncodedBytes(), 0, key.getEncodedBytes(), 0, _rootKey.getEncodedSize());
            System.arraycopy(_keyBytes, 0, key.getEncodedBytes(), _rootKey.getEncodedSize(), _keyBytes.length);
            key.setEncodedSize(_rootKey.getEncodedSize() + _keyBytes.length);
            return ex;
        }
View Full Code Here

        private boolean isExpanded() {
            return true;
        }

        private Row getNextRow(final boolean forward) throws PersistitException {
            final Exchange ex = setupExchange();
            final boolean expanded = (isExpanded());
            if (!ex.traverse(forward ? Key.GT : Key.LT, expanded)) {
                return null;
            }
            final Key key = ex.getKey();
            if (key.compareKeyFragment(_rootKey, 0, _rootKey.getEncodedSize()) != 0) {
                return null;
            }
            final int keyBytesSize = key.getEncodedSize() - _rootKey.getEncodedSize();
            final byte[] keyBytes = new byte[keyBytesSize];
View Full Code Here

            return new Row(keyBytes);
        }

        private String getValueTypeString() {
            try {
                final Exchange ex = setupExchange();
                if (ex.getKey().getEncodedSize() == 0)
                    return "";
                ex.fetch();
                final Value value = ex.getValue();
                if (!value.isDefined())
                    return "undefined";
                return value.getType().getName();
            } catch (final PersistitException de) {
                return de.toString();
View Full Code Here

            }
        }

        private String getValueString() {
            try {
                final Exchange ex = setupExchange();
                if (ex.getKey().getEncodedSize() == 0)
                    return "";
                ex.fetch();
                final Value value = ex.getValue();
                if (value.getEncodedSize() > 50000) {
                    return "Too long to display: " + value.getEncodedSize();
                } else {
                    return value.toString();
                }
View Full Code Here

                return de.toString();
            }
        }

        private Key getKey() {
            final Exchange ex = setupExchange();
            return ex.getKey();
        }
View Full Code Here

            final Exchange ex = setupExchange();
            return ex.getKey();
        }

        private Value getValue() throws PersistitException, IOException {
            final Exchange ex = setupExchange();
            ex.fetch();
            return ex.getValue();
        }
View Full Code Here

            ex.fetch();
            return ex.getValue();
        }

        private String getKeyString() {
            final Exchange ex = setupExchange();
            ex.getKey().setIndex(0);
            return ex.getKey().toString();
        }
View Full Code Here

            ex.getKey().setIndex(0);
            return ex.getKey().toString();
        }

        private Exchange setupExchange() {
            final Exchange ex = PersistitTableModel.this.getExchange();
            final Key key = ex.getKey();
            System.arraycopy(_rootKey.getEncodedBytes(), 0, key.getEncodedBytes(), 0, _rootKey.getEncodedSize());
            System.arraycopy(_keyBytes, 0, key.getEncodedBytes(), _rootKey.getEncodedSize(), _keyBytes.length);
            key.setEncodedSize(_rootKey.getEncodedSize() + _keyBytes.length);
            return ex;
        }
View Full Code Here

TOP

Related Classes of com.persistit.Exchange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.