cz.cuni.amis.pogamut.sposh.elements
Class LapPath

Package class diagram package LapPath
java.lang.Object
  extended by cz.cuni.amis.pogamut.sposh.elements.LapPath

public final class LapPath
extends Object

LapPath is used to describe path from the root of PoshPlan to some subnode of the plan. The path consists from several links, each link describes which cild of current node should be used to change into new current node. There are three major features we require: 1. Parse path from string 2. traverse plan according to the path and return the node. 3. serialize path to the string Examples of serialized path: /P:0/DC:0 - default plan, drive collection 0 /P:0/DC:0/S:1 - Drive collection 0, goal sense 1 /P:0/DC:0/DE:4 - fifth drive in the DC /P:0/DC:0/DE:4/S:0 - first trigger sense of fifth drive in the DC /P:0/DC:0/DE:4/A:0/AP:4 - reference to AP node.

Author:
Honza

Method Summary
 LapPath append(LapType type, int id)
          Create and return new LapPath by appending new link to all links of current path.
 boolean equals(Object obj)
           
 int hashCode()
           
static LapPath parse(String serializedPath)
          Parse @serializedPath to
 String toString()
           
 PoshElement traversePath(PoshPlan plan)
          Methods with name traverseXYZ mean traverse from XYZ below xyzLink means gor from xyz below according to type and id.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

traversePath

public PoshElement traversePath(PoshPlan plan)
Methods with name traverseXYZ mean traverse from XYZ below xyzLink means gor from xyz below according to type and id.

Parameters:
plan -
Returns:
Found node
Throws:
IllegalStateException - If path does not play nice with tree, e.g. when paths wants sense subnode in AP, but there is none according to syntax
IndexOutOfBoundsException - If some id on the path references to nonexistent node.

parse

public static LapPath parse(String serializedPath)
                     throws ParseException
Parse @serializedPath to

Parameters:
serializedPath - LapPath in serialized form, e.g. /P:0/DC:0/DE:1/S:1
Returns:
Path object created according to @serializedPath
Throws:
ParseException

append

public LapPath append(LapType type,
                      int id)
Create and return new LapPath by appending new link to all links of current path. This method does not change this path (LapPath is immutable)/


toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.