dynamically attached to an object in our dfs examplewe would like to have "decorablevertices and edges with an explored decoration and boolean value making graph vertices decorable we can realize the decorator pattern for any position by allowing it to be decorated this allows us to add labels to vertices and edgesfor examplewithout requiring that we know in advance the kinds of labels that we will need we can simply require that our vertices and edges implement decorable position adtwhich inherits from both the position adt and the map adt (section namelythe methods of the decorable position adt are the union of the methods of the position adt and of the map adtthat isin addition to the size(and isempty(methodsa decorable position would support the followingelement()return the element stored at this position put( , )map the decoration value to the key kreturning the old value for kor null if this is new value for get( )get the decoration value assigned to kor null if there is no mapping for remove( )remove the decoration mapping for kreturning the old valueor null if there is none entries()return all the key-decoration pairs for this position the map methods of decorable position provide simple mechanism for accessing and setting the decorations of for examplewe use get(kto obtain the value of the decoration with key and we use put( ,xto set the value of the decoration with key to moreoverthe key can be any objectincluding special explored object our dfs algorithm might create we show java interface defining such an adt in code fragment we can implement decorable position with an object that stores an element and map in principlethe running times of the methods of decorable position