Package com.coyotegulch.jisp

Examples of com.coyotegulch.jisp.BTreeObjectIterator


                    new Class[]{from.getClass()},
                    new Object[]{from});

            m_readWriteLock.readLock().acquire();
            try {
                final BTreeObjectIterator iterator =
                        m_database.createIterator((BTreeIndex)indexFrom);

                if (!iterator.moveTo((KeyObject)fromFactory.newInstance())) {
                    throw new RuntimeException("record " + from + " does not exist");
                }
                do {
                    final Object item = iterator.getObject();
                    if (item != null) {
                        col.add(item);
                    }
                    else {
                        break;
                    }
                    final Object keyFieldValue =
                            keyMethodTo.invoke(item, new Object[]{});
                    if (((Comparable)keyFieldValue).compareTo(to) == 0) {
                        break;
                    }
                }
                while (iterator.moveNext());
            }
            finally {
                m_readWriteLock.readLock().release();
            }
        }
View Full Code Here


                    new Class[]{from.getClass()},
                    new Object[]{from});

            m_readWriteLock.readLock().acquire();
            try {
                final BTreeObjectIterator iterator =
                        m_database.createIterator((BTreeIndex)indexFrom);

                if (!iterator.moveTo((KeyObject)fromFactory.newInstance())) {
                    throw new RuntimeException("record " + from + " does not exist");
                }
                do {
                    final Object item = iterator.getObject();
                    if (item != null) {
                        col.add(item);
                    }
                    else {
                        break;
                    }
                    final Object keyFieldValue =
                            keyMethodTo.invoke(item, new Object[]{});
                    if (((Comparable)keyFieldValue).compareTo(to) == 0) {
                        break;
                    }
                }
                while (iterator.moveNext());
            }
            finally {
                m_readWriteLock.readLock().release();
            }
        }
View Full Code Here

                    new Class[]{from.getClass()},
                    new Object[]{from});

            m_readWriteLock.readLock().acquire();
            try {
                final BTreeObjectIterator iterator =
                        m_database.createIterator((BTreeIndex)indexFrom);

                if (!iterator.moveTo((KeyObject)fromFactory.newInstance())) {
                    throw new RuntimeException("record " + from + " does not exist");
                }
                do {
                    final Object item = iterator.getObject();
                    if (item != null) {
                        col.add(item);
                    }
                    else {
                        break;
                    }
                    final Object keyFieldValue =
                            keyMethodTo.invoke(item, new Object[]{});
                    if (((Comparable)keyFieldValue).compareTo(to) == 0) {
                        break;
                    }
                }
                while (iterator.moveNext());
            }
            finally {
                m_readWriteLock.readLock().release();
            }
        }
View Full Code Here

TOP

Related Classes of com.coyotegulch.jisp.BTreeObjectIterator

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.