adapter

package
v0.0.0-...-54da96c Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CircleAdapter

type CircleAdapter struct {
	LegacyCircle *LegacyCircle
}

CircleAdapter 是適配器,將 LegacyCircle 的接口轉換為 Shape 接口

func (*CircleAdapter) Draw

func (ca *CircleAdapter) Draw() string

type LegacyCircle

type LegacyCircle struct{}

LegacyCircle 是舊版的圓形類,具有不兼容的新方法

func (*LegacyCircle) OldDraw

func (lc *LegacyCircle) OldDraw() string

type Shape

type Shape interface {
	Draw() string
}

Shape 定義形狀的接口

Jump to

Keyboard shortcuts

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