public class IlvMContainer extends IlvMResource
The implementation leaves all the freedom to the list object which eventually holds the resources. Note also that there is no check on the validity of the resources (for example, no verification that ALT type is enabled and there is at least one child).
The implementation has been dramatically simplified in JViews 8.5 to
improve performance. Only 'BAG' containers are supported, they contain
statements only, and statements must define a non null subject. Subclass
IlvMModel
is backed by a map, and subclass IlvMList
is backed
by a list.
Modifier and Type | Field and Description |
---|---|
static int |
ALT
The ALT (alternative) type of container.
|
static int |
BAG
The BAG type of container.
|
static int |
SEQ
The SEQ (sequence) type of container.
|
Constructor and Description |
---|
IlvMContainer()
Creates an anonymous bag RDF container, with an empty ArrayList as list.
|
IlvMContainer(String uri,
int type,
Map<IlvMResource,IlvMList> map)
Creates a RDF container.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object target)
|
List<IlvMStatement> |
getList()
Returns children, in a list.
|
Map<IlvMResource,IlvMList> |
getMap()
Returns the children of the container.
|
int |
getType()
Returns the type of the container.
|
int |
hashCode()
Returns the hash code.
|
boolean |
isEmpty()
True is empty.
|
void |
print(int offset,
PrintStream out)
|
void |
setList(List<IlvMStatement> list)
Sets the children of the container.
|
void |
setMap(Map<IlvMResource,IlvMList> map)
Sets the children of the container, as a map Subject to list of statements.
|
void |
setType(int t)
Sets the type of the container.
|
generateURI, getNamespace, getQName, getURI, setNamespace, setURI
public static final int BAG
public static final int SEQ
public static final int ALT
public IlvMContainer()
public IlvMContainer(String uri, int type, Map<IlvMResource,IlvMList> map)
uri
- The URI of the container. This parameter can be null
for
an anonymous resource.type
- The type of container: BAG, SEQ, or ALT.map
- The Java container for the children.public void setMap(Map<IlvMResource,IlvMList> map)
map
- The new list.public Map<IlvMResource,IlvMList> getMap()
public void setList(List<IlvMStatement> list)
list
- The new list.RuntimeException
- for all subclasses but IlvMList
public List<IlvMStatement> getList()
RuntimeException
- for all subclasses but IlvMList
public boolean isEmpty()
public void setType(int t)
t
- The new type.public int getType()
public boolean equals(Object target)
equals
in class IlvMResource
public int hashCode()
IlvMResource
hashCode
in class IlvMResource
public void print(int offset, PrintStream out)
print
in class IlvMResource
offset
- The offset.out
- The out put print stream.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.