php.java.bridge
Class PhpMap

java.lang.Object
  extended by php.java.bridge.PhpMap

public abstract class PhpMap
extends java.lang.Object

Maps php iterator to java iterator.

Author:
jostb

Method Summary
abstract  java.lang.Object currentData()
          Returns the object at the current position.
abstract  java.lang.Object currentKey()
          Returns the key at the current position.
static PhpMap getPhpMap(java.lang.Object value, JavaBridge bridge)
          Returns a PhpMap for a given value.
 boolean getType()
          Returns the key type.
abstract  boolean hasMore()
          Checks if it is possible to advance one element
abstract  boolean moveForward()
          Forward one element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

currentData

public abstract java.lang.Object currentData()
Returns the object at the current position.

Returns:
The current object.

currentKey

public abstract java.lang.Object currentKey()
Returns the key at the current position.

Returns:
The current key, either a string or a number.

moveForward

public abstract boolean moveForward()
Forward one element.

Returns:
true if move was possible, false otherwise.

hasMore

public abstract boolean hasMore()
Checks if it is possible to advance one element

Returns:
true if next element exists, false otherwise

getType

public boolean getType()
Returns the key type.

Returns:
false if key is integer (array index), true if key is string (hash key)

getPhpMap

public static PhpMap getPhpMap(java.lang.Object value,
                               JavaBridge bridge)
Returns a PhpMap for a given value.

Parameters:
value - The value, must be an array or implement Map or Collection
bridge - The bridge instance
Returns:
The PhpMap