Class Location


  • public class Location
    extends Object
    Author:
    Simon Thoresen Hult
    • Constructor Detail

      • Location

        public Location()
        Constructs a new location with no items.
      • Location

        public Location​(String loc)
        Constructs a new location based on a location string.
        Parameters:
        loc - The location string to parse.
      • Location

        public Location​(List<String> items)
        Constructs a new location based on a list of items.
        Parameters:
        items - The components that make up this location.
      • Location

        public Location​(Location loc)
        Constructs a new location as a copy of another.
        Parameters:
        loc - The location to copy.
      • Location

        public Location​(Location pwd,
                        List<String> items)
        Constructs a new location based on a working directory and a list of items.
        Parameters:
        pwd - The path of the working directory.
        items - The components that make up this location.
    • Method Detail

      • getNext

        public Location getNext()
        Returns a location object that represents the "next" step along this location path. This means removing the first elements of this location's items and returning a new location for this sublist.
        Returns:
        The next location along this path.
      • getItems

        public List<String> getItems()
        Returns the components of this location.
        Returns:
        The component array.