/** * Check if the field identified by the field name is of type long according to the schema. * @param type contains metadata about fields * @param longFieldName is the field's field name to test * @return a String error message if the field doesn't exist or is not a long, or null to indicate success */ public static String checkLong(EventType type, String longFieldName) { Class clazz = getClass(type, longFieldName); if (clazz == null) { return "Parent view does not contain a field named '" + longFieldName + '\''; } if ((clazz != Long.class) && (clazz != long.class)) { return "Parent view field named '" + longFieldName + "' is not of type long"; } return checkFieldNumeric(type, longFieldName); }
public void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, List<ViewFactory> parentViewFactories) throws ViewAttachException { String message = PropertyCheckHelper.checkNumeric(parentEventType, measureField); if (message != null) { throw new ViewAttachException(message); } message = PropertyCheckHelper.exists(parentEventType, columnField); if (message != null) { throw new ViewAttachException(message); } if (rowField != null) { message = PropertyCheckHelper.exists(parentEventType, rowField); if (message != null) { throw new ViewAttachException(message); } } if (pageField != null) { message = PropertyCheckHelper.exists(parentEventType, pageField); if (message != null) { throw new ViewAttachException(message); } } eventType = MultiDimStatsView.createEventType(statementContext); }
public void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, List<ViewFactory> parentViewFactories) throws ViewAttachException { // Attaches to just about anything as long as all the fields exists for (int i = 0; i < propertyNames.length; i++) { String message = PropertyCheckHelper.exists(parentEventType, propertyNames[i]); if (message != null) { throw new ViewAttachException(message); } } this.eventType = parentEventType; }
public void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, List<ViewFactory> parentViewFactories) throws ViewAttachException { String result = PropertyCheckHelper.checkNumeric(parentEventType, fieldNameX, fieldNameWeight); if (result != null) { throw new ViewAttachException(result); } eventType = WeightedAverageView.createEventType(statementContext); }
/** * Check if the field identified by the field name exists according to the schema. * @param type contains metadata about fields * @param fieldName is the field's field name to test * @return a String error message if the field doesn't exist, or null to indicate success */ public static String exists(EventType type, String fieldName) { Class clazz = getClass(type, fieldName); if (clazz == null) { return "Parent view does not contain a field named '" + fieldName + '\''; } return null; }
/** * Check if the field identified by the field name is a valid numeric field according to the schema. * @param type contains metadata about fields * @param numericFieldName is the field's field name to test * @return a String error message if the field doesn't exist or is not numeric, or null to indicate success */ public static String checkNumeric(EventType type, String numericFieldName) { return checkFieldNumeric(type, numericFieldName); }
public void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, List<ViewFactory> parentViewFactories) throws ViewAttachException { String message = PropertyCheckHelper.checkLong(parentEventType, timestampFieldName); if (message != null) { throw new ViewAttachException(message); } this.eventType = parentEventType; }
public void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, List<ViewFactory> parentViewFactories) throws ViewAttachException { // Attaches to just about anything as long as all the fields exists for (int i = 0; i < groupFieldNames.length; i++) { String message = PropertyCheckHelper.exists(parentEventType, groupFieldNames[i]); if (message != null) { throw new ViewAttachException(message); } } this.eventType = parentEventType; }
public void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, List<ViewFactory> parentViewFactories) throws ViewAttachException { String result = PropertyCheckHelper.checkNumeric(parentEventType, fieldNameX, fieldNameY); if (result != null) { throw new ViewAttachException(result); } eventType = CorrelationView.createEventType(statementContext); }
/** * Check if the fields identified by the field names both exists according to the schema. * @param type contains metadata about fields * @param fieldNameOne is the first field's field name to test * @param fieldNameTwo is the first field's field name to test * @return a String error message if either of the fields doesn't exist, or null to indicate success */ public static String exists(EventType type, String fieldNameOne, String fieldNameTwo) { Class clazz = getClass(type, fieldNameOne); if (clazz == null) { return "Parent view does not contain a field named '" + fieldNameOne + '\''; } clazz = getClass(type, fieldNameTwo); if (clazz == null) { return "Parent view does not contain a field named '" + fieldNameTwo + '\''; } return null; }
/** * Check if the fields identified by their field names are valid numeric field according to the schema. * @param type contains metadata about fields * @param numericFieldNameX is the first field's field name to test * @param numericFieldNameY is the second field's field name to test * @return a String error message if the field doesn't exist or is not numeric, or null to indicate success */ public static String checkNumeric(EventType type, String numericFieldNameX, String numericFieldNameY) { String error = checkFieldNumeric(type, numericFieldNameX); if (error != null) { return error; } return checkFieldNumeric(type, numericFieldNameY); }
public void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, List<ViewFactory> parentViewFactories) throws ViewAttachException { // Attaches to parent views where the sort fields exist and implement Comparable String result = PropertyCheckHelper.exists(parentEventType, timestampFieldName); if(result != null) { throw new ViewAttachException(result); } eventType = parentEventType; }
public void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, List<ViewFactory> parentViewFactories) throws ViewAttachException { String result = PropertyCheckHelper.checkNumeric(parentEventType, fieldNameX, fieldNameY); if (result != null) { throw new ViewAttachException(result); } eventType = RegressionLinestView.createEventType(statementContext); }
private static String checkFieldNumeric(EventType type, String numericFieldName) { Class clazz = getClass(type, numericFieldName); if (clazz == null) { return "Parent view does not contain a field named '" + numericFieldName + '\''; } if (!JavaClassHelper.isNumeric(clazz)) { return "Parent view field named '" + numericFieldName + "' is not a number"; } return null; }
public void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, List<ViewFactory> parentViewFactories) throws ViewAttachException { // Attaches to just about anything as long as all the fields exists for (int i = 0; i < propertyNames.length; i++) { String message = PropertyCheckHelper.exists(parentEventType, propertyNames[i]); if (message != null) { throw new ViewAttachException(message); } } this.eventType = parentEventType; }
public void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, List<ViewFactory> parentViewFactories) throws ViewAttachException { String result = PropertyCheckHelper.checkNumeric(parentEventType, fieldName); if (result != null) { throw new ViewAttachException(result); } eventType = UnivariateStatisticsView.createEventType(statementContext); }
public void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, List<ViewFactory> parentViewFactories) throws ViewAttachException { // Attaches to parent views where the sort fields exist and implement Comparable String result = null; for(String name : sortFieldNames) { result = PropertyCheckHelper.exists(parentEventType, name); if(result != null) { throw new ViewAttachException(result); } } eventType = parentEventType; }