コード例 #1
0
 static FieldCacheImpl()
 {
     BYTE_PARSER = new AnonymousClassByteParser();
     SHORT_PARSER = new AnonymousClassShortParser();
     INT_PARSER = new AnonymousClassIntParser();
     FLOAT_PARSER = new AnonymousClassFloatParser();
 }
コード例 #2
0
            protected internal override System.Object CreateValue(IndexReader reader, System.Object entryKey)
            {
                Entry entry = (Entry)entryKey;

                System.String field  = entry.field;
                ShortParser   parser = (ShortParser)entry.custom;

                short[]  retArray = new short[reader.MaxDoc()];
                TermDocs termDocs = reader.TermDocs();
                TermEnum termEnum = reader.Terms(new Term(field, ""));

                try
                {
                    do
                    {
                        Term term = termEnum.Term();
                        if (term == null || (System.Object)term.Field() != (System.Object)field)
                        {
                            break;
                        }
                        short termval = parser.ParseShort(term.Text());
                        termDocs.Seek(termEnum);
                        while (termDocs.Next())
                        {
                            retArray[termDocs.Doc()] = termval;
                        }
                    }while (termEnum.Next());
                }
                finally
                {
                    termDocs.Close();
                    termEnum.Close();
                }
                return(retArray);
            }
コード例 #3
0
 public static Either <TLeft, short> ParseToShort <TLeft>(
     this Either <TLeft, string> source,
     NumberStyles style,
     TLeft left)
 {
     return(source.FlatMap(x => ShortParser.Parse <TLeft>(x, style, left)));
 }
コード例 #4
0
 static FieldCacheImpl()
 {
     BYTE_PARSER  = new AnonymousClassByteParser();
     SHORT_PARSER = new AnonymousClassShortParser();
     INT_PARSER   = new AnonymousClassIntParser();
     FLOAT_PARSER = new AnonymousClassFloatParser();
 }
コード例 #5
0
 public static Either <TLeft, short> ParseToShort <TLeft>(
     this Either <TLeft, string> source,
     IFormatProvider provider,
     TLeft left)
 {
     return(source.FlatMap(x => ShortParser.Parse <TLeft>(x, provider, left)));
 }
コード例 #6
0
 public static Either <TLeft, short> ParseToShort <TLeft>(
     this string source,
     NumberStyles style,
     IFormatProvider provider,
     TLeft left)
 {
     return(ShortParser.Parse <TLeft>(source, style, provider, left));
 }
コード例 #7
0
 static FieldCache_Fields()
 {
     DEFAULT                     = new FieldCacheImpl();
     DEFAULT_BYTE_PARSER         = new AnonymousClassByteParser();
     DEFAULT_SHORT_PARSER        = new AnonymousClassShortParser();
     DEFAULT_INT_PARSER          = new AnonymousClassIntParser();
     DEFAULT_FLOAT_PARSER        = new AnonymousClassFloatParser();
     DEFAULT_LONG_PARSER         = new AnonymousClassLongParser();
     DEFAULT_DOUBLE_PARSER       = new AnonymousClassDoubleParser();
     NUMERIC_UTILS_INT_PARSER    = new AnonymousClassIntParser1();
     NUMERIC_UTILS_FLOAT_PARSER  = new AnonymousClassFloatParser1();
     NUMERIC_UTILS_LONG_PARSER   = new AnonymousClassLongParser1();
     NUMERIC_UTILS_DOUBLE_PARSER = new AnonymousClassDoubleParser1();
 }
コード例 #8
0
ファイル: FieldCacheImpl.cs プロジェクト: philiphoy/ravendb
            protected internal override System.Object CreateValue(IndexReader reader, Entry entryKey)
            {
                Entry entry = (Entry)entryKey;

                System.String field  = entry.field;
                ShortParser   parser = (ShortParser)entry.custom;

                if (parser == null)
                {
                    return(wrapper.GetShorts(reader, field, Lucene.Net.Search.FieldCache_Fields.DEFAULT_SHORT_PARSER));
                }
                short[]  retArray = new short[reader.MaxDoc()];
                TermDocs termDocs = reader.TermDocs();
                TermEnum termEnum = reader.Terms(new Term(field));

                try
                {
                    do
                    {
                        Term term = termEnum.Term();
                        if (term == null || (System.Object)term.Field() != (System.Object)field)
                        {
                            break;
                        }
                        short termval = parser.ParseShort(term.Text());
                        termDocs.Seek(termEnum);
                        while (termDocs.Next())
                        {
                            retArray[termDocs.Doc()] = termval;
                        }
                    }while (termEnum.Next());
                }
                catch (StopFillCacheException stop)
                {
                }
                finally
                {
                    termDocs.Close();
                    termEnum.Close();
                }
                return(retArray);
            }
