    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Interface JavaAgent.resource.cdl.Parsable

public interface Parsable

A Parsable is any Object that can be parsed by a Parser. That is, given a String, there is a way of constructing an Object that is a (implements) Parsable.

There are two possible ways this functionality can be achieved:

- constructor: There might be a constructor that takes exactly one argument which must be an instance of class String. This can only be defined if the class implementing Parsable is not abstract.
- static function: There might be a static function defined as "`static Parsable parse(String s);`" which parses the given String and returns the created Object.

Alternatively, it might be possible to parse Objects from an InputStream instead of a String. Classes that implement Parsable should provide at least one of these methods. Unfortunately it does not seem possible to enforce such an interface with Java's inheritance mechanism.

##

toString()
  This function converts the Parsable into a String that if parsed again results in another Parsable of the same type that is equivalent to the original Parsable.

##

toString

     public abstract String toString()

  This function converts the Parsable into a String that if parsed again results in another Parsable of the same type that is equivalent to the original Parsable.

  Overrides:
    toString in class Object

    All Packages  Class Hierarchy  This Package  Previous  Next  Index