Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
CharVector.cs
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 //using System;
19 
20 //namespace Lucene.Net.Analysis.Compound.Hyphenation
21 //{
22 
23 // /// <summary>
24 // /// This class implements a simple char vector with access to the underlying
25 // /// array.
26 // ///
27 // /// This class has been taken from the Apache FOP project (http://xmlgraphics.apache.org/fop/). They have been slightly modified.
28 // ///</summary>
29 
30 // [Serializable]
31 // public class CharVector : ICloneable
32 // {
33 
34 // ///<summary>
35 // /// Capacity increment size
36 // ///</summary>
37 // private static readonly int DEFAULT_BLOCK_SIZE = 2048;
38 
39 // private int blockSize;
40 
41 // ///<summary>
42 // /// The encapsulated array
43 // ///</summary>
44 // private char[] array;
45 
46 // /// <summary>
47 // /// Points to next free item
48 // /// </summary>
49 // private int n;
50 
51 // public CharVector()
52 // : this(DEFAULT_BLOCK_SIZE)
53 // {
54 
55 // }
56 
57 // public CharVector(int capacity)
58 // {
59 // if (capacity > 0)
60 // {
61 // blockSize = capacity;
62 // }
63 // else
64 // {
65 // blockSize = DEFAULT_BLOCK_SIZE;
66 // }
67 // array = new char[blockSize];
68 // n = 0;
69 // }
70 
71 // public CharVector(char[] a)
72 // {
73 // blockSize = DEFAULT_BLOCK_SIZE;
74 // array = a;
75 // n = a.Length;
76 // }
77 
78 // public CharVector(char[] a, int capacity)
79 // {
80 // if (capacity > 0)
81 // {
82 // blockSize = capacity;
83 // }
84 // else
85 // {
86 // blockSize = DEFAULT_BLOCK_SIZE;
87 // }
88 // array = a;
89 // n = a.Length;
90 // }
91 
92 // ///<summary>
93 // /// Reset Vector but don't resize or clear elements
94 // ///</summary>
95 // public void Clear()
96 // {
97 // n = 0;
98 // }
99 
100 // public Object Clone()
101 // {
102 // CharVector cv = new CharVector((char[]) array.Clone(), blockSize);
103 // cv.n = this.n;
104 // return cv;
105 // }
106 
107 // public char[] GetArray()
108 // {
109 // return array;
110 // }
111 
112 // ///<summary>
113 // /// return number of items in array
114 // ///</summary>
115 // public int Length()
116 // {
117 // return n;
118 // }
119 
120 // ///<summary>
121 // /// returns current capacity of array
122 // ///</summary>
123 // public int Capacity()
124 // {
125 // return array.Length;
126 // }
127 
128 // public void Put(int index, char val)
129 // {
130 // array[index] = val;
131 // }
132 
133 // public char Get(int index)
134 // {
135 // return array[index];
136 // }
137 
138 // public int Alloc(int size)
139 // {
140 // int index = n;
141 // int len = array.Length;
142 // if (n + size >= len)
143 // {
144 // char[] aux = new char[len + blockSize];
145 // Array.Copy(array, 0, aux, 0, len);
146 // array = aux;
147 // }
148 // n += size;
149 // return index;
150 // }
151 
152 // public void TrimToSize()
153 // {
154 // if (n < array.Length)
155 // {
156 // char[] aux = new char[n];
157 // Array.Copy(array, 0, aux, 0, n);
158 // array = aux;
159 // }
160 // }
161 // }
162 //}