// ---------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------
//
//
// ---------------------------------------------------------------------
namespace Microsoft.Database.Isam
{
///
/// A key is composed of a collection of key segments. Each key segment
/// describes the value of a corresponding key column in an index.
///
public class KeySegment
{
///
/// The value
///
private readonly object value;
///
/// The prefix
///
private readonly bool prefix;
///
/// The wildcard
///
private readonly bool wildcard;
///
/// Whether the next is a wildcard.
///
private readonly bool wildcardNext;
///
/// Initializes a new instance of the class.
///
/// The value.
/// if set to true [prefix].
/// if set to true [wildcard].
/// if set to true [wildcard next].
internal KeySegment(object value, bool prefix, bool wildcard, bool wildcardNext)
{
this.value = value;
this.prefix = prefix;
this.wildcard = wildcard;
this.wildcardNext = wildcardNext;
}
///
/// Gets the value of this key segment.
///
///
/// The value.
///
public object Value
{
get
{
return this.value;
}
}
///
/// Gets a value indicating whether the value of
/// this key segment can match any value of a corresponding key column
/// in an index that starts with its value.
///
public bool Prefix
{
get
{
return this.prefix;
}
}
///
/// Gets a value indicating whether the value of
/// this key segment can match any value of a corresponding key column
/// in an index.
///
public bool Wildcard
{
get
{
return this.wildcard;
}
}
///
/// Gets whether the next is a wildcard.
///
///
/// Whether the next is a wildcard.
///
internal bool WildcardIsNext()
{
return this.wildcardNext;
}
}
}