/** * Searches through the specified {@link MultiEncoder}'s previously configured * encoders to find and return one that is of type {@link DateEncoder} * * @param enc the containing {@code MultiEncoder} * @return */ private Optional <SDRPassThroughEncoder> GetSDRPassThroughEncoder(MultiEncoder enc) { foreach (EncoderTuple t in enc.GetEncoders(enc)) { if (t.GetEncoder() is SDRPassThroughEncoder) { return(new Optional <SDRPassThroughEncoder>(t.GetEncoder <SDRPassThroughEncoder>())); // Optional.of((SDRPassThroughEncoder)t.getEncoder()); } } return(Optional <SDRPassThroughEncoder> .Empty()); }
/** * Searches through the specified {@link MultiEncoder}'s previously configured * encoders to find and return one that is of type {@link DateEncoder} * * @param enc the containing {@code MultiEncoder} * @return */ private Optional <DateEncoder> GetDateEncoder(MultiEncoder enc) { foreach (EncoderTuple t in enc.GetEncoders(enc)) { if (t.GetEncoder() is DateEncoder) { return(new Optional <DateEncoder>(t.GetEncoder <DateEncoder>()));//Optional.of((DateEncoder)t.GetEncoder()); } } return(Optional <DateEncoder> .Empty()); }
/** * Searches through the specified {@link MultiEncoder}'s previously configured * encoders to find and return one that is of type {@link CategoryEncoder} or * {@link SDRCategoryEncoder} * * @param enc the containing {@code MultiEncoder} * @return */ private Optional <IEncoder> GetCategoryEncoder(MultiEncoder enc) { foreach (EncoderTuple t in enc.GetEncoders(enc)) { if ((t.GetEncoder() is CategoryEncoder) || (t.GetEncoder() is SDRCategoryEncoder)) { return(new Optional <IEncoder>(t.GetEncoder())); //Optional.of(t.getEncoder()); } } return(Optional <IEncoder> .Empty()); }
/** * Searches through the specified {@link MultiEncoder}'s previously configured * encoders to find and return one that is of type {@link CoordinateEncoder} or * {@link GeospatialCoordinateEncoder} * * @param enc the containing {@code MultiEncoder} * @return */ private Optional <IEncoder> GetCoordinateEncoder(MultiEncoder enc) { foreach (EncoderTuple t in enc.GetEncoders(enc)) { if ((t.GetEncoder() is CoordinateEncoder) || (t.GetEncoder() is GeospatialCoordinateEncoder)) { return(new Optional <IEncoder>(t.GetEncoder())); // Optional.of(t.getEncoder()); } } return(Optional <IEncoder> .Empty()); }
/** * Sets the local parameters used to configure the major * algorithmic components. */ public override void InitEncoder(Parameters p) { localParameters = p; Map <string, Map <string, object> > encoderSettings; if ((encoderSettings = (Map <string, Map <string, object> >)p.GetParameterByKey(Parameters.KEY.FIELD_ENCODING_MAP)) != null && !encoder.GetEncoders().Any() && indexToEncoderMap == null) { InitEncoders(encoderSettings); MakeIndexEncoderMap(); } }
/** * Searches through the specified {@link MultiEncoder}'s previously configured * encoders to find and return one that is of type {@link ScalarEncoder}, * {@link RandomDistributedScalarEncoder}, {@link AdaptiveScalarEncoder}, * {@link LogEncoder} or {@link DeltaEncoder}. * * @param enc the containing {@code MultiEncoder} * @return */ private Optional <IEncoder> GetNumberEncoder(MultiEncoder enc) { foreach (EncoderTuple t in enc.GetEncoders(enc)) { if ((t.GetEncoder() is RandomDistributedScalarEncoder) || (t.GetEncoder() is ScalarEncoder) || (t.GetEncoder() is AdaptiveScalarEncoder) || (t.GetEncoder() is LogEncoder) || (t.GetEncoder() is DeltaEncoder)) { return(new Optional <IEncoder>(t.GetEncoder())); // Optional.of(t.getEncoder()); } } return(Optional <IEncoder> .Empty()); }