|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.portico.shared.model.OCInstance
public class OCInstance
This class represents a specific object instance. It contains all the relevant information about the instance (such as name, handle and attributes).
Field Summary | |
---|---|
private Map<Integer,ACInstance> |
attributes
|
private int |
handle
|
private String |
name
|
private static long |
serialVersionUID
|
private OCMetadata |
type
|
Constructor Summary | |
---|---|
OCInstance()
|
|
OCInstance(int handle,
String name,
OCMetadata type)
|
Method Summary | |
---|---|
void |
addAllAttributes(Set<ACInstance> atts)
This method will just call addAttribute(ACInstance) for
each of the attributes contained in the given set. |
void |
addAttribute(ACInstance attribute)
Stores the given attribute in this object instance. |
Set<ACInstance> |
getAllAttributes()
Returns a set of all the contained attributes for this object instance. |
Set<ACInstance> |
getAllOwnedAttributes(int fedHandle)
Returns a set of all the attribute instances contained within this instance that are owned by the federate of the given handle. |
ACInstance |
getAttribute(int handle)
Fetch and return the contained attribute of the given handle. |
int |
getClassHandle()
|
int |
getHandle()
|
String |
getName()
|
int |
getOwner()
Returns the handle of the owning federate or PorticoConstants.NULL_HANDLE if it is
not owned. |
OCMetadata |
getType()
|
boolean |
isOwner(int federateHandle)
Returns true if the given parameter is equal to result of getOwned() ,
false otherwise. |
ACInstance |
removeAttribute(int handle)
Remove and return the attribute contained within this instance of the given handle. |
void |
setHandle(int handle)
|
void |
setName(String name)
|
void |
setType(OCMetadata type)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private int handle
private String name
private OCMetadata type
private Map<Integer,ACInstance> attributes
Constructor Detail |
---|
public OCInstance()
public OCInstance(int handle, String name, OCMetadata type)
Method Detail |
---|
public void addAttribute(ACInstance attribute)
public void addAllAttributes(Set<ACInstance> atts)
addAttribute(ACInstance)
for
each of the attributes contained in the given set.
public ACInstance removeAttribute(int handle)
public ACInstance getAttribute(int handle)
public Set<ACInstance> getAllAttributes()
public Set<ACInstance> getAllOwnedAttributes(int fedHandle)
public int getHandle()
public void setHandle(int handle)
public String getName()
public void setName(String name)
public int getOwner()
PorticoConstants.NULL_HANDLE
if it is
not owned. This method will look for the privilegeToDelete attribute within the instance and
return the owner of that. If it can't be found for any reason, PorticoConstants.NULL_HANDLER
will be returned.
The "owner" of the instance is defined as the federate that holds ownership of the
privilegeToDelete attribute.
public boolean isOwner(int federateHandle)
getOwned()
,
false otherwise.
The "owner" of the instance is defined as the federate that holds ownership of the
privilegeToDelete attribute.
public OCMetadata getType()
public void setType(OCMetadata type)
public int getClassHandle()
|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |