crn
Class Case

java.lang.Object
  extended bycrn.Case

public class Case
extends java.lang.Object

The case.

Author:
Piotrek

Field Summary
private  CRN crn
          The owner of this case.
private  boolean fAccepted
          Indicates whether this case has been accepted or rejected by the user.
protected  java.util.ArrayList iesReferences
          A list of references to all the IEs constituting this case.
private  java.lang.String name
          A name of the case.
private  float similarity
          The similarity with the other case.
 
Constructor Summary
Case(java.lang.String name, boolean fAccepted, CRN crn)
          Constructor.
 
Method Summary
 void AddIEReference(IE ie)
          Adds a reference to the IE references list of this case.
 boolean equals(java.lang.Object object)
           
 CRN GetCRN()
          Gets the owner of this case.
 java.util.Iterator GetIEReferencesIterator()
          Gets the IE references iterator.
 java.util.ArrayList GetIEs(java.lang.String name)
          Gets the IEs referencing to this case of the given type.
 java.lang.String GetName()
          Gets the name of this case.
 float GetSimilarity()
          Gets the similarity.
 boolean HasIEType(java.lang.String ieName)
          Chesks whether this case has an IE of the given type.
 boolean IsAccepted()
          Indicates whether this case has been accepted or rejected by the user.
 boolean IsEqual(Case otherCase)
          Tests the equality of two cases.
 void SetAccepted(boolean fAccepted)
          Sets the value indicating whether this case should be accepted or not.
 void SetSimilarity(float similarity)
          Sets the similarity.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private java.lang.String name
A name of the case.


fAccepted

private boolean fAccepted
Indicates whether this case has been accepted or rejected by the user.


iesReferences

protected java.util.ArrayList iesReferences
A list of references to all the IEs constituting this case.


similarity

private float similarity
The similarity with the other case. Set by the CRN. Relevant only after calling the CRN.CompareCases().


crn

private CRN crn
The owner of this case. Null if there is no owner.

Constructor Detail

Case

public Case(java.lang.String name,
            boolean fAccepted,
            CRN crn)
Constructor.

Parameters:
name - The name of this case.
fAccepted - Indicates whether this case has been accepted or rejected by the user.
crn - The owner of this case. Set to null if there is no owner.
Method Detail

IsAccepted

public boolean IsAccepted()
Indicates whether this case has been accepted or rejected by the user.

Returns:
Returns a boolean value indicating whether this case has been accepted or rejected by the user.

GetName

public java.lang.String GetName()
Gets the name of this case.

Returns:
Returns the name.

equals

public boolean equals(java.lang.Object object)
See Also:
Object.equals(java.lang.Object)

IsEqual

public boolean IsEqual(Case otherCase)
Tests the equality of two cases. They may belong to two different CRNs.

Parameters:
otherCase - The other case this one is to be compared to.
Returns:
A boolean value indicating whether this and the other cases are equal.

AddIEReference

public void AddIEReference(IE ie)
Adds a reference to the IE references list of this case.

Parameters:
ie - The IE to be added.

GetIEReferencesIterator

public java.util.Iterator GetIEReferencesIterator()
Gets the IE references iterator.

Returns:
The requested iterator.

GetSimilarity

public float GetSimilarity()
Gets the similarity.

Returns:
Returns the similarity.

SetSimilarity

public void SetSimilarity(float similarity)
Sets the similarity.

Parameters:
similarity - The similarity to set.

GetCRN

public CRN GetCRN()
Gets the owner of this case.

Returns:
Returns the owner of this case. Null is returned, if there is no owner.

HasIEType

public boolean HasIEType(java.lang.String ieName)
Chesks whether this case has an IE of the given type.

Parameters:
ieName - The name of the IE type.
Returns:
The boolean value indicating whether this case has an IE of the given type.

GetIEs

public java.util.ArrayList GetIEs(java.lang.String name)
Gets the IEs referencing to this case of the given type.

Parameters:
name - Name of type.
Returns:
The referencing IEs or an empty list, if there are no IEs of the requested type.

SetAccepted

public void SetAccepted(boolean fAccepted)
Sets the value indicating whether this case should be accepted or not.

Parameters:
fAccepted - The new value.