當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。