Esempio n. 1
0
        public override bool check(MovieBean movie)
        {
            String movieVal = (String)movie.get(filterField);

            if (movieVal == null)
            {
                movieVal = "";
            }
            bool returnVal = true;

            switch (filterType)
            {
            case TYPE.CONTAINS:
                returnVal = movieVal.ToUpper().Contains(filterValue.ToUpper());
                break;

            case TYPE.ENDS_WITH:
                returnVal = movieVal.ToUpper().EndsWith(filterValue.ToUpper());
                break;

            case TYPE.EQUALS:
                returnVal = movieVal.ToUpper().Equals(filterValue.ToUpper());
                break;

            case TYPE.STARTS_WITH:
                returnVal = movieVal.ToUpper().StartsWith(filterValue.ToUpper());
                break;
            }
            if (not)
            {
                return(!returnVal);
            }
            return(returnVal);
        }
Esempio n. 2
0
        public override bool check(MovieBean movie)//This will need re-work if a movie can be part of more than one collection
        {
            String collection = ((String)movie.get(filterField));
            String movieVal   = "";

            if (collection != null || collection != "")
            {
                movieVal = collection;
            }

            return(filterValues.Contains(movieVal));
        }
Esempio n. 3
0
        public override bool check(MovieBean movie)
        {
            List <string> value = (List <string>)movie.get(filterField);

            switch (filterType)
            {
            case TYPE.RELAXED:
                return(value.Intersect(filterValue).Any());

            case TYPE.STRICT:
                return(value.Intersect(filterValue).ToList().Count == filterValue.Count);
            }
            return(true);
        }
Esempio n. 4
0
        public override bool check(MovieBean movie)
        {
            double value = double.Parse(movie.get(filterField).ToString());

            switch (filterType)
            {
            case TYPE.BETWEEN:
                return((value > lowerBound) && (value < upperBound));

            case TYPE.EXACT:
                return(value == lowerBound);

            case TYPE.GREATER_THAN:
                return(value > lowerBound);

            case TYPE.LESS_THAN:
                return(value < lowerBound);
            }
            return(true);
        }
Esempio n. 5
0
        public override bool check(MovieBean movie)
        {
            DateTime movieVal = (DateTime)movie.get(filterField);

            switch (filterType)
            {
            case TYPE.AFTER:
                return(lowerBound.CompareTo(movieVal) < 0);

            case TYPE.BEFORE:
                return(upperBound.CompareTo(movieVal) > 0);

            case TYPE.BETWEEN:
                return(lowerBound.CompareTo(movieVal) < 0 && upperBound.CompareTo(movieVal) > 0);

            case TYPE.EXACT:
                return(lowerBound.CompareTo(movieVal) == 0);
            }
            return(true);
        }
Esempio n. 6
0
        public override bool check(MovieBean movie)
        {
            bool val = (bool)movie.get(filterField);

            return(val == filterValue);
        }