本文整理了Java中com.persistit.Key.getDepth()
方法的一些代码示例,展示了Key.getDepth()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Key.getDepth()
方法的具体详情如下:
包路径:com.persistit.Key
类名称:Key
方法名:getDepth
[英]The number of key segments in this Key
. For example, the code <<$0$>>
results in a depth of 3.
[中]此Key
中的关键段数。例如,代码<<$0$>>
的深度为3。
代码示例来源:origin: SonarSource/sonarqube
@SuppressWarnings("unchecked")
@Override
public Entry<T> next() {
try {
exchange.next(keyFilter);
} catch (PersistitException e) {
throw new IllegalStateException(e);
}
if (exchange.getValue().isDefined()) {
T value = (T) exchange.getValue().get();
Key key = exchange.getKey();
Object[] array = new Object[key.getDepth()];
for (int i = 0; i < key.getDepth(); i++) {
array[i] = key.indexTo(i - key.getDepth()).decode();
}
return new Entry<>(array, value);
}
throw new NoSuchElementException();
}
代码示例来源:origin: org.codehaus.sonar/sonar-batch
@SuppressWarnings("unchecked")
@Override
public Entry<T> next() {
try {
exchange.next(keyFilter);
} catch (PersistitException e) {
throw new IllegalStateException(e);
}
if (exchange.getValue().isDefined()) {
T value = (T) exchange.getValue().get();
Key key = exchange.getKey();
Object[] array = new Object[key.getDepth()];
for (int i = 0; i < key.getDepth(); i++) {
array[i] = key.indexTo(i - key.getDepth()).decode();
}
return new Entry<T>(array, value);
}
throw new NoSuchElementException();
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-batch
@SuppressWarnings("unchecked")
@Override
public Entry<T> next() {
try {
exchange.next(keyFilter);
} catch (PersistitException e) {
throw new IllegalStateException(e);
}
if (exchange.getValue().isDefined()) {
T value = (T) exchange.getValue().get();
Key key = exchange.getKey();
Object[] array = new Object[key.getDepth()];
for (int i = 0; i < key.getDepth(); i++) {
array[i] = key.indexTo(i - key.getDepth()).decode();
}
return new Entry<>(array, value);
}
throw new NoSuchElementException();
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-scanner-engine
@SuppressWarnings("unchecked")
@Override
public Entry<T> next() {
try {
exchange.next(keyFilter);
} catch (PersistitException e) {
throw new IllegalStateException(e);
}
if (exchange.getValue().isDefined()) {
T value = (T) exchange.getValue().get();
Key key = exchange.getKey();
Object[] array = new Object[key.getDepth()];
for (int i = 0; i < key.getDepth(); i++) {
array[i] = key.indexTo(i - key.getDepth()).decode();
}
return new Entry<>(array, value);
}
throw new NoSuchElementException();
}
代码示例来源:origin: com.akiban/akiban-persistit
/**
* Return true if there is at least one key stored in this
* <code>Exchange</code> 's <code>Tree</code> that is a logical child of the
* current <code>Key</code>. A logical child is a key that can be formed by
* appending a value to the parent. (See <a
* href="Key.html#_keyChildren">Logical Key Children and Siblings</a>).
*
* @return <code>true</code> if the current <code>Key</code> has logical
* children
* @throws PersistitException
*/
public boolean hasChildren() throws PersistitException {
_key.copyTo(_spareKey2);
final int size = _key.getEncodedSize();
final boolean result = traverse(GT, true, 0, _key.getDepth() + 1, size, null);
_spareKey2.copyTo(_key);
return result;
}
代码示例来源:origin: com.akiban/akiban-persistit
/**
* Decodes the content of the supplied <code>KeyState</code> as an array of
* Objects, one object per <a href="com.persisit.Key.html#_keySegments> key
* segment</a>.
*
* @param keyState
* Representation of an encoded {@link Key}.
*
* @param context
*
* @return
*
* @throws RemoteException
*/
@Override
public Object[] decodeKeyObjects(final KeyState keyState, final CoderContext context) throws RemoteException {
try {
final Key key = new Key(_persistit);
keyState.copyTo(key);
final int size = key.getDepth();
final Object[] result = new Object[size];
for (int index = 0; index < size; index++) {
result[index] = key.decode(null, context);
}
return result;
} catch (final Exception e) {
throw new WrappedRemoteException(e);
}
}
代码示例来源:origin: com.akiban/akiban-persistit
int index = 0;
if (key != null) {
_terms = new Term[key.getDepth()];
size = key.getEncodedSize();
代码示例来源:origin: com.akiban/akiban-persistit
if (minKeyDepth > 0 && _key.getDepth() < minKeyDepth) {
stopDueToKeyDepth = true;
} else if (matchUpToIndex > 0) {
内容来源于网络,如有侵权,请联系作者删除!