Class Location


  • public class Location
    extends java.lang.Object
    Author:
    Simon Thoresen Hult
    • Constructor Summary

      Constructors 
      Constructor Description
      Location()
      Constructs a new location with no items.
      Location​(Location loc)
      Constructs a new location as a copy of another.
      Location​(Location pwd, java.util.List<java.lang.String> items)
      Constructs a new location based on a working directory and a list of items.
      Location​(java.lang.String loc)
      Constructs a new location based on a location string.
      Location​(java.util.List<java.lang.String> items)
      Constructs a new location based on a list of items.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> getItems()
      Returns the components of this location.
      Location getNext()
      Returns a location object that represents the "next" step along this location path.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Location

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

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

        public Location​(java.util.List<java.lang.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,
                        java.util.List<java.lang.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 java.util.List<java.lang.String> getItems()
        Returns the components of this location.
        Returns:
        The component array.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object