factory

package
v0.0.0-...-21f966a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbsFactory

type AbsFactory struct {
}

func (*AbsFactory) GetColor

func (factory *AbsFactory) GetColor(t colorType) Color

func (*AbsFactory) GetShape

func (factory *AbsFactory) GetShape(t shapeType) Shape

type AbstractFactory

type AbstractFactory interface {
	GetShape(t shapeType) Shape
	GetColor(t colorType) Color
}

type Blue

type Blue struct {
}

func (*Blue) Fill

func (c *Blue) Fill()

type Circle

type Circle struct {
	// contains filtered or unexported fields
}

func (*Circle) Area

func (s *Circle) Area() float64

func (*Circle) SetRadius

func (s *Circle) SetRadius(radius float64)

type Color

type Color interface {
	Fill()
}

type Factory

type Factory struct {
}

func (*Factory) GetShape

func (factory *Factory) GetShape(t shapeType) Shape

type Green

type Green struct {
}

func (*Green) Fill

func (c *Green) Fill()

type Rectangle

type Rectangle struct {
	// contains filtered or unexported fields
}

func (*Rectangle) Area

func (s *Rectangle) Area() float64

type Shape

type Shape interface {
	Area() float64
}

type Square

type Square struct {
	// contains filtered or unexported fields
}

func (*Square) Area

func (s *Square) Area() float64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL