Class AbstractPath<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- org.dreambot.api.methods.walking.path.AbstractPath<E>
-
- All Implemented Interfaces:
java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.List<E>
- Direct Known Subclasses:
GlobalPath
,LocalPath
public abstract class AbstractPath<E> extends java.util.AbstractList<E>
Created with IntelliJ IDEA.- Since:
- : 1/22/2015 Time : 12:47 AM
-
-
Constructor Summary
Constructors Constructor Description AbstractPath()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
add(E e)
boolean
addAll(E... e)
boolean
addAll(java.util.Collection<? extends E> c)
void
addToFront(E e)
void
clear()
PathDirection
direction()
Gets the PathDirectionE
first()
E
get(int index)
PathObstacle
getObstacleForTile(E tile)
Gets a PathObstacle for a given tileint
indexOf(java.lang.Object o)
boolean
isObstacleTile(E tile)
Checks if the tile has an obstacle on itjava.util.Iterator<E>
iterator()
E
last()
java.util.ListIterator<E>
listIterator()
abstract E
next()
Gets the next node in the pathjava.util.Map<E,PathObstacle>
obstacles()
Gets a Map of the obstacles for the pathjava.util.List<E>
path()
Gets the pathboolean
remove(java.lang.Object o)
void
reverse()
Reverses the pathvoid
setDirection(PathDirection direction)
Sets the PathDirectionint
size()
abstract boolean
walk()
Walks the next point in the path-
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, lastIndexOf, listIterator, remove, set, subList
-
-
-
-
Method Detail
-
iterator
public java.util.Iterator<E> iterator()
-
listIterator
public java.util.ListIterator<E> listIterator()
-
indexOf
public int indexOf(java.lang.Object o)
-
clear
public void clear()
-
first
public E first()
-
last
public E last()
-
addToFront
public void addToFront(E e)
-
add
public boolean add(E e)
-
get
public E get(int index)
-
path
public java.util.List<E> path()
Gets the path- Returns:
- List of E
-
remove
public boolean remove(java.lang.Object o)
-
size
public int size()
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
-
addAll
@SafeVarargs public final boolean addAll(E... e)
-
direction
public PathDirection direction()
Gets the PathDirection- Returns:
- PathDirection
-
setDirection
public void setDirection(PathDirection direction)
Sets the PathDirection- Parameters:
direction
- PathDirection
-
obstacles
public java.util.Map<E,PathObstacle> obstacles()
Gets a Map of the obstacles for the path- Returns:
- Map with key E and value PathObstacle
-
isObstacleTile
public boolean isObstacleTile(E tile)
Checks if the tile has an obstacle on it- Parameters:
tile
- Tile to check- Returns:
- True if it has an obstacle, else false
-
getObstacleForTile
public PathObstacle getObstacleForTile(E tile)
Gets a PathObstacle for a given tile- Parameters:
tile
- Tile to get obstacle on- Returns:
- PathObstacle or null
-
reverse
public void reverse()
Reverses the path
-
walk
public abstract boolean walk()
Walks the next point in the path- Returns:
- True if walked, else false
-
next
public abstract E next()
Gets the next node in the path- Returns:
- E
-
-