|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector
org.rosuda.JRclient.RList
public class RList
implementation of R-lists
All lists (dotted-pair lists, language lists, expressions and vectors) are regarded as named generic vectors.
Note: This implementation has changed radically in Rserve 0.5!
This class inofficially implements the Map interface. Unfortunately a conflict in the Java iterface classes Map and List doesn't allow us to implement both officially. Most prominently the Map 'remove' method had to be renamed to removeByKey.
| Field Summary | |
|---|---|
java.util.Vector |
names
|
| Fields inherited from class java.util.Vector |
|---|
capacityIncrement, elementCount, elementData |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
RList()
constructs an empty list |
|
RList(java.util.Collection contents)
|
|
RList(java.util.Collection contents,
java.util.Collection names)
|
|
RList(java.util.Collection contents,
java.lang.String[] names)
|
|
RList(int initSize,
boolean hasNames)
|
|
RList(REXP[] contents)
constructs an initialized list |
|
RList(REXP[] contents,
java.lang.String[] names)
|
|
| Method Summary | |
|---|---|
void |
add(int index,
java.lang.Object element)
|
boolean |
addAll(java.util.Collection c)
|
boolean |
addAll(int index,
java.util.Collection c)
|
void |
addElement(java.lang.Object obj)
|
REXP |
at(int i)
get element at the specified position |
REXP |
at(java.lang.String v)
get xpression given a key |
void |
clear()
|
java.lang.Object |
clone()
|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
java.util.Set |
entrySet()
NOTE: THIS IS UNIMPLEMENTED and always returns null! |
java.lang.Object |
get(java.lang.Object key)
|
void |
insertElementAt(java.lang.Object obj,
int index)
|
boolean |
isNamed()
|
java.lang.String |
keyAt(int i)
|
java.lang.String[] |
keys()
returns all keys of the list |
java.util.Set |
keySet()
Note: sinde RList is not really a Map, the returned set is only an approximation as it cannot reference duplicate or null names that may exist in the list |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
|
void |
putAll(java.util.Map t)
|
java.lang.Object |
remove(int index)
|
boolean |
remove(java.lang.Object elem)
|
boolean |
removeAll(java.util.Collection c)
|
void |
removeAllElements()
|
java.lang.Object |
removeByKey(java.lang.Object key)
|
boolean |
removeElement(java.lang.Object obj)
|
void |
removeElementAt(int index)
|
boolean |
retainAll(java.util.Collection c)
|
java.util.Collection |
values()
|
| Methods inherited from class java.util.Vector |
|---|
add, capacity, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, isEmpty, lastElement, lastIndexOf, lastIndexOf, removeRange, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
iterator, listIterator, listIterator |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
add, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, set, size, subList, toArray, toArray |
| Field Detail |
|---|
public java.util.Vector names
| Constructor Detail |
|---|
public RList()
public RList(REXP[] contents)
h - head xpressionb - body xpression
public RList(int initSize,
boolean hasNames)
public RList(java.util.Collection contents)
public RList(REXP[] contents,
java.lang.String[] names)
public RList(java.util.Collection contents,
java.lang.String[] names)
public RList(java.util.Collection contents,
java.util.Collection names)
| Method Detail |
|---|
public boolean isNamed()
public REXP at(java.lang.String v)
v - key
null if list is not standartized or key not foundpublic REXP at(int i)
i - index
null if list is not standartized or
if index out of boundspublic java.lang.String keyAt(int i)
public java.lang.String[] keys()
null if list is not standartized
public void add(int index,
java.lang.Object element)
add in interface java.util.Listadd in class java.util.Vectorpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.ListaddAll in class java.util.Vector
public boolean addAll(int index,
java.util.Collection c)
addAll in interface java.util.ListaddAll in class java.util.Vectorpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.Listclear in class java.util.Vectorpublic java.lang.Object clone()
clone in class java.util.Vectorpublic java.lang.Object remove(int index)
remove in interface java.util.Listremove in class java.util.Vectorpublic boolean remove(java.lang.Object elem)
remove in interface java.util.Collectionremove in interface java.util.Listremove in class java.util.Vectorpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionremoveAll in interface java.util.ListremoveAll in class java.util.Vectorpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.CollectionretainAll in interface java.util.ListretainAll in class java.util.Vectorpublic void removeAllElements()
removeAllElements in class java.util.Vector
public void insertElementAt(java.lang.Object obj,
int index)
insertElementAt in class java.util.Vectorpublic void addElement(java.lang.Object obj)
addElement in class java.util.Vectorpublic void removeElementAt(int index)
removeElementAt in class java.util.Vectorpublic boolean removeElement(java.lang.Object obj)
removeElement in class java.util.Vectorpublic boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public java.util.Set entrySet()
null! Due to the fact that R lists are not proper maps we canot maintain a set-view of the list
public java.lang.Object get(java.lang.Object key)
public java.util.Set keySet()
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
public void putAll(java.util.Map t)
public java.lang.Object removeByKey(java.lang.Object key)
public java.util.Collection values()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||