proper.core
Class ProperObject

java.lang.Object
  extended by proper.core.ProperObject
All Implemented Interfaces:
ProperInterface
Direct Known Subclasses:
ArgumentObject, Connector, ConnectorObject, Creator, Data, Engine, Fingerprint, Indexer, Message, Namer, Parser, PostProcessor, Traverser

public abstract class ProperObject
extends java.lang.Object
implements ProperInterface

This abstract class serves only for some common functionality of most classes. It handles stuff like interpreting the verbose string and propagating changes to its registered listeners.

Version:
$Revision: 1.3 $
Author:
FracPete

Field Summary
 
Fields inherited from interface proper.core.ProperInterface
VERSION
 
Constructor Summary
ProperObject()
          initializes the Object
 
Method Summary
 void addListener(ProperInterface o)
          adds the object to the listener list
 void addOutput(java.io.PrintStream out)
          adds the printstream to use for outputting data, i.e.
 boolean classInVerbose(java.lang.String classname)
          checks whether the given class name is part of the verbose string
 void debugprint(boolean x)
          prints the given boolean to the current ouput stream (debug)
 void debugprint(int x)
          prints the given int to the current output stream (debug)
 void debugprint(java.lang.Object x)
          prints the given object to the current ouput stream (debug)
 void debugprint(java.lang.String x)
          prints the given string to the current ouput stream (debug)
 void debugprintln()
          prints a new line to the current ouput stream (debug)
 void debugprintln(boolean x)
          prints the given boolean to the current ouput stream (debug)
 void debugprintln(int x)
          prints the given int to the current ouput stream (debug)
 void debugprintln(java.lang.Object x)
          prints the given object to the current ouput stream (debug)
 void debugprintln(java.lang.String x)
          prints the given string to the current ouput stream (debug)
 java.util.Vector getListeners()
          returns the current list of listeners
 java.lang.Runtime getRuntime()
          returns the runtime instance for this application
 boolean getVerbose()
          the current verbose state
 int getVerboseLevel()
          the current verbose level
 int getVerboseLevelForClass(java.lang.String classname)
          returns the verbose level for the given classname
 java.lang.String getVerboseString()
          returns the verbose string
 java.lang.String getVerboseStringForClass(java.lang.String classname)
          returns the verbose string (can be "") for the given classname
 void notifyListener(ProperInterface o)
          notifies the specified listener of changes
 void notifyListeners()
          notifies all the listeners of changes
 void print(boolean x)
          prints the given boolean to the current ouput stream
 void print(int x)
          prints the given int to the current output stream
 void print(java.lang.Object x)
          prints the given object to the current ouput stream
 void print(java.lang.String x)
          prints the given string to the current ouput stream
 void println()
          prints a new line to the current ouput stream
 void println(boolean x)
          prints the given boolean to the current ouput stream
 void println(int x)
          prints the given int to the current ouput stream
 void println(java.lang.Object x)
          prints the given object to the current ouput stream
 void println(java.lang.String x)
          prints the given string to the current ouput stream
 void printMemory()
          prints out the currently free and total memory in the JVM
 void removeListener(ProperInterface o)
          removes the object from the listeners
 void setOutput(java.io.PrintStream out)
          sets the printstream to use for outputting data, i.e.
 void setVerbose(boolean verbose)
          sets the verbose state (lots of information of more silent)
 void setVerboseLevel(int verboseLevel)
          sets the verbose level (0 = nothing, >0 = more)
 void setVerboseString(java.lang.String verboseStr)
          sets the string with the class names (comma separated and w/o path) that should set their verbose flag to TRUE
 java.lang.String toString()
          returns only the classname
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProperObject

public ProperObject()
initializes the Object

Method Detail

addListener

public void addListener(ProperInterface o)
adds the object to the listener list

Specified by:
addListener in interface ProperInterface

removeListener

public void removeListener(ProperInterface o)
removes the object from the listeners

Specified by:
removeListener in interface ProperInterface

getListeners

public java.util.Vector getListeners()
returns the current list of listeners

Specified by:
getListeners in interface ProperInterface

notifyListener

public void notifyListener(ProperInterface o)
notifies the specified listener of changes

Specified by:
notifyListener in interface ProperInterface

notifyListeners

public void notifyListeners()
notifies all the listeners of changes

Specified by:
notifyListeners in interface ProperInterface

setVerbose

public void setVerbose(boolean verbose)
sets the verbose state (lots of information of more silent)

Specified by:
setVerbose in interface ProperInterface

