当前位置: 首页>>代码示例>>Java>>正文


Java DataUtils.newUnsupportedOperationException方法代码示例

本文整理汇总了Java中org.h2.mvstore.DataUtils.newUnsupportedOperationException方法的典型用法代码示例。如果您正苦于以下问题:Java DataUtils.newUnsupportedOperationException方法的具体用法?Java DataUtils.newUnsupportedOperationException怎么用?Java DataUtils.newUnsupportedOperationException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.h2.mvstore.DataUtils的用法示例。


在下文中一共展示了DataUtils.newUnsupportedOperationException方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: iterator

import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
/**
 * Get an iterator over all entries.
 *
 * @return the iterator
 */
public Iterator<K> iterator() {
    return new Iterator<K>() {

        Entry<K> current = head;

        @Override
        public boolean hasNext() {
            return current != NULL;
        }

        @Override
        public K next() {
            K x = current.obj;
            current = current.next;
            return x;
        }

        @Override
        public void remove() {
            throw DataUtils.newUnsupportedOperationException("remove");
        }

    };
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:30,代码来源:ConcurrentLinkedList.java

示例2: iterator

import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
/**
 * Get an iterator over all entries.
 *
 * @return the iterator
 */
@Override
public Iterator<K> iterator() {
    return new Iterator<K>() {

        ImmutableArray<K> a = ImmutableArray.this;
        int index;

        @Override
        public boolean hasNext() {
            return index < a.length();
        }

        @Override
        public K next() {
            return a.get(index++);
        }

        @Override
        public void remove() {
            throw DataUtils.newUnsupportedOperationException("remove");
        }

    };
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:30,代码来源:ImmutableArray.java

示例3: iterator

import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
/**
 * Get an iterator over all entries.
 *
 * @return the iterator
 */
@Override
public Iterator<K> iterator() {
    return new Iterator<K>() {

        ImmutableArray3<K> a = ImmutableArray3.this;
        int index;

        @Override
        public boolean hasNext() {
            return index < a.length();
        }

        @Override
        public K next() {
            return a.get(index++);
        }

        @Override
        public void remove() {
            throw DataUtils.newUnsupportedOperationException("remove");
        }

    };
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:30,代码来源:ImmutableArray3.java

示例4: iterator

import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
/**
 * Get an iterator over all entries.
 *
 * @return the iterator
 */
@Override
public Iterator<K> iterator() {
    return new Iterator<K>() {

        ImmutableArray2<K> a = ImmutableArray2.this;
        int index;

        @Override
        public boolean hasNext() {
            return index < a.length();
        }

        @Override
        public K next() {
            return a.get(index++);
        }

        @Override
        public void remove() {
            throw DataUtils.newUnsupportedOperationException("remove");
        }

    };
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:30,代码来源:ImmutableArray2.java

示例5: iterator

import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
/**
 * Get an iterator over all entries.
 *
 * @return the iterator
 */
public Iterator<K> iterator() {
    return new Iterator<K>() {

        Entry<K> current = head;

        @Override
        public boolean hasNext() {
            return current != null;
        }

        @Override
        public K next() {
            K x = current.obj;
            current = current.next;
            return x;
        }

        @Override
        public void remove() {
            throw DataUtils.newUnsupportedOperationException("remove");
        }

    };
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:30,代码来源:ConcurrentLinkedListWithTail.java

示例6: iterator

import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
/**
 * Get an iterator over all entries.
 *
 * @return the iterator
 */
public Iterator<K> iterator() {
    return new Iterator<K>() {

        int offset;

        @Override
        public boolean hasNext() {
            return readPos + offset < writePos;
        }

        @Override
        public K next() {
            if (buffer[getIndex(readPos + offset)] == null) {
                System.out.println("" + readPos);
                System.out.println("" + getIndex(readPos + offset));
                System.out.println("null?");
            }
            return buffer[getIndex(readPos + offset++)];
        }

        @Override
        public void remove() {
            throw DataUtils.newUnsupportedOperationException("remove");
        }

    };
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:33,代码来源:ConcurrentRing.java

示例7: remove

import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
@Override
public void remove() {
    throw DataUtils.newUnsupportedOperationException(
            "Removing is not supported");
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:6,代码来源:MVRTreeMap.java

示例8: getChanges

import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
/**
 * Get the changes of the given transaction, starting from the latest log id
 * back to the given log id.
 *
 * @param t the transaction
 * @param maxLogId the maximum log id
 * @param toLogId the minimum log id
 * @return the changes
 */
Iterator<Change> getChanges(final Transaction t, final long maxLogId,
        final long toLogId) {
    return new Iterator<Change>() {

        private long logId = maxLogId - 1;
        private Change current;

        {
            fetchNext();
        }

        private void fetchNext() {
            synchronized (undoLog) {
                while (logId >= toLogId) {
                    Long undoKey = getOperationId(t.getId(), logId);
                    Object[] op = undoLog.get(undoKey);
                    logId--;
                    if (op == null) {
                        // partially rolled back: load previous
                        undoKey = undoLog.floorKey(undoKey);
                        if (undoKey == null ||
                                getTransactionId(undoKey) != t.getId()) {
                            break;
                        }
                        logId = getLogId(undoKey);
                        continue;
                    }
                    int mapId = ((Integer) op[0]).intValue();
                    MVMap<Object, VersionedValue> m = openMap(mapId);
                    if (m == null) {
                        // map was removed later on
                    } else {
                        current = new Change();
                        current.mapName = m.getName();
                        current.key = op[1];
                        VersionedValue oldValue = (VersionedValue) op[2];
                        current.value = oldValue == null ?
                                null : oldValue.value;
                        return;
                    }
                }
            }
            current = null;
        }

        @Override
        public boolean hasNext() {
            return current != null;
        }

        @Override
        public Change next() {
            if (current == null) {
                throw DataUtils.newUnsupportedOperationException("no data");
            }
            Change result = current;
            fetchNext();
            return result;
        }

        @Override
        public void remove() {
            throw DataUtils.newUnsupportedOperationException("remove");
        }

    };
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:77,代码来源:TransactionStore.java

示例9: keyIterator

import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
/**
 * Iterate over keys.
 *
 * @param from the first key to return
 * @param includeUncommitted whether uncommitted entries should be
 *            included
 * @return the iterator
 */
public Iterator<K> keyIterator(final K from, final boolean includeUncommitted) {
    return new Iterator<K>() {
        private K currentKey = from;
        private Cursor<K, VersionedValue> cursor = map.cursor(currentKey);

        {
            fetchNext();
        }

        private void fetchNext() {
            while (cursor.hasNext()) {
                K k;
                try {
                    k = cursor.next();
                } catch (IllegalStateException e) {
                    // TODO this is a bit ugly
                    if (DataUtils.getErrorCode(e.getMessage()) ==
                            DataUtils.ERROR_CHUNK_NOT_FOUND) {
                        cursor = map.cursor(currentKey);
                        // we (should) get the current key again,
                        // we need to ignore that one
                        if (!cursor.hasNext()) {
                            break;
                        }
                        cursor.next();
                        if (!cursor.hasNext()) {
                            break;
                        }
                        k = cursor.next();
                    } else {
                        throw e;
                    }
                }
                currentKey = k;
                if (includeUncommitted) {
                    return;
                }
                if (containsKey(k)) {
                    return;
                }
            }
            currentKey = null;
        }

        @Override
        public boolean hasNext() {
            return currentKey != null;
        }

        @Override
        public K next() {
            K result = currentKey;
            fetchNext();
            return result;
        }

        @Override
        public void remove() {
            throw DataUtils.newUnsupportedOperationException(
                    "Removing is not supported");
        }
    };
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:72,代码来源:TransactionStore.java

示例10: wrapIterator

import org.h2.mvstore.DataUtils; //导入方法依赖的package包/类
/**
 * Iterate over keys.
 *
 * @param iterator the iterator to wrap
 * @param includeUncommitted whether uncommitted entries should be
 *            included
 * @return the iterator
 */
public Iterator<K> wrapIterator(final Iterator<K> iterator,
        final boolean includeUncommitted) {
    // TODO duplicate code for wrapIterator and entryIterator
    return new Iterator<K>() {
        private K current;

        {
            fetchNext();
        }

        private void fetchNext() {
            while (iterator.hasNext()) {
                current = iterator.next();
                if (includeUncommitted) {
                    return;
                }
                if (containsKey(current)) {
                    return;
                }
            }
            current = null;
        }

        @Override
        public boolean hasNext() {
            return current != null;
        }

        @Override
        public K next() {
            K result = current;
            fetchNext();
            return result;
        }

        @Override
        public void remove() {
            throw DataUtils.newUnsupportedOperationException(
                    "Removing is not supported");
        }
    };
}
 
开发者ID:vdr007,项目名称:ThriftyPaxos,代码行数:51,代码来源:TransactionStore.java


注:本文中的org.h2.mvstore.DataUtils.newUnsupportedOperationException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。