|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections;
namespace Apolyton.FastJson.Data
{
/// <summary>
/// Represents a json object.
/// </summary>
/// <remarks>
/// For performance reasons, the best is to inherit from dictionary directly. Wrapping is costly.
/// </remarks>
public class JsonObject : Dictionary<String, IJsonValue>, IJsonValue
{
/// <summary>
/// Creates an instance of the json object.
/// </summary>
public JsonObject()
{
}
/// <summary>
/// Returns the json object type.
/// </summary>
public JsonType Type
{
get { return JsonType.JsonObject; }
}
/// <summary>
/// Throws a NotSupportedException
/// </summary>
public IJsonValue this[int i]
{
get { throw new NotSupportedException(); }
}
/// <summary>
/// Throws a NotSupportedException
/// </summary>
public string AsString
{
get { throw new NotSupportedException(); }
}
/// <summary>
/// Throws a NotSupportedException
/// </summary>
public int AsInteger
{
get { throw new NotSupportedException(); }
}
/// <summary>
/// Throws a NotSupportedException
/// </summary>
public double AsDouble
{
get { throw new NotSupportedException(); }
}
/// <summary>
/// Throws a NotSupportedException
/// </summary>
public Guid AsGuid
{
get { throw new NotSupportedException(); }
}
/// <summary>
/// Returns a descriptive string.
/// </summary>
/// <returns></returns>
public override string ToString()
{
return String.Format("JsonObject Count={0}", Count);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.