public BasicSelector select(String rename, Expression expression) { return (BasicSelector) super.select(rename, expression); }
public BasicSelector addSelectionList(List<OutputAttribute> projectionList) { return (BasicSelector) super.addSelectionList(projectionList); }
public BasicSelector addGroupByList(List<Variable> list) { return (BasicSelector) super.addGroupByList(list); }
private void checkSelection(OutputAttribute newAttribute) { for (OutputAttribute attribute : selectionList) { if (attribute.getRename().equals(newAttribute.getRename())) { throw new DuplicateAttributeException(newAttribute.getRename() + " is already defined as an output " + "attribute ", newAttribute.getQueryContextStartIndex(), attribute.getQueryContextEndIndex()); } } }
public Selector select(String rename, Expression expression) { OutputAttribute outputAttribute = new OutputAttribute(rename, expression); checkSelection(outputAttribute); selectionList.add(outputAttribute); return this; }
public static Selector selector() { return new Selector(); }
public Selector orderBy(Variable variable) { orderByList.add(new OrderByAttribute(variable)); return this; }
public static BasicSelector basicSelector() { return new BasicSelector(); }
@Override public int hashCode() { int result = inputStore != null ? inputStore.hashCode() : 0; result = 31 * result + (selector != null ? selector.hashCode() : 0); result = 31 * result + (outputStream != null ? outputStream.hashCode() : 0); return result; }
public BasicSelector groupBy(Variable variable) { return (BasicSelector) super.groupBy(variable); }
public Selector addSelectionList(List<OutputAttribute> projectionList) { for (OutputAttribute outputAttribute : projectionList) { checkSelection(outputAttribute); this.selectionList.add(outputAttribute); } return this; }
@Override public int hashCode() { int result = order != null ? order.hashCode() : 0; result = 31 * result + (variable != null ? variable.hashCode() : 0); return result; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof OrderByAttribute)) { return false; } OrderByAttribute that = (OrderByAttribute) o; if (order != null ? !order.equals(that.order) : that.order != null) { return false; } return variable != null ? variable.equals(that.variable) : that.variable == null; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } StoreQuery that = (StoreQuery) o; if (inputStore != null ? !inputStore.equals(that.inputStore) : that.inputStore != null) { return false; } if (outputStream != null ? !outputStream.equals(that.outputStream) : that.outputStream != null) { return false; } return selector != null ? selector.equals(that.selector) : that.selector == null; }
public Selector select(Variable variable) { OutputAttribute outputAttribute = new OutputAttribute(variable); checkSelection(outputAttribute); selectionList.add(outputAttribute); return this; }
static <E> List<E> randomSelectN(Collection<? extends E> coll, int n) { assert n <= coll.size(); return coll.stream() .filter(new Selector(coll.size(), n)) .collect(toList()); }
public Selector orderBy(Variable variable, OrderByAttribute.Order order) { orderByList.add(new OrderByAttribute(variable, order)); return this; }
@Override public int hashCode() { int result = inputStream != null ? inputStream.hashCode() : 0; result = 31 * result + (selector != null ? selector.hashCode() : 0); result = 31 * result + (outputStream != null ? outputStream.hashCode() : 0); result = 31 * result + (outputRate != null ? outputRate.hashCode() : 0); result = 31 * result + (annotations != null ? annotations.hashCode() : 0); return result; }
public BasicSelector select(Variable variable) { return (BasicSelector) super.select(variable); }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + basicSingleInputStream.hashCode(); result = 31 * result + (selector != null ? selector.hashCode() : 0); result = 31 * result + aggregateAttribute.hashCode(); result = 31 * result + (timePeriod != null ? timePeriod.hashCode() : 0); result = 31 * result + (annotations != null ? annotations.hashCode() : 0); return result; }