use of java.lang.Integer in project LoganSquare by bluelinelabs.
the class SimpleCollectionModel$$JsonObjectMapper method parseField.
@Override
public void parseField(SimpleCollectionModel instance, String fieldName, JsonParser jsonParser) throws IOException {
if ("model_array".equals(fieldName)) {
if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
List<SimpleCollectionModel.ModelForCollection> collection1 = new ArrayList<SimpleCollectionModel.ModelForCollection>();
while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
SimpleCollectionModel.ModelForCollection value1;
value1 = COM_BLUELINELABS_LOGANSQUARE_PROCESSOR_SIMPLECOLLECTIONMODEL_MODELFORCOLLECTION__JSONOBJECTMAPPER.parse(jsonParser);
collection1.add(value1);
}
SimpleCollectionModel.ModelForCollection[] array = collection1.toArray(new SimpleCollectionModel.ModelForCollection[collection1.size()]);
instance.modelForCollectionArray = array;
} else {
instance.modelForCollectionArray = null;
}
} else if ("model_array_list".equals(fieldName)) {
if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
ArrayList<SimpleCollectionModel.ModelForCollection> collection1 = new ArrayList<SimpleCollectionModel.ModelForCollection>();
while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
SimpleCollectionModel.ModelForCollection value1;
value1 = COM_BLUELINELABS_LOGANSQUARE_PROCESSOR_SIMPLECOLLECTIONMODEL_MODELFORCOLLECTION__JSONOBJECTMAPPER.parse(jsonParser);
collection1.add(value1);
}
instance.modelForCollectionArrayList = collection1;
} else {
instance.modelForCollectionArrayList = null;
}
} else if ("model_deque".equals(fieldName)) {
if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
ArrayDeque<SimpleCollectionModel.ModelForCollection> collection1 = new ArrayDeque<SimpleCollectionModel.ModelForCollection>();
while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
SimpleCollectionModel.ModelForCollection value1;
value1 = COM_BLUELINELABS_LOGANSQUARE_PROCESSOR_SIMPLECOLLECTIONMODEL_MODELFORCOLLECTION__JSONOBJECTMAPPER.parse(jsonParser);
collection1.add(value1);
}
instance.modelForCollectionDeque = collection1;
} else {
instance.modelForCollectionDeque = null;
}
} else if ("model_hash_map".equals(fieldName)) {
if (jsonParser.getCurrentToken() == JsonToken.START_OBJECT) {
HashMap<String, SimpleCollectionModel.ModelForCollection> map1 = new HashMap<String, SimpleCollectionModel.ModelForCollection>();
while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
String key1 = jsonParser.getText();
jsonParser.nextToken();
if (jsonParser.getCurrentToken() == JsonToken.VALUE_NULL) {
map1.put(key1, null);
} else {
map1.put(key1, COM_BLUELINELABS_LOGANSQUARE_PROCESSOR_SIMPLECOLLECTIONMODEL_MODELFORCOLLECTION__JSONOBJECTMAPPER.parse(jsonParser));
}
}
instance.modelForCollectionHashMap = map1;
} else {
instance.modelForCollectionHashMap = null;
}
} else if ("model_linked_hash_map".equals(fieldName)) {
if (jsonParser.getCurrentToken() == JsonToken.START_OBJECT) {
LinkedHashMap<String, SimpleCollectionModel.ModelForCollection> map1 = new LinkedHashMap<String, SimpleCollectionModel.ModelForCollection>();
while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
String key1 = jsonParser.getText();
jsonParser.nextToken();
if (jsonParser.getCurrentToken() == JsonToken.VALUE_NULL) {
map1.put(key1, null);
} else {
map1.put(key1, COM_BLUELINELABS_LOGANSQUARE_PROCESSOR_SIMPLECOLLECTIONMODEL_MODELFORCOLLECTION__JSONOBJECTMAPPER.parse(jsonParser));
}
}
instance.modelForCollectionLinkedHashMap = map1;
} else {
instance.modelForCollectionLinkedHashMap = null;
}
} else if ("model_linked_list".equals(fieldName)) {
if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
LinkedList<SimpleCollectionModel.ModelForCollection> collection1 = new LinkedList<SimpleCollectionModel.ModelForCollection>();
while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
SimpleCollectionModel.ModelForCollection value1;
value1 = COM_BLUELINELABS_LOGANSQUARE_PROCESSOR_SIMPLECOLLECTIONMODEL_MODELFORCOLLECTION__JSONOBJECTMAPPER.parse(jsonParser);
collection1.add(value1);
}
instance.modelForCollectionLinkedList = collection1;
} else {
instance.modelForCollectionLinkedList = null;
}
} else if ("model_list".equals(fieldName)) {
if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
ArrayList<SimpleCollectionModel.ModelForCollection> collection1 = new ArrayList<SimpleCollectionModel.ModelForCollection>();
while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
SimpleCollectionModel.ModelForCollection value1;
value1 = COM_BLUELINELABS_LOGANSQUARE_PROCESSOR_SIMPLECOLLECTIONMODEL_MODELFORCOLLECTION__JSONOBJECTMAPPER.parse(jsonParser);
collection1.add(value1);
}
instance.modelForCollectionList = collection1;
} else {
instance.modelForCollectionList = null;
}
} else if ("model_map".equals(fieldName)) {
if (jsonParser.getCurrentToken() == JsonToken.START_OBJECT) {
HashMap<String, SimpleCollectionModel.ModelForCollection> map1 = new HashMap<String, SimpleCollectionModel.ModelForCollection>();
while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
String key1 = jsonParser.getText();
jsonParser.nextToken();
if (jsonParser.getCurrentToken() == JsonToken.VALUE_NULL) {
map1.put(key1, null);
} else {
map1.put(key1, COM_BLUELINELABS_LOGANSQUARE_PROCESSOR_SIMPLECOLLECTIONMODEL_MODELFORCOLLECTION__JSONOBJECTMAPPER.parse(jsonParser));
}
}
instance.modelForCollectionMap = map1;
} else {
instance.modelForCollectionMap = null;
}
} else if ("model_queue".equals(fieldName)) {
if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
ArrayDeque<SimpleCollectionModel.ModelForCollection> collection1 = new ArrayDeque<SimpleCollectionModel.ModelForCollection>();
while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
SimpleCollectionModel.ModelForCollection value1;
value1 = COM_BLUELINELABS_LOGANSQUARE_PROCESSOR_SIMPLECOLLECTIONMODEL_MODELFORCOLLECTION__JSONOBJECTMAPPER.parse(jsonParser);
collection1.add(value1);
}
instance.modelForCollectionQueue = collection1;
} else {
instance.modelForCollectionQueue = null;
}
} else if ("model_set".equals(fieldName)) {
if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
HashSet<SimpleCollectionModel.ModelForCollection> collection1 = new HashSet<SimpleCollectionModel.ModelForCollection>();
while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
SimpleCollectionModel.ModelForCollection value1;
value1 = COM_BLUELINELABS_LOGANSQUARE_PROCESSOR_SIMPLECOLLECTIONMODEL_MODELFORCOLLECTION__JSONOBJECTMAPPER.parse(jsonParser);
collection1.add(value1);
}
instance.modelForCollectionSet = collection1;
} else {
instance.modelForCollectionSet = null;
}
} else if ("model_tree_map".equals(fieldName)) {
if (jsonParser.getCurrentToken() == JsonToken.START_OBJECT) {
TreeMap<String, SimpleCollectionModel.ModelForCollection> map1 = new TreeMap<String, SimpleCollectionModel.ModelForCollection>();
while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
String key1 = jsonParser.getText();
jsonParser.nextToken();
if (jsonParser.getCurrentToken() == JsonToken.VALUE_NULL) {
map1.put(key1, null);
} else {
map1.put(key1, COM_BLUELINELABS_LOGANSQUARE_PROCESSOR_SIMPLECOLLECTIONMODEL_MODELFORCOLLECTION__JSONOBJECTMAPPER.parse(jsonParser));
}
}
instance.modelForCollectionTreeMap = map1;
} else {
instance.modelForCollectionTreeMap = null;
}
} else if ("primitive_array".equals(fieldName)) {
if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
List<Integer> collection1 = new ArrayList<Integer>();
while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
collection1.add(jsonParser.getValueAsInt());
}
int[] array = new int[collection1.size()];
int i = 0;
for (int value : collection1) {
array[i++] = value;
}
instance.primitiveArray = array;
} else {
instance.primitiveArray = null;
}
}
}
use of java.lang.Integer in project geode by apache.
the class PRQueryProcessor method buildCallableTaskList.
private List buildCallableTaskList(Collection<Collection> resultsColl) {
List callableTasks = new ArrayList();
for (Iterator itr = _bucketsToQuery.iterator(); itr.hasNext(); ) {
Integer bId = (Integer) itr.next();
callableTasks.add(new QueryTask(this.query, this.parameters, _prds, bId, resultsColl));
}
return callableTasks;
}
use of java.lang.Integer in project geode by apache.
the class PRQueryProcessor method executeSequentially.
private void executeSequentially(Collection<Collection> resultCollector, List buckets) throws QueryException, InterruptedException, ForceReattemptException {
/*
* for (Iterator itr = _bucketsToQuery.iterator(); itr.hasNext(); ) { Integer bId =
* (Integer)itr.next(); doBucketQuery(bId, this._prds, this.query, this.parameters,
* resultCollector); }
*/
ExecutionContext context = new QueryExecutionContext(this.parameters, this.pr.getCache(), this.query);
CompiledSelect cs = this.query.getSimpleSelect();
int limit = this.query.getLimit(parameters);
if (cs != null && cs.isOrderBy()) {
for (Integer bucketID : this._bucketsToQuery) {
List<Integer> singleBucket = Collections.singletonList(bucketID);
context.setBucketList(singleBucket);
executeQueryOnBuckets(resultCollector, context);
}
Collection mergedResults = coalesceOrderedResults(resultCollector, context, cs, limit);
resultCollector.clear();
resultCollector.add(mergedResults);
} else {
context.setBucketList(buckets);
executeQueryOnBuckets(resultCollector, context);
}
}
use of java.lang.Integer in project geode by apache.
the class TypeRegistry method defineEnum.
public int defineEnum(EnumInfo newInfo) {
Integer existingId = this.enumInfoToId.get(newInfo);
if (existingId != null) {
return existingId;
}
int id = this.distributedTypeRegistry.defineEnum(newInfo);
EnumInfo oldInfo = this.idToEnum.get(id);
if (oldInfo == null) {
this.idToEnum.put(id, newInfo);
this.enumInfoToId.put(newInfo, id);
if (logger.isInfoEnabled()) {
logger.info("Caching PDX Enum: {}, dsid={} typenum={}", newInfo, id >> 24, id & 0xFFFFFF);
}
} else if (!oldInfo.equals(newInfo)) {
Assert.fail("Old enum does not equal new enum for the same id. oldEnum=" + oldInfo + " newEnum=" + newInfo);
}
return id;
}
use of java.lang.Integer in project geode by apache.
the class TypeRegistry method getEnumId.
/**
* Given an enum compute and return a code for it.
*/
public int getEnumId(Enum<?> v) {
int result = 0;
if (v != null) {
Integer id = this.localEnumIds.get(v);
if (id != null) {
result = id;
} else {
result = this.distributedTypeRegistry.getEnumId(v);
id = valueOf(result);
this.localEnumIds.put(v, id);
EnumInfo ei = new EnumInfo(v);
this.idToEnum.put(id, ei);
this.enumInfoToId.put(ei, id);
}
}
return result;
}
Aggregations