|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.data.trees.patterns.AbstractPattern
org.gcube.data.trees.patterns.LeafPattern<T,C>
C - the type of the constraint associated with the pattern.T - the type of the value constrained by the pattern.public abstract class LeafPattern<T,C extends Constraint<? super T>>
| Field Summary | |
|---|---|
protected C |
constraint
|
| Constructor Summary | |
|---|---|
LeafPattern(C c)
Creates and instance with a given constraint. |
|
| Method Summary | |
|---|---|
C |
constraint()
|
boolean |
equals(Object obj)
|
int |
hashCode()
|
boolean |
matches(Node n)
Indicates whether a node matches a pattern. |
abstract String |
name()
Returns the name of the pattern. |
void |
prune(Node n)
Prunes a node of all the descendants that are not required to match the pattern. |
String |
toString()
|
protected abstract T |
valueOf(String s)
Returns the typed equivalent of a leaf's value. |
| Methods inherited from class org.gcube.data.trees.patterns.AbstractPattern |
|---|
idPattern, setIdPattern |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected C extends Constraint<? super T> constraint
| Constructor Detail |
|---|
public LeafPattern(C c)
c - the constraint| Method Detail |
|---|
public final void prune(Node n)
throws Exception
prune in interface Patternprune in class AbstractPatternn - the node.
Exception - if the node does not match the pattern.public C constraint()
public boolean matches(Node n)
matches in interface Patternmatches in class AbstractPatternn - the node.
true if it does, false otherwise.
protected abstract T valueOf(String s)
throws Exception
s - the value
Exceptionpublic abstract String name()
public String toString()
toString in class Objectpublic int hashCode()
hashCode in class AbstractPatternpublic boolean equals(Object obj)
equals in class AbstractPattern
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||