org.af.jhlir.call
Interface RList<WRAPPED_TYPE>

Type Parameters:
WRAPPED_TYPE - underlying type of the used back-end, @see RObj
All Superinterfaces:
RObj<WRAPPED_TYPE>
All Known Subinterfaces:
RListRef<WRAPPED_REF,RESOLVED_TYPE>

public interface RList<WRAPPED_TYPE>
extends RObj<WRAPPED_TYPE>

Interface for a RList Object that extends RObj.


Method Summary
 RObj get(int i)
          Returns the element at the specified position in this list.
 RObj get(String name)
          Returns the element at the first position which has the given name in this list or null if no such name exists
 int getLength()
          Returns the number of elements in this list.
 String getName(int i)
          Returns the name at the specified position of this list.
 String[] getNames()
          If no name is set null is returned.
 List<String> getNamesAsList()
          If no name is set null is returned.
 boolean hasNames()
          List can either be named or unnamed.
 
Methods inherited from interface org.af.jhlir.call.RObj
asRChar, asRDataFrame, asREnvironment, asRFactor, asRInteger, asRList, asRLogical, asRMatrixDouble, asRNumeric, asS3Obj, getWrapped
 

Method Detail

getLength

int getLength()
Returns the number of elements in this list.

Returns:
the number of elements in this list

get

RObj get(int i)
Returns the element at the specified position in this list.

Parameters:
i - index of the element to return
Returns:
the element at the specified position in this list
Throws:
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getLength())

get

RObj get(String name)
Returns the element at the first position which has the given name in this list or null if no such name exists

Parameters:
name - name of the element to return
Returns:
first element of the specified name in this list or null

hasNames

boolean hasNames()
List can either be named or unnamed. The first case implies that there is always a name for each position of the list (possibly ""), while the latter case means that no names attribute exists at all.

Returns:
true iff the positions of the list are named

getName

String getName(int i)
Returns the name at the specified position of this list.

Parameters:
i - index of the position
Returns:
the name of the specified position of this list
Throws:
NullPointerException - if hasNames() is false

getNames

String[] getNames()
If no name is set null is returned. Otherwise returns a String Array of length equal to getLength() that contains the names of the positions in this list.

Returns:
the names of this list

getNamesAsList

List<String> getNamesAsList()
If no name is set null is returned. Returns a List of Strings of size equal to getLength() that contains the names of the positions in this list.

Returns:
the names of this list