things.data
Class Nubblet

java.lang.Object
  extended by things.data.Nubblet
All Implemented Interfaces:
java.io.Serializable, Data
Direct Known Subclasses:
Entry

public class Nubblet
extends java.lang.Object
implements Data

This is a nubblet, the simplest form of Data. Nubblets have no creator.

Version:
1.0
Version History
EPG - Rewrite from another - 22May04

, 1.0

Version History

EPG - Rewrite from another project - 22 MAY 04
 
Author:
Erich P. Gatejen
, Erich P. Gatejen
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface things.data.Data
Data.Priority, Data.Type
 
Field Summary
 int numeric
          Numeric
 Data.Priority priority
          Numeric
protected  java.lang.Object thing
          thing
 
Constructor Summary
Nubblet()
          Default constructor is not allowed.
Nubblet(Data.Type t, Data.Priority p, int n, java.lang.Object o)
          Constructor.
 
Method Summary
 WhoAmI birthMyChild(java.lang.String childsName)
          Create a child ID using the given name.
 WhoAmI birthMyChild(java.lang.String childsName, java.lang.String childsTag)
          Create a child ID using the given name and tag.
 AttributeReader getAttributes()
          Get the attributes.
 WhoAmI getCreatorID()
          Get the creator's ID.
 WhoAmI getID()
          Get the objects ID.
 int getNumeric()
          Get the numeric value.
 java.lang.String getNumericString()
          Get the numeric value.
 Data.Priority getPriority()
          Get the priority.ed.
 long getStamp()
          Get the timestamp.
 java.lang.Object getThing()
          Get the thing (Object).
 Data.Type getType()
          Get the type.
 java.lang.String toString()
          Give a textual ID.
 java.lang.String toTag()
          Give a TAG version of the ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

thing

protected java.lang.Object thing
thing


numeric

public int numeric
Numeric


priority

public Data.Priority priority
Numeric

Constructor Detail

Nubblet

public Nubblet()
        throws java.lang.Throwable
Default constructor is not allowed. Don't let the user grab the super by accident.

Throws:
java.lang.Throwable

Nubblet

public Nubblet(Data.Type t,
               Data.Priority p,
               int n,
               java.lang.Object o)
Constructor. Sets everything but ID and timestamps it.

Parameters:
t - the type
p - the priority
n - the numeric
o - the object
Method Detail

birthMyChild

public WhoAmI birthMyChild(java.lang.String childsName)
Create a child ID using the given name. Nubblets cannot have children, so this will return an IAmNobody.

Specified by:
birthMyChild in interface Data
Parameters:
childsName - the given name for the child.
Returns:
the textual representation of the ID.
See Also:
IAmNobody

birthMyChild

public WhoAmI birthMyChild(java.lang.String childsName,
                           java.lang.String childsTag)
Create a child ID using the given name and tag. It must yield the same ID if the same value is used for childsName.

Specified by:
birthMyChild in interface Data
Parameters:
childsName - the given name for the child.
childsTag - the tag for the child.
Returns:
the id
See Also:
WhoAmI

toString

public java.lang.String toString()
Give a textual ID.

Specified by:
toString in interface Data
Overrides:
toString in class java.lang.Object
Returns:
the textual representation of the ID.
See Also:
WhoAmI

toTag

public java.lang.String toTag()
Give a TAG version of the ID. This cannot be used for positive ID, but may make a convenient mnemonic. An implementation may return the same value as toString().

Returns:
the tag representation of the ID.

getID

public WhoAmI getID()
Get the objects ID.

Specified by:
getID in interface Data
Returns:
the id
See Also:
WhoAmI

getCreatorID

public WhoAmI getCreatorID()
Get the creator's ID.

Specified by:
getCreatorID in interface Data
Returns:
the id
See Also:
WhoAmI

getNumeric

public int getNumeric()
Get the numeric value. It is completely up to the setter as to what this means.

Specified by:
getNumeric in interface Data
Returns:
value as an int

getNumericString

public java.lang.String getNumericString()
Get the numeric value. It is completely up to the setter as to what this means.

Specified by:
getNumericString in interface Data
Returns:
value as a string

getPriority

public Data.Priority getPriority()
Get the priority.ed.

Specified by:
getPriority in interface Data
Returns:
the priority.

getStamp

public long getStamp()
Get the timestamp.

Specified by:
getStamp in interface Data
Returns:
timestamp as a long

getThing

public java.lang.Object getThing()
Get the thing (Object).

Specified by:
getThing in interface Data
Returns:
the thing

getType

public Data.Type getType()
Get the type.

Specified by:
getType in interface Data
Returns:
the type

getAttributes

public AttributeReader getAttributes()
Get the attributes.

Specified by:
getAttributes in interface Data
Returns:
the attributes associated with the Data, if any.


Things.