本文整理匯總了Java中com.espertech.esper.event.arr.ObjectArrayEventType.getPropertiesIndexes方法的典型用法代碼示例。如果您正苦於以下問題:Java ObjectArrayEventType.getPropertiesIndexes方法的具體用法?Java ObjectArrayEventType.getPropertiesIndexes怎麽用?Java ObjectArrayEventType.getPropertiesIndexes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.espertech.esper.event.arr.ObjectArrayEventType
的用法示例。
在下文中一共展示了ObjectArrayEventType.getPropertiesIndexes方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: EventBeanManufacturerObjectArray
import com.espertech.esper.event.arr.ObjectArrayEventType; //導入方法依賴的package包/類
/**
* Ctor.
*
* @param eventType type to create
* @param eventAdapterService event factory
* @param properties written properties
*/
public EventBeanManufacturerObjectArray(ObjectArrayEventType eventType, EventAdapterService eventAdapterService, WriteablePropertyDescriptor[] properties) {
this.eventAdapterService = eventAdapterService;
this.eventType = eventType;
Map<String, Integer> indexes = eventType.getPropertiesIndexes();
indexPerWritable = new int[properties.length];
boolean oneToOneMapping = true;
for (int i = 0; i < properties.length; i++) {
String propertyName = properties[i].getPropertyName();
Integer index = indexes.get(propertyName);
if (index == null) {
throw new IllegalStateException("Failed to find property '" + propertyName + "' among the array indexes");
}
indexPerWritable[i] = index;
if (index != i) {
oneToOneMapping = false;
}
}
oneToOne = oneToOneMapping && properties.length == eventType.getPropertyNames().length;
}