|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.intermine.xml.full.Item
public class Item
Representation of an object
| Constructor Summary | |
|---|---|
protected |
Item()
Construct an item. |
protected |
Item(Model model,
java.lang.String identifier,
java.lang.String className,
java.lang.String implementations)
Construct an item. |
protected |
Item(java.lang.String identifier,
java.lang.String className,
java.lang.String implementations)
Construct an item with no Model. |
| Method Summary | |
|---|---|
void |
addAttribute(Attribute attribute)
Add an attribute. |
void |
addCollection(ReferenceList collection)
Add a collection. |
void |
addReference(Reference reference)
Add a reference. |
void |
addToCollection(java.lang.String name,
Item item)
Add the identifier of the given Item to a collection. |
void |
addToCollection(java.lang.String name,
java.lang.String refId)
Add a reference to a collection of this item. |
boolean |
canHaveCollection(java.lang.String name)
Return true if and only if the argument names a possible collection for this Item. |
boolean |
canHaveReference(java.lang.String name)
Return true if and only if the argument names a possible reference for this Item. |
boolean |
checkAttribute(java.lang.String name)
Return true if the name parameter is an attribute of the class for this Item or if the Model or the className of this Item haven't been set. |
protected void |
checkCollection(java.lang.String name)
Throw a RuntimeException if the name parameter isn't an collection in the class set by setClassName() in the Model set by setModel(). |
protected void |
checkImplementations(java.lang.String implementations)
Throw RuntimeException if the given implementations don't match the model. |
protected void |
checkReference(java.lang.String name)
Throw a RuntimeException if the name parameter isn't an reference in the class set by setClassName() in the Model set by setModel(). |
int |
compareTo(Item i)
Compare items first by class, then by identifier, intended for creating ordered output files. |
boolean |
equals(java.lang.Object o)
|
protected java.util.List<ClassDescriptor> |
getAllClassDescriptors()
Return the ClassDescriptors of the class of this Item (as given by className) and all the implementations. |
Attribute |
getAttribute(java.lang.String attributeName)
Get a named attribute. |
java.util.Collection<Attribute> |
getAttributes()
Get all the attributes. |
protected ClassDescriptor |
getClassDescriptorByName(java.lang.String className)
Throw a RuntimeException if any of the named class isn't in the Model set by setModel(). |
java.lang.String |
getClassName()
Get the class name of this item. |
ReferenceList |
getCollection(java.lang.String collectionName)
Get a named collection. |
java.util.Collection<ReferenceList> |
getCollections()
Get all the collections. |
java.lang.String |
getIdentifier()
Get the identifier of this item. |
java.lang.String |
getImplementations()
Get the interfaces implemented by this item. |
protected java.util.List<ClassDescriptor> |
getImplementClassDescriptors(java.lang.String implementations)
Returns the ClassDescriptors for the given implementations. |
Model |
getModel()
Return the model that was passed to the constructor or set with setModel(). |
Reference |
getReference(java.lang.String referenceName)
Get a named reference. |
java.util.Collection<Reference> |
getReferences()
Get all the references. |
boolean |
hasAttribute(java.lang.String attributeName)
Return true if named attribute exists. |
boolean |
hasCollection(java.lang.String collectionName)
Return true if named collection exists. |
int |
hashCode()
|
boolean |
hasReference(java.lang.String referenceName)
Return true if named reference exists. |
void |
removeAttribute(java.lang.String attributeName)
Remove a attribute of the specified name if it exists. |
void |
removeCollection(java.lang.String collectionName)
Remove a collection of the specified name if it exists. |
void |
removeReference(java.lang.String referenceName)
Remove a reference of the specified name if it exists. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Add an attribute to this item. |
void |
setAttributeToEmptyString(java.lang.String name)
Add an attribute to this item and set it to the empty string. |
protected void |
setClassDescriptor(java.lang.String className)
Set the classDescriptor attribute to be the ClassDescriptor for the given className in the Model set by setModel(). |
void |
setClassName(java.lang.String className)
Set the class of this item. |
void |
setCollection(java.lang.String collectionName,
java.util.List<java.lang.String> refIds)
Set a collection. |
void |
setIdentifier(java.lang.String identifier)
Set the identifier of this item. |
void |
setImplementations(java.lang.String implementations)
Set the "implements" of this item. |
void |
setModel(Model model)
Set the Model to use when checking calls to the other set methods |
void |
setReference(java.lang.String name,
Item item)
Add a reference that points to a particular item. |
void |
setReference(java.lang.String name,
java.lang.String refId)
Add a reference to this item. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Item()
protected Item(Model model,
java.lang.String identifier,
java.lang.String className,
java.lang.String implementations)
model - the Model used to type-check set methods; if null no type checking is doneidentifier - item identifierclassName - name of described classimplementations - names of implemented classesItemFactory
protected Item(java.lang.String identifier,
java.lang.String className,
java.lang.String implementations)
identifier - item identifierclassName - name of described classimplementations - names of implemented classesItemFactory| Method Detail |
|---|
public void setModel(Model model)
model - the Modelpublic Model getModel()
public void setIdentifier(java.lang.String identifier)
identifier - the identifierpublic java.lang.String getIdentifier()
public void setClassName(java.lang.String className)
className - the classpublic java.lang.String getClassName()
public void setImplementations(java.lang.String implementations)
implementations - the interfaces that this item implementspublic java.lang.String getImplementations()
public void addAttribute(Attribute attribute)
attribute - the Attribute to addpublic void removeAttribute(java.lang.String attributeName)
attributeName - name of the attribute to removepublic java.util.Collection<Attribute> getAttributes()
public Attribute getAttribute(java.lang.String attributeName)
attributeName - the attribute name
public boolean hasAttribute(java.lang.String attributeName)
attributeName - the attribute name
public void addReference(Reference reference)
reference - the reference to addpublic void removeReference(java.lang.String referenceName)
referenceName - name of the reference to removepublic java.util.Collection<Reference> getReferences()
public Reference getReference(java.lang.String referenceName)
referenceName - the reference name
public boolean hasReference(java.lang.String referenceName)
referenceName - the reference name
public void addCollection(ReferenceList collection)
collection - the collection to addpublic void removeCollection(java.lang.String collectionName)
collectionName - name of the collection to removepublic java.util.Collection<ReferenceList> getCollections()
public boolean hasCollection(java.lang.String collectionName)
collectionName - the collection name
public ReferenceList getCollection(java.lang.String collectionName)
collectionName - the collection name
public void setCollection(java.lang.String collectionName,
java.util.List<java.lang.String> refIds)
collectionName - collection namerefIds - ids to reference
public void setAttribute(java.lang.String name,
java.lang.String value)
name - the name of the attributevalue - the value of the attribute - cannot be null or emptypublic void setAttributeToEmptyString(java.lang.String name)
name - the name of the attribute
public void setReference(java.lang.String name,
java.lang.String refId)
name - the name of the attributerefId - the value of the attribute
public void setReference(java.lang.String name,
Item item)
name - the name of the attributeitem - the item to refer to
public void addToCollection(java.lang.String name,
Item item)
name - the name of the collectionitem - the item whose identifier is to be added to the collection
public void addToCollection(java.lang.String name,
java.lang.String refId)
name - the name of the collectionrefId - the item to add to the collectionpublic boolean checkAttribute(java.lang.String name)
name - the attribute name
protected void checkReference(java.lang.String name)
name - the reference namepublic boolean canHaveReference(java.lang.String name)
name - the field name
public boolean canHaveCollection(java.lang.String name)
name - the field name
protected void checkCollection(java.lang.String name)
name - the collection nameprotected void checkImplementations(java.lang.String implementations)
implementations - the interfaces that this item implementsprotected ClassDescriptor getClassDescriptorByName(java.lang.String className)
className - the class name
protected void setClassDescriptor(java.lang.String className)
className - the class nameprotected java.util.List<ClassDescriptor> getAllClassDescriptors()
protected java.util.List<ClassDescriptor> getImplementClassDescriptors(java.lang.String implementations)
implementations - the interfaces that this item implements
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int compareTo(Item i)
compareTo in interface java.lang.Comparable<Item>public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||