|
||||||||
| 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.REngine.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)
constructs an initialized, unnamed list |
|
RList(java.util.Collection contents,
java.util.Collection names)
constructs an initialized, named list. |
|
RList(java.util.Collection contents,
java.lang.String[] names)
constructs an initialized, named list. |
|
RList(int initSize,
boolean hasNames)
|
|
RList(REXP[] contents)
constructs an initialized, unnamed list |
|
RList(REXP[] contents,
java.lang.String[] names)
constructs an initialized, named list. |
|
| Method Summary | |
|---|---|
void |
add(int index,
java.lang.Object element)
|
boolean |
add(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! Due to the fact that R lists are not proper maps we canot maintain a set-view of the list |
java.lang.Object |
get(java.lang.Object key)
|
void |
insertElementAt(java.lang.Object obj,
int index)
|
boolean |
isNamed()
checks whether this list is named or unnamed |
java.lang.String |
keyAt(int i)
return the key (name) at a given index |
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)
|
void |
putAll(RList 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)
|
void |
setKeyAt(int i,
java.lang.String value)
set key at the given index. |
java.lang.String |
toString()
|
java.util.Collection |
values()
|
| Methods inherited from class java.util.Vector |
|---|
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, 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 |
|---|
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)
contents - - an array of REXPs to use as contents of this list
public RList(int initSize,
boolean hasNames)
public RList(java.util.Collection contents)
contents - - a Collection of REXPs to use as contents of this list
public RList(REXP[] contents,
java.lang.String[] names)
contents - - an array of REXPs to use as contents of this listnames - - an array of Strings to use as names
public RList(java.util.Collection contents,
java.lang.String[] names)
contents - - a Collection of REXPs to use as contents of this listnames - - an array of Strings to use as names
public RList(java.util.Collection contents,
java.util.Collection names)
contents - - a Collection of REXPs to use as contents of this listnames - - an Collection of Strings to use as names| Method Detail |
|---|
public boolean isNamed()
true if this list is named, false otherwisepublic REXP at(java.lang.String v)
v - key
null if the list is unnamed or key not foundpublic REXP at(int i)
i - index
null if the index is out of boundspublic java.lang.String keyAt(int i)
i - index
null is the list is unnamed or the index is out of range
public void setKeyAt(int i,
java.lang.String value)
null. Out of range operations are undefined (currently no-ops)
i - indexvalue - key namepublic java.lang.String[] keys()
null if list unnamed
public void add(int index,
java.lang.Object element)
add in interface java.util.Listadd in class java.util.Vectorpublic boolean add(java.lang.Object element)
add in interface java.util.Collectionadd 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 void putAll(RList t)
public java.lang.Object removeByKey(java.lang.Object key)
public java.util.Collection values()
public java.lang.String toString()
toString in class java.util.Vector
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||