|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jplate.foundation.source.impl.defaults.DefaultSource<S>
S - The real "source" (for instance, file, URL, etc).public final class DefaultSource<S>
Default implementation of SourceIfc.
final SourceIfc <URL> urlSource =
new DefaultSource <URL> DefaultSource ( new URL ( "http://jplate.sourceforge.net", 10, 50 ) );
final SourceIfc <File> fileSource =
new DefaultSource <File> DefaultSource ( new File ( "/home/sfloess/some-file.txt", 1, 11 ) );
Modifications:
$Date: 2008-12-02 12:32:45 -0500 (Tue, 02 Dec 2008) $
$Revision: 479 $
$Author: sfloess $
$HeadURL: https://jplate.svn.sourceforge.net/svnroot/jplate/trunk/src/dev/java/org/jplate/foundation/source/impl/defaults/DefaultSource.java $
| Field Summary | |
|---|---|
private int |
_column
This is the column where something exists in source. |
private int |
_hashCode
The hash code. |
private int |
_line
This is the line where something exists in source. |
private org.apache.commons.logging.Log |
_log
Used for logging. |
private S |
_source
This is the source from whence something exists. |
private static long |
serialVersionUID
For serialization purposes. |
static java.lang.String |
SOURCE_IS_NULL_MSG
Denotes that source is null. |
| Fields inherited from interface org.jplate.foundation.source.SourceIfc |
|---|
UNKNOWN_COLUMN, UNKNOWN_LINE |
| Constructor Summary | |
|---|---|
private |
DefaultSource()
Default constructor not allowed. |
|
DefaultSource(S source,
int line,
int column)
This constructor sets-up the source, line an column where something exists. |
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object object)
Determines object equality. |
int |
getColumn()
Returns the column number in SourceIfc.getSource(). |
int |
getLine()
Returns the line number in SourceIfc.getSource(). |
S |
getSource()
Returns the actual "source." For instance if a source is defined by a File, the file represents the actual source. |
int |
hashCode()
|
java.lang.String |
toString()
This method returns a String representation of self. |
java.lang.String |
toString(java.lang.String prepend)
Returns a string representation of self prepending prepend to
each line. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SOURCE_IS_NULL_MSG
private static final long serialVersionUID
private final transient org.apache.commons.logging.Log _log
private final S _source
private final int _line
private final int _column
private final int _hashCode
| Constructor Detail |
|---|
public DefaultSource(S source,
int line,
int column)
source - The place from which something exists or originates (for
instance a file).line - The line number in source.column - The column number in source.private DefaultSource()
java.lang.UnsupportedOperationException - if this constructor is called.| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(java.lang.String prepend)
prepend to
each line.
toString in interface FormattableIfcprepend - The text to prepend to each line as defined in the return
value.
prepend
prepended to each line.public S getSource()
getSource in interface SourceIfc<S>public int getLine()
SourceIfc.getSource().
getLine in interface SourceIfc<S>public int getColumn()
SourceIfc.getSource().
getColumn in interface SourceIfc<S>public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectobject - to compare.
object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||