org.jactr.core.slot
Class BasicSlot

java.lang.Object
  extended by org.jactr.core.slot.BasicSlot
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<ISlot>, ISlot
Direct Known Subclasses:
DefaultMutableSlot

public class BasicSlot
extends java.lang.Object
implements ISlot, java.lang.Comparable<ISlot>

Author:
harrison TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Constructor Summary
BasicSlot(ISlot slot)
           
BasicSlot(java.lang.String name)
           
BasicSlot(java.lang.String name, java.lang.Object value)
           
 
Method Summary
 BasicSlot clone()
           
 int compareTo(ISlot compSlot)
           
 boolean equals(java.lang.Object obj)
           
 boolean equalValues(java.lang.Object test)
           
 java.lang.String getName()
          the name of the slot
 java.lang.Object getValue()
          return the value of the slot.
 int hashCode()
           
 boolean isVariable()
          Deprecated. 
 boolean isVariableValue()
          checks to see if the slot value is a variable.
 void setOwner(ISlotOwner owner)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicSlot

public BasicSlot(java.lang.String name)

BasicSlot

public BasicSlot(java.lang.String name,
                 java.lang.Object value)

BasicSlot

public BasicSlot(ISlot slot)
Method Detail

setOwner

public void setOwner(ISlotOwner owner)

getValue

public final java.lang.Object getValue()
Description copied from interface: ISlot
return the value of the slot. if the slot is a variable, this returns the string name of the variable

Specified by:
getValue in interface ISlot
Returns:
may be null
See Also:
ISlot.getValue()

getName

public final java.lang.String getName()
Description copied from interface: ISlot
the name of the slot

Specified by:
getName in interface ISlot
Returns:
See Also:
ISlot.getName()

equalValues

public boolean equalValues(java.lang.Object test)
Specified by:
equalValues in interface ISlot
See Also:
ISlot.equalValues(java.lang.Object)

clone

public BasicSlot clone()
Overrides:
clone in class java.lang.Object
See Also:
org.jactr.core.utils.Duplicateable#duplicate()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

isVariableValue

public boolean isVariableValue()
checks to see if the slot value is a variable. Three things must be true:
1) the value must be a string
2) it must start with "="
3) it must have no white spaces (so that resolvable strings such as "=chunk has been retrieved" can be resolved dynamically)

Specified by:
isVariableValue in interface ISlot
Returns:
See Also:
ISlot.isVariable()

isVariable

@Deprecated
public boolean isVariable()
Deprecated. 

Description copied from interface: ISlot
slots may contain variables, which are currently hardcoded as strings starting with '='

Specified by:
isVariable in interface ISlot
Returns:
See Also:

compareTo

public int compareTo(ISlot compSlot)
Specified by:
compareTo in interface java.lang.Comparable<ISlot>
See Also:
Comparable.compareTo(java.lang.Object)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object