本文整理匯總了Java中org.apache.geode.cache.query.Struct.getFieldValues方法的典型用法代碼示例。如果您正苦於以下問題:Java Struct.getFieldValues方法的具體用法?Java Struct.getFieldValues怎麽用?Java Struct.getFieldValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.geode.cache.query.Struct
的用法示例。
在下文中一共展示了Struct.getFieldValues方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: occurrences
import org.apache.geode.cache.query.Struct; //導入方法依賴的package包/類
@Override
public int occurrences(Object element) {
if (!(element instanceof Struct)) {
return 0;
}
Struct s = (Struct) element;
if (!this.elementType.equals(StructTypeImpl.typeFromStruct(s))) {
return 0;
}
if (this.hasLimitIterator) {
int count = 0;
boolean encounteredObject = false;
Object[] fields = s.getFieldValues();
for (Iterator itr = this.fieldValuesIterator(); itr.hasNext();) {
Object[] structFields = (Object[]) itr.next();
if (Arrays.equals(fields, structFields)) {
count++;
encounteredObject = true;
} else if (encounteredObject) {
// Asif: No possibility of its occurence again
break;
}
}
return count;
} else {
return this.map.get(s.getFieldValues()); // returns 0 if not found
}
}
示例2: occurrences
import org.apache.geode.cache.query.Struct; //導入方法依賴的package包/類
@Override
public int occurrences(Object element) {
if (!(element instanceof Struct)) {
return 0;
}
Struct s = (Struct) element;
if (!this.elementType.equals(StructTypeImpl.typeFromStruct(s))) {
return 0;
}
if (this.hasLimitIterator) {
int count = 0;
boolean encounteredObject = false;
Object[] fields = s.getFieldValues();
for (Iterator itr = this.fieldValuesIterator(); itr.hasNext();) {
Object[] structFields = (Object[]) itr.next();
if (Arrays.equals(fields, structFields)) {
count++;
encounteredObject = true;
} else if (encounteredObject) {
// Asif: No possibility of its occurence again
break;
}
}
return count;
} else {
return this.mapGet(s.getFieldValues()); // returns 0 if not found
}
}
示例3: next
import org.apache.geode.cache.query.Struct; //導入方法依賴的package包/類
@Override
public Object next() {
Object object = iterator.next();
if (object instanceof Struct) {
Struct struct = (Struct) object;
Object[] values = struct.getFieldValues();
Object[] newValues = new Object[values.length];
for (int i = 0; i < values.length; i++) {
if (values[i] instanceof PdxInstance) {
newValues[i] = ((PdxInstance) values[i]).getObject();
} else if (values[i] instanceof PdxString) {
newValues[i] = ((PdxString) values[i]).toString();
} else if (copyOnRead) {
// due to bug #50650 When query results are fed back through the query engine
// we could end up copying a java object but due to serialization
// end up getting a pdx value. So extract the actual value if needed
newValues[i] = extractPdxIfNeeded(CopyHelper.copy(values[i]));
} else {
newValues[i] = values[i];
}
}
return new StructImpl((StructTypeImpl) struct.getStructType(), newValues);
} else {
if (object instanceof PdxInstance) {
object = ((PdxInstance) object).getObject();
} else if (object instanceof PdxString) {
object = ((PdxString) object).toString();
} else if (copyOnRead) {
// due to bug #50650 When query results are fed back through the query engine
// we could end up copying a java object but due to serialization
// end up getting a pdx value. So extract the actual value if needed
object = extractPdxIfNeeded(CopyHelper.copy(object));
}
return object;
}
}
示例4: setIndexFieldValuesInRespectiveIterators
import org.apache.geode.cache.query.Struct; //導入方法依賴的package包/類
private static boolean setIndexFieldValuesInRespectiveIterators(Object value,
RuntimeIterator[] indexFieldToItrsMapping, IndexCutDownExpansionHelper icdeh) {
Object[] checkFields = null;
boolean select = true;
int len = indexFieldToItrsMapping.length;
RuntimeIterator rItr = null;
if (len == 1) {
// Asif : this means we have a ResultSet
Support.Assert(!icdeh.cutDownNeeded,
"If the index fields to iter mapping is of of size 1 then cut down cannot occur");
indexFieldToItrsMapping[0].setCurrent(value);
} else {
Struct struct = (Struct) value;
Object fieldValues[] = struct.getFieldValues();
int size = fieldValues.length;
if (icdeh.cutDownNeeded)
checkFields = new Object[icdeh.checkSize];
// Object values[] = new Object[numItersInResultSet];
int j = 0;
for (int i = 0; i < size; i++) {
rItr = indexFieldToItrsMapping[i];
if (rItr != null) {
rItr.setCurrent(fieldValues[i]);
if (icdeh.cutDownNeeded) {
checkFields[j++] = fieldValues[i];
}
}
}
if (icdeh.cutDownNeeded) {
Object temp = null;
if (icdeh.checkSize == 1) {
temp = checkFields[0];
} else {
temp = new StructImpl((StructTypeImpl) icdeh.checkType, checkFields);
}
if (icdeh.checkSet.contains(temp)) {
select = false;
} else {
icdeh.checkSet.add(temp);
}
}
}
return select;
}
示例5: copyStruct
import org.apache.geode.cache.query.Struct; //導入方法依賴的package包/類
private Object[] copyStruct(Struct struct) {
Object[] prevValues = struct.getFieldValues();
Object[] newRow = new Object[prevValues.length];
System.arraycopy(prevValues, 0, newRow, 0, prevValues.length);
return newRow;
}