コード例 #9
0
 // inherit javadocs
 public virtual short[] GetShorts(IndexReader reader, System.String field, ShortParser parser)
 {
     return((short[])shortsCache.Get(reader, new Entry(field, parser)));
 }
コード例 #10
0
 public static Maybe <short> ParseToShort(this string source)
 {
     return(ShortParser.Parse(source));
 }
コード例 #11
0
 public static Maybe <short> ParseToShort(this Maybe <string> source, NumberStyles style, IFormatProvider provider)
 {
     return(source.FlatMap(x => ShortParser.Parse(x, style, provider)));
 }
コード例 #12
0
 public static Maybe <short> ParseToShort(this Maybe <string> source, NumberStyles style)
 {
     return(source.FlatMap(x => ShortParser.Parse(x, style)));
 }
コード例 #13
0
 internal ShortComparator(int numHits, System.String field, Lucene.Net.Search.Parser parser)
 {
     values      = new short[numHits];
     this.field  = field;
     this.parser = (ShortParser)parser;
 }
コード例 #14
0
 // inherit javadocs
 public virtual short[] GetShorts(IndexReader reader, System.String field, ShortParser parser)
 {
     return (short[]) ((Cache) caches[System.Type.GetType("System.Int16")]).Get(reader, new Entry(field, parser));
 }
コード例 #15
0
 // inherit javadocs
 public virtual short[] GetShorts(IndexReader reader, System.String field, ShortParser parser, IState state)
 {
     return((short[])caches[typeof(short)].Get(reader, new Entry(field, parser), state));
 }
コード例 #16
0
			internal ShortComparator(int numHits, System.String field, Lucene.Net.Search.Parser parser)
			{
				values = new short[numHits];
				this.field = field;
				this.parser = (ShortParser) parser;
			}
コード例 #17
0
 public static Either <TLeft, short> ParseToShort <TLeft>(this string source, TLeft left)
 {
     return(ShortParser.Parse(source, left));
 }
コード例 #18
0
 // inherit javadocs
 public virtual short[] GetShorts(IndexReader reader, System.String field, ShortParser parser, IState state)
 {
     return(_shortCache.Get(reader, new Entry(field, parser), state));
 }
コード例 #19
0
ファイル: FieldCache.cs プロジェクト: Mpdreamz/lucene.net
		static FieldCache_Fields()
		{
			DEFAULT = new FieldCacheImpl();
			DEFAULT_BYTE_PARSER = new AnonymousClassByteParser();
			DEFAULT_SHORT_PARSER = new AnonymousClassShortParser();
			DEFAULT_INT_PARSER = new AnonymousClassIntParser();
			DEFAULT_FLOAT_PARSER = new AnonymousClassFloatParser();
			DEFAULT_LONG_PARSER = new AnonymousClassLongParser();
			DEFAULT_DOUBLE_PARSER = new AnonymousClassDoubleParser();
			NUMERIC_UTILS_INT_PARSER = new AnonymousClassIntParser1();
			NUMERIC_UTILS_FLOAT_PARSER = new AnonymousClassFloatParser1();
			NUMERIC_UTILS_LONG_PARSER = new AnonymousClassLongParser1();
			NUMERIC_UTILS_DOUBLE_PARSER = new AnonymousClassDoubleParser1();
		}
コード例 #20
0
 // inherit javadocs
 public virtual short[] GetShorts(IndexReader reader, string field, ShortParser parser)
 {
     return((short[])caches[typeof(short)].Get(reader, new Entry(field, parser)));
 }
コード例 #21
0
ファイル: FieldCacheImpl.cs プロジェクト: philiphoy/ravendb
 // inherit javadocs
 public virtual short[] GetShorts(IndexReader reader, System.String field, ShortParser parser)
 {
     return((short[])((Cache)caches[System.Type.GetType("System.Int16")]).Get(reader, new Entry(field, parser)));
 }
コード例 #22
0
 public static Maybe <short> ParseToShort(this string source, NumberStyles style)
 {
     return(ShortParser.Parse(source, style));
 }
コード例 #23
0
ファイル: FieldCacheImpl.cs プロジェクト: Nangal/lucene.net
 // inherit javadocs
 public virtual short[] GetShorts(IndexReader reader, System.String field, ShortParser parser)
 {
     return (short[]) caches[typeof(short)].Get(reader, new Entry(field, parser));
 }
コード例 #24
0
 public static Maybe <short> ParseToShort(this string source, NumberStyles style, IFormatProvider provider)
 {
     return(ShortParser.Parse(source, style, provider));
 }