/*
* Copyright 2009 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
namespace ZXing.OneD.RSS
{
///
///
///
public class DataCharacter
{
///
/// Gets the value.
///
public int Value { get; private set; }
///
/// Gets the checksum portion.
///
public int ChecksumPortion { get; private set; }
///
/// Initializes a new instance of the class.
///
/// The value.
/// The checksum portion.
public DataCharacter(int value, int checksumPortion)
{
Value = value;
ChecksumPortion = checksumPortion;
}
///
/// Returns a that represents this instance.
///
///
/// A that represents this instance.
///
override public String ToString()
{
return Value + "(" + ChecksumPortion + ')';
}
///
/// Determines whether the specified is equal to this instance.
///
/// The to compare with this instance.
///
/// true if the specified is equal to this instance; otherwise, false.
///
override public bool Equals(Object o)
{
if (!(o is DataCharacter))
{
return false;
}
DataCharacter that = (DataCharacter)o;
return Value == that.Value && ChecksumPortion == that.ChecksumPortion;
}
///
/// Returns a hash code for this instance.
///
///
/// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
///
override public int GetHashCode()
{
return Value ^ ChecksumPortion;
}
}
}