You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2017/06/22 05:25:11 UTC
[10/38] lucenenet git commit: API: Lucene.Net.Util (PagedBytes +
PagedBytes.PagedBytesDataInput + PagedBytes.PagedBytesDataOutput): Changed
Pointer > GetPointer(), Position > GetPosition()
API: Lucene.Net.Util (PagedBytes + PagedBytes.PagedBytesDataInput + PagedBytes.PagedBytesDataOutput): Changed Pointer > GetPointer(), Position > GetPosition()
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/f4dfbb86
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/f4dfbb86
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/f4dfbb86
Branch: refs/heads/master
Commit: f4dfbb86754637fe4ebee069c983de7c94ee3ecd
Parents: 8a19d27
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Sat Jun 17 13:42:28 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Sat Jun 17 13:42:28 2017 +0700
----------------------------------------------------------------------
.../BlockTerms/FixedGapTermsIndexReader.cs | 2 +-
.../Codecs/Lucene3x/TermInfosReaderIndex.cs | 2 +-
src/Lucene.Net/Util/PagedBytes.cs | 37 ++++++++------------
3 files changed, 16 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f4dfbb86/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
index 1265661..1891d3b 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
@@ -327,7 +327,7 @@ namespace Lucene.Net.Codecs.BlockTerms
int numIndexTerms)
{
this.termsStart = termsStart;
- termBytesStart = outerInstance.outerInstance.termBytes.Pointer;
+ termBytesStart = outerInstance.outerInstance.termBytes.GetPointer();
IndexInput clone = (IndexInput)outerInstance.outerInstance.input.Clone();
clone.Seek(indexStart);
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f4dfbb86/src/Lucene.Net/Codecs/Lucene3x/TermInfosReaderIndex.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/Lucene3x/TermInfosReaderIndex.cs b/src/Lucene.Net/Codecs/Lucene3x/TermInfosReaderIndex.cs
index eb8c2c5..8715d6e 100644
--- a/src/Lucene.Net/Codecs/Lucene3x/TermInfosReaderIndex.cs
+++ b/src/Lucene.Net/Codecs/Lucene3x/TermInfosReaderIndex.cs
@@ -87,7 +87,7 @@ namespace Lucene.Net.Codecs.Lucene3x
fieldCounter++;
}
TermInfo termInfo = indexEnum.TermInfo();
- indexToTerms.Set(i, dataOutput.Position);
+ indexToTerms.Set(i, dataOutput.GetPosition());
dataOutput.WriteVInt32(fieldCounter);
dataOutput.WriteString(term.Text());
dataOutput.WriteVInt32(termInfo.DocFreq);
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f4dfbb86/src/Lucene.Net/Util/PagedBytes.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Util/PagedBytes.cs b/src/Lucene.Net/Util/PagedBytes.cs
index 4a6e4bd..ad5fea3 100644
--- a/src/Lucene.Net/Util/PagedBytes.cs
+++ b/src/Lucene.Net/Util/PagedBytes.cs
@@ -262,18 +262,15 @@ namespace Lucene.Net.Util
return new PagedBytes.Reader(this);
}
- public long Pointer // LUCENENET TODO: API - Change to GetPointer() (makes conversion)
+ public long GetPointer()
{
- get
+ if (currentBlock == null)
{
- if (currentBlock == null)
- {
- return 0;
- }
- else
- {
- return (blocks.Count * ((long)blockSize)) + upto;
- }
+ return 0;
+ }
+ else
+ {
+ return (blocks.Count * ((long)blockSize)) + upto;
}
}
@@ -311,7 +308,7 @@ namespace Lucene.Net.Util
upto = 0;
}
- long pointer = Pointer;
+ long pointer = GetPointer();
if (bytes.Length < 128)
{
@@ -345,22 +342,19 @@ namespace Lucene.Net.Util
public override object Clone()
{
PagedBytesDataInput clone = outerInstance.GetDataInput();
- clone.SetPosition(Position);
+ clone.SetPosition(GetPosition());
return clone;
}
/// <summary>
/// Returns the current byte position. </summary>
- public long Position // LUCENENET TODO: API - Change to GetPosition() (makes conversion)
+ public long GetPosition()
{
- get
- {
- return (long)currentBlockIndex * outerInstance.blockSize + currentBlockUpto;
- }
+ return (long)currentBlockIndex * outerInstance.blockSize + currentBlockUpto;
}
/// <summary>
- /// Seek to a position previously obtained from <see cref="Position"/>.
+ /// Seek to a position previously obtained from <see cref="GetPosition()"/>.
/// </summary>
/// <param name="position"></param>
public void SetPosition(long position)
@@ -480,12 +474,9 @@ namespace Lucene.Net.Util
/// <summary>
/// Return the current byte position. </summary>
- public long Position // LUCENENET TODO: API - Change to GetPosition() (makes conversion)
+ public long GetPosition()
{
- get
- {
- return outerInstance.Pointer;
- }
+ return outerInstance.GetPointer();
}
}