/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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. */ parcel Lucy; /** Abstract base class for numbers. */ abstract class Lucy::Object::Num inherits Lucy::Object::Obj { inert Num* init(Num *self); public bool_t Equals(Num *self, Obj *other); public int32_t Compare_To(Num *self, Obj *other); } /** Abstract base class for floating point numbers. */ abstract class Lucy::Object::FloatNum inherits Lucy::Object::Num { inert FloatNum* init(FloatNum *self); public incremented CharBuf* To_String(FloatNum *self); } /** Abstract base class for Integers. */ abstract class Lucy::Object::IntNum inherits Lucy::Object::Num { inert IntNum* init(IntNum *self); public incremented CharBuf* To_String(IntNum *self); } /** Single precision floating point number. */ class Lucy::Object::Float32 inherits Lucy::Object::FloatNum { float value; /** * @param value Initial value. */ inert Float32* init(Float32* self, float value); inert Float32* new(float value); void Set_Value(Float32 *self, float value); float Get_Value(Float32 *self); public int64_t To_I64(Float32 *self); public double To_F64(Float32 *self); public int32_t Hash_Sum(Float32 *self); public void Serialize(Float32 *self, OutStream *outstream); public incremented Float32* Deserialize(Float32 *self, InStream *instream); public incremented Float32* Clone(Float32 *self); public void Mimic(Float32 *self, Obj *other); } /** Double precision floating point number. */ class Lucy::Object::Float64 inherits Lucy::Object::FloatNum { double value; /** * @param value Initial value. */ inert Float64* init(Float64* self, double value); inert Float64* new(double value); void Set_Value(Float64 *self, double value); double Get_Value(Float64 *self); public int64_t To_I64(Float64 *self); public double To_F64(Float64 *self); public int32_t Hash_Sum(Float64 *self); public void Serialize(Float64 *self, OutStream *outstream); public incremented Float64* Deserialize(Float64 *self, InStream *instream); public incremented Float64* Clone(Float64 *self); public void Mimic(Float64 *self, Obj *other); } /** 32-bit signed integer. */ class Lucy::Object::Integer32 cnick Int32 inherits Lucy::Object::IntNum { int32_t value; /** * @param value Initial value. */ inert Integer32* init(Integer32* self, int32_t value); inert Integer32* new(int32_t value); void Set_Value(Integer32 *self, int32_t value); int32_t Get_Value(Integer32 *self); public int64_t To_I64(Integer32 *self); public double To_F64(Integer32 *self); public int32_t Hash_Sum(Integer32 *self); public void Serialize(Integer32 *self, OutStream *outstream); public incremented Integer32* Deserialize(Integer32 *self, InStream *instream); public incremented Integer32* Clone(Integer32 *self); public void Mimic(Integer32 *self, Obj *other); } /** * 64-bit signed integer. */ class Lucy::Object::Integer64 cnick Int64 inherits Lucy::Object::IntNum { int64_t value; /** * @param value Initial value. */ inert Integer64* init(Integer64* self, int64_t value); inert Integer64* new(int64_t value); void Set_Value(Integer64 *self, int64_t value); int64_t Get_Value(Integer64 *self); public int64_t To_I64(Integer64 *self); public double To_F64(Integer64 *self); public int32_t Hash_Sum(Integer64 *self); public bool_t Equals(Integer64 *self, Obj *other); public void Serialize(Integer64 *self, OutStream *outstream); public incremented Integer64* Deserialize(Integer64 *self, InStream *instream); public incremented Integer64* Clone(Integer64 *self); public void Mimic(Integer64 *self, Obj *other); }