|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.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 xpressionpublic 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 standartizedpublic void add(int index, java.lang.Object element)
add
in interface java.util.List
add
in class java.util.Vector
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.List
addAll
in class java.util.Vector
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
addAll
in class java.util.Vector
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
clear
in class java.util.Vector
public java.lang.Object clone()
clone
in class java.util.Vector
public java.lang.Object remove(int index)
remove
in interface java.util.List
remove
in class java.util.Vector
public boolean remove(java.lang.Object elem)
remove
in interface java.util.Collection
remove
in interface java.util.List
remove
in class java.util.Vector
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.List
removeAll
in class java.util.Vector
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.List
retainAll
in class java.util.Vector
public void removeAllElements()
removeAllElements
in class java.util.Vector
public void insertElementAt(java.lang.Object obj, int index)
insertElementAt
in class java.util.Vector
public void addElement(java.lang.Object obj)
addElement
in class java.util.Vector
public void removeElementAt(int index)
removeElementAt
in class java.util.Vector
public boolean removeElement(java.lang.Object obj)
removeElement
in class java.util.Vector
public 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 |