getVerbose

public boolean getVerbose()
the current verbose state

Specified by:
getVerbose in interface ProperInterface

setVerboseLevel

public void setVerboseLevel(int verboseLevel)
sets the verbose level (0 = nothing, >0 = more)

Specified by:
setVerboseLevel in interface ProperInterface

getVerboseLevel

public int getVerboseLevel()
the current verbose level

Specified by:
getVerboseLevel in interface ProperInterface

setOutput

public void setOutput(java.io.PrintStream out)
sets the printstream to use for outputting data, i.e. stdout and this stream

Specified by:
setOutput in interface ProperInterface

addOutput

public void addOutput(java.io.PrintStream out)
adds the printstream to use for outputting data, i.e. adds the stream to the existing ones

Specified by:
addOutput in interface ProperInterface

getVerboseStringForClass

public java.lang.String getVerboseStringForClass(java.lang.String classname)
returns the verbose string (can be "") for the given classname

Specified by:
getVerboseStringForClass in interface ProperInterface
Parameters:
classname - the list of classes to verbose

getVerboseLevelForClass

public int getVerboseLevelForClass(java.lang.String classname)
returns the verbose level for the given classname

Specified by:
getVerboseLevelForClass in interface ProperInterface
Parameters:
classname - the list of classes to verbose

classInVerbose

public boolean classInVerbose(java.lang.String classname)
checks whether the given class name is part of the verbose string

Specified by:
classInVerbose in interface ProperInterface

setVerboseString

public void setVerboseString(java.lang.String verboseStr)
sets the string with the class names (comma separated and w/o path) that should set their verbose flag to TRUE

Specified by:
setVerboseString in interface ProperInterface

getVerboseString

public java.lang.String getVerboseString()
returns the verbose string

Specified by:
getVerboseString in interface ProperInterface

getRuntime

public java.lang.Runtime getRuntime()
returns the runtime instance for this application

Specified by:
getRuntime in interface ProperInterface

printMemory

public void printMemory()
prints out the currently free and total memory in the JVM

Specified by:
printMemory in interface ProperInterface

print

public void print(int x)
prints the given int to the current output stream

Specified by:
print in interface ProperInterface

print

public void print(boolean x)
prints the given boolean to the current ouput stream

Specified by:
print in interface ProperInterface

print

public void print(java.lang.String x)
prints the given string to the current ouput stream

Specified by:
print in interface ProperInterface

print

public void print(java.lang.Object x)
prints the given object to the current ouput stream

Specified by:
print in interface ProperInterface

println

public void println()
prints a new line to the current ouput stream

Specified by:
println in interface ProperInterface

println

public void println(int x)
prints the given int to the current ouput stream

Specified by:
println in interface ProperInterface

println

public void println(boolean x)
prints the given boolean to the current ouput stream

Specified by:
println in interface ProperInterface

println

public void println(java.lang.String x)
prints the given string to the current ouput stream

Specified by:
println in interface ProperInterface

println

public void println(java.lang.Object x)
prints the given object to the current ouput stream

Specified by:
println in interface ProperInterface

debugprint

public void debugprint(int x)
prints the given int to the current output stream (debug)

Specified by:
debugprint in interface ProperInterface

debugprint

public void debugprint(boolean x)
prints the given boolean to the current ouput stream (debug)

Specified by:
debugprint in interface ProperInterface

debugprint

public void debugprint(java.lang.String x)
prints the given string to the current ouput stream (debug)

Specified by:
debugprint in interface ProperInterface

debugprint

public void debugprint(java.lang.Object x)
prints the given object to the current ouput stream (debug)

Specified by:
debugprint in interface ProperInterface

debugprintln

public void debugprintln()
prints a new line to the current ouput stream (debug)

Specified by:
debugprintln in interface ProperInterface

debugprintln

public void debugprintln(int x)
prints the given int to the current ouput stream (debug)

Specified by:
debugprintln in interface ProperInterface

debugprintln

public void debugprintln(boolean x)
prints the given boolean to the current ouput stream (debug)

Specified by:
debugprintln in interface ProperInterface

debugprintln

public void debugprintln(java.lang.String x)
prints the given string to the current ouput stream (debug)

Specified by:
debugprintln in interface ProperInterface

debugprintln

public void debugprintln(java.lang.Object x)
prints the given object to the current ouput stream (debug)

Specified by:
debugprintln in interface ProperInterface

toString

public java.lang.String toString()
returns only the classname

Overrides:
toString in class java.lang.Object