Versions in this module Expand all Collapse all v1 v1.0.0 Mar 25, 2019 Changes in this version + const NO_CHAR + const UCUM_OID + func ComposeExpression(item interface{}, canonicalValue bool) string + func ComposeFormalStructure(term *Term) string + func IsAsciiChar(ch rune) bool + func IsDecimal(value string) bool + func IsInteger(value string) bool + func MaxInt(a, b int) int + func MinInt(a, b int) int + func PadLeft(src string, c rune, l int) string + type BaseUnit struct + Dim rune + func NewBaseUnit(code string, codeUC string) (*BaseUnit, error) + type ByCode []*CanonicalUnit + func (a ByCode) Len() int + func (a ByCode) Less(i, j int) bool + func (a ByCode) Swap(i, j int) + type Canonical struct + Units []*CanonicalUnit + Value decimal.Decimal + func NewCanonical(value decimal.Decimal) (*Canonical, error) + func (c *Canonical) DivideValueDecimal(divisor decimal.Decimal) + func (c *Canonical) DivideValueInt(divisor int) + func (c *Canonical) MultiplyValueDecimal(multiplicand decimal.Decimal) + func (c *Canonical) MultiplyValueInt(multiplicand int) + func (c *Canonical) RemoveFromUnits(i int) + func (c *Canonical) SortUnits() + type CanonicalUnit struct + Base *BaseUnit + Exponent int + func NewCanonicalUnit(base *BaseUnit, exponent int) (*CanonicalUnit, error) + type CelsiusHandler struct + func (c *CelsiusHandler) GetCode() string + func (c *CelsiusHandler) GetUnits() string + func (c *CelsiusHandler) GetValue() decimal.Decimal + type Component struct + type Componenter interface + type Concept struct + Code string + CodeUC string + Kind ConceptKind + Names []string + PrintSymbol string + func NewConcept(kind ConceptKind, code string, codeUC string) (*Concept, error) + func (c Concept) GetCode() string + func (c Concept) GetCodeUC() string + func (c Concept) GetDescription() string + func (c Concept) GetKind() ConceptKind + func (c Concept) GetNames() []string + func (c Concept) GetPrintSymbol() string + func (c Concept) String() string + type ConceptKind int + const BASEUNIT + const PREFIX + const UNIT + func ConceptKindString(s string) (ConceptKind, error) + func ConceptKindValues() []ConceptKind + func (i ConceptKind) IsAConceptKind() bool + func (i ConceptKind) String() string + type Concepter interface + GetCode func() string + GetCodeUC func() string + GetDescription func() string + GetKind func() ConceptKind + GetNames func() []string + GetPrintSymbol func() string + String func() string + type Converter struct + Handlers *Registry + Model *UcumModel + func NewConverter(model *UcumModel, handlers *Registry) *Converter + func (c *Converter) Convert(term *Term) (*Canonical, error) + type DefinedUnit struct + Class string + IsArbitrary bool + IsSpecial bool + Metric bool + Value *Value + func NewDefinedUnit(code string, codeUC string) (*DefinedUnit, error) + func (d DefinedUnit) GetDescription() string + type DefinedUnitFilter struct + DefinedUnits []*DefinedUnit + func NewDefinedUnitFilter(definedUnits []*DefinedUnit) *DefinedUnitFilter + func (duf *DefinedUnitFilter) FilterByClass(class string) *DefinedUnitFilter + func (duf *DefinedUnitFilter) FilterByIsArbitrary(isArbitrary bool) *DefinedUnitFilter + func (duf *DefinedUnitFilter) FilterByIsMetric(isMetric bool) *DefinedUnitFilter + func (duf *DefinedUnitFilter) FilterByIsSpecial(isSpecial bool) *DefinedUnitFilter + func (duf *DefinedUnitFilter) FilterByProperty(property string) *DefinedUnitFilter + type DefinitionParser struct + func (d *DefinitionParser) UnmarshalTerminology(reader io.Reader) (*UcumModel, error) + func (d *DefinitionParser) UnmarshalTerminologyWithCharsetReader(reader io.Reader, ...) (*UcumModel, error) + type ExpressionComposer struct + type ExpressionParser struct + Model *UcumModel + func NewExpressionParser(model *UcumModel) *ExpressionParser + func (p *ExpressionParser) Parse(code string) (*Term, error) + type Factor struct + Value int + func NewFactor(value int) *Factor + type FahrenheitHandler struct + func (c *FahrenheitHandler) GetCode() string + func (c *FahrenheitHandler) GetUnits() string + func (c *FahrenheitHandler) GetValue() decimal.Decimal + type FormalStructureComposer struct + type HoldingHandler struct + Code string + Units string + Value decimal.Decimal + func NewHoldingHandler(code, units string, value decimal.Decimal) *HoldingHandler + func (c *HoldingHandler) GetCode() string + func (c *HoldingHandler) GetUnits() string + func (c *HoldingHandler) GetValue() decimal.Decimal + type Lexer struct + Index int + Source string + Start int + Token string + TokenType TokenType + func NewLexer(source string) *Lexer + func (l *Lexer) Consume() error + func (l *Lexer) Finished() bool + func (l *Lexer) TokenAsInt() (int, error) + type Operator int + const DIVISION + const MULTIPLICATION + func OperatorString(s string) (Operator, error) + func (i Operator) String() string + type Pair struct + Code string + Value decimal.Decimal + func NewPair(value decimal.Decimal, code string) *Pair + type Prefix struct + Value decimal.Decimal + func NewPrefix(code string, codeUC string) (*Prefix, error) + func (p Prefix) GetDescription() string + type Registry struct + func NewRegistry() *Registry + func (r *Registry) Exists(code string) bool + func (r *Registry) Get(code string) SpecialUnitHandlerer + type SpecialUnitHandlerer interface + GetCode func() string + GetUnits func() string + GetValue func() decimal.Decimal + type Symbol struct + Exponent int + Prefix *Prefix + Unit Uniter + func NewSymbol(unit Uniter, prefix *Prefix, exponent int) (*Symbol, error) + func (s *Symbol) HasPrefix() bool + func (s *Symbol) InvertExponent() + type Term struct + Comp Componenter + Op Operator + Term *Term + func NewTerm() (*Term, error) + func (t *Term) SetTermCheckOp(term *Term) + type TokenType int + const ANNOTATION + const CLOSE + const NONE + const NUMBER + const OPEN + const PERIOD + const SOLIDUS + const SYMBOL + func TokenTypeString(s string) (TokenType, error) + func (i TokenType) String() string + type UcumClassInfo struct + Description string + Name string + type UcumEssenceService struct + Handlers *Registry + Model *UcumModel + func GetInstanceOfUcumEssenceService(xmlFileName string) (*UcumEssenceService, error) + func GetInstanceOfUcumEssenceServiceWithCharsetReader(xmlFileName string, ...) (*UcumEssenceService, error) + func (u *UcumEssenceService) Analyse(unit string) (string, error) + func (u *UcumEssenceService) Convert(value decimal.Decimal, sourceUnit, destUnit string) (decimal.Decimal, error) + func (u *UcumEssenceService) FilterDefinedModels(class string, property string, onIsMetric, isMetric bool, ...) []*DefinedUnit + func (u *UcumEssenceService) GetCanonicalForm(value *Pair) (*Pair, error) + func (u *UcumEssenceService) GetCanonicalUnits(unit string) (string, error) + func (u *UcumEssenceService) GetClassInfo(class string) *UcumClassInfo + func (u *UcumEssenceService) GetCommonDisplay(code string) string + func (u *UcumEssenceService) GetDefinedForms(code string) ([]*DefinedUnit, error) + func (u *UcumEssenceService) GetProperties() []string + func (u *UcumEssenceService) IsComparable(units1, units2 string) (bool, error) + func (u *UcumEssenceService) ListAllClasses() []string + func (u *UcumEssenceService) ListAllProperties() []string + func (u *UcumEssenceService) Multiply(o1, o2 *Pair) (*Pair, error) + func (u *UcumEssenceService) Search(kind ConceptKind, text string, isRegex bool) ([]Concepter, error) + func (u *UcumEssenceService) SearchClass(arg string) []string + func (u *UcumEssenceService) SearchProperty(arg string) []string + func (u *UcumEssenceService) UcumIdentification() *UcumVersionDetails + func (u *UcumEssenceService) Validate(unit string) (bool, string) + func (u *UcumEssenceService) ValidateCanonicalUnits(unit, canonical string) string + func (u *UcumEssenceService) ValidateInProperty(unit, property string) string + func (u *UcumEssenceService) ValidateUCUM() []string + type UcumModel struct + BaseUnits []*BaseUnit + BaseUnitsByCode map[string]*BaseUnit + BaseUnitsByCodeUC map[string]*BaseUnit + ClassList []string + ClassSearchIndex map[string][]string + DefinedUnits []*DefinedUnit + DefinedUnitsByCode map[string]*DefinedUnit + DefinedUnitsByCodeUC map[string]*DefinedUnit + Prefixes []*Prefix + PropertyList []string + PropertySearchIndex map[string][]string + Revision string + RevisionDate time.Time + UcumClassInfoMap map[string]*UcumClassInfo + Version string + func NewUcumModel(version, revision string, revisionDate time.Time) *UcumModel + func (u *UcumModel) GetUnit(code string) Uniter + func (u *UcumModel) Search(kind ConceptKind, text string, isRegex bool) []Concepter + type UcumService interface + Analyse func(unit string) (string, error) + Convert func(value decimal.Decimal, sourceUnit, destUnit string) (decimal.Decimal, error) + FilterDefinedModels func(class string, property string, onIsMetric, isMetric bool, ...) []*DefinedUnit + GetCanonicalForm func(value *Pair) (*Pair, error) + GetCanonicalUnits func(unit string) (string, error) + GetClassInfo func(class string) *UcumClassInfo + GetCommonDisplay func(code string) string + GetDefinedForms func(code string) ([]*DefinedUnit, error) + GetProperties func() []string + IsComparable func(units1, units2 string) (bool, error) + ListAllClasses func() []string + ListAllProperties func() []string + Multiply func(o1, o2 *Pair) (*Pair, error) + Search func(kind ConceptKind, text string, isRegex bool) ([]Concepter, error) + SearchClass func(arg string) []string + SearchProperty func(arg string) []string + UcumIdentification func() *UcumVersionDetails + Validate func(unit string) (bool, string) + ValidateCanonicalUnits func(unit, canonical string) string + ValidateInProperty func(unit, property string) string + ValidateUCUM func() []string + type UcumValidator struct + Handlers *Registry + Model *UcumModel + Result []string + func NewUcumValidator(model *UcumModel, handlers *Registry) *UcumValidator + func (v *UcumValidator) Validate() []string + type UcumVersionDetails struct + ReleaseDate time.Time + Version string + func NewUcumVersionDetails(releaseDate time.Time, version string) *UcumVersionDetails + type Unit struct + Property string + func NewUnit(kind ConceptKind, code string, codeUC string) (*Unit, error) + func (u *Unit) SetProperty(property string) + func (u Unit) GetDescription() string + func (u Unit) GetProperty() string + func (u Unit) String() string + type Uniter interface + GetProperty func() string + type Value struct + Text string + Unit string + UnitUC string + Value decimal.Decimal + func NewValue(unit, unitUC string, value decimal.Decimal) (*Value, error) + func (v Value) GetDescription() string + type XMLBaseUnit struct + Dim rune + type XMLConcept struct + Code string + CodeUC string + Name string + PrintSymbol string + type XMLDecimal struct + Decimal int + Digits string + Negative bool + Precision int + Scientific bool + type XMLDefinedUnit struct + Class string + IsArbitrary string + IsSpecial string + Metric string + Value XMLValue + type XMLPrefix struct + Value XMLValue + type XMLRoot struct + BaseUnits []XMLBaseUnit + DefinedUnits []XMLDefinedUnit + Prefixes []XMLPrefix + Revision string + RevisionDate string + UcumClassInfos []XMLUcumClassInfo + Version string + func (x *XMLRoot) ProcessRevisionDate(revisionDate string) (time.Time, error) + func (x *XMLRoot) UcumModel() (*UcumModel, error) + type XMLUcumClassInfo struct + Description string + Name string + type XMLUnit struct + Property string + type XMLValue struct + Unit string + UnitUC string + Value string