Class FlyweightFactory
java.lang.Object
Structural.Flyweight.FlyweightFactory
Factory for creating and managing Flyweight objects.
Ensures that shared Flyweight objects are reused rather than created multiple times.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFlyweight(String intrinsicState) Retrieves a Flyweight object with the given intrinsic state.voidDisplays the current Flyweights managed by the factory.
-
Constructor Details
-
FlyweightFactory
public FlyweightFactory()Default constructor for FlyweightFactory.
-
-
Method Details
-
getFlyweight
-
listFlyweights
public void listFlyweights()Displays the current Flyweights managed by the factory.
-