|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectthings.data.impl.ThingsPropertyTreeRAM
public class ThingsPropertyTreeRAM
A very basic property view for an in-memory store using java HashMap.
THIS IMPLEMENTATION IS A BIG FAT BUCKET OF ConcurrentModificationException, since it uses HashMap. This might cause you some hassle.
Version History
EPG - Initial - 26 MAR 05 EPG - Shift implementation to generic HashMap - 14 JUN 05 EPG - Added sub - 19 JUL 07
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
ThingsPropertyTreeRAM()
Default constructor |
|
ThingsPropertyTreeRAM(java.util.HashMap<java.lang.String,java.lang.String[]> properties,
java.lang.String root)
Construct a child. |
|
| Method Summary | |
|---|---|
ThingsPropertyViewReader |
branch(java.lang.String path)
Branch the view to create a new view. |
void |
copyAndGraftBranch(java.lang.String sourceBranchPath,
java.lang.String graftRoot)
Copy a branch and graft it somewhere else. |
ThingsPropertyTree |
copyBranch(java.lang.String branchPath)
Copy a branch of the tree as a new tree. |
ThingsPropertyView |
cutting(java.lang.String path)
Pruning to get a new a new view. |
ThingsPropertyView |
getBranch(java.lang.String path)
Get a view of a branch on the tree. |
java.lang.String |
getProperty(java.lang.String... pathElements)
Get a property value as a string. |
java.lang.String |
getProperty(java.lang.String path)
Get a property value as a string. |
java.lang.String[] |
getPropertyMultivalue(java.lang.String path)
Get a property value as a multivalue. |
NVImmutable |
getPropertyNV(java.lang.String path)
Get a property value as a multivalue. |
ThingsPropertyView |
getRoot()
Get a view from the root. |
void |
graft(ThingsPropertyView sourceView)
Graft one view onto this view. |
void |
infliltrate(ThingsPropertyTrunk tio)
This is how you load and merge properties into an already populated tree. |
void |
init(ThingsPropertyTrunk tio)
Tell the tree to init itself. |
void |
load()
Tell the tree to load fresh. |
java.util.Collection<java.lang.String> |
ply(java.lang.String path)
Get the ply at this path. |
void |
prune(java.lang.String path)
Prune off the path. |
void |
removeProperty(java.lang.String path)
Remove a specific property without subverting a tree. |
void |
save()
Tell the tree to save itself. |
void |
setProperty(NVImmutable item)
Set a property value from an NVImmutable item. |
void |
setProperty(java.lang.String path,
java.lang.String value)
Set a property value as a string. |
void |
setProperty(java.lang.String path,
java.lang.String value,
java.lang.String defaultValue)
Set a property value as a string. |
void |
setPropertyMultivalue(java.lang.String path,
java.lang.String... values)
Set a property value as a multivalue. |
java.util.Collection<java.lang.String> |
sub(java.lang.String path)
Get all property names under this at this path. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ThingsPropertyTreeRAM()
public ThingsPropertyTreeRAM(java.util.HashMap<java.lang.String,java.lang.String[]> properties,
java.lang.String root)
throws ThingsException
ThingsException| Method Detail |
|---|
public ThingsPropertyView getBranch(java.lang.String path)
throws ThingsException
getBranch in interface ThingsPropertyTreepath - path to the branch. null we return the root
ThingsException
public ThingsPropertyView getRoot()
throws ThingsException
getRoot in interface ThingsPropertyTreeThingsException
public ThingsPropertyTree copyBranch(java.lang.String branchPath)
throws ThingsException
copyBranch in interface ThingsPropertyTreebranchPath - path to the branch from where to start the copy. An empty or null value will return the root.
ThingsException
public void copyAndGraftBranch(java.lang.String sourceBranchPath,
java.lang.String graftRoot)
throws ThingsException
copyAndGraftBranch in interface ThingsPropertyTreesourceBranchPath - path to the branch from where to copy. An empty or null value will return the root.graftRoot - the path to where it should be grafted.
ThingsException
public void prune(java.lang.String path)
throws ThingsException
prune in interface ThingsPropertyViewpath - the property path (relative to the view root). A null is not allowed.
ThingsException
public void load()
throws ThingsException
load in interface ThingsPropertyTreeThingsException
public void save()
throws ThingsException
save in interface ThingsPropertyTreesave in interface ThingsPropertyViewThingsException
public void init(ThingsPropertyTrunk tio)
throws ThingsException
init in interface ThingsPropertyTreetio - a trunk to load and save the properties
ThingsException
public void infliltrate(ThingsPropertyTrunk tio)
throws ThingsException
infliltrate in interface ThingsPropertyTreetio - a trunk to load and save the properties
ThingsException
public void setProperty(java.lang.String path,
java.lang.String value)
throws ThingsException
setProperty in interface ThingsPropertyViewpath - the property path (relative to the view root)value - the property value as a string
ThingsException
public void setProperty(java.lang.String path,
java.lang.String value,
java.lang.String defaultValue)
throws ThingsException
setProperty in interface ThingsPropertyViewpath - the property path (relative to the view root)value - the property value as a stringdefaultValue - the default value.
ThingsException
public void setProperty(NVImmutable item)
throws ThingsException
setProperty in interface ThingsPropertyViewitem - the item
ThingsExceptionNVImmutable
public void setPropertyMultivalue(java.lang.String path,
java.lang.String... values)
throws ThingsException
setPropertyMultivalue in interface ThingsPropertyViewpath - the property path (relative to the view root)values - the property values as Strings.
ThingsException
public void removeProperty(java.lang.String path)
throws ThingsException
removeProperty in interface ThingsPropertyViewpath - the property path (relative to the view root). A null or bogus path will be ignored.
ThingsException
public ThingsPropertyView cutting(java.lang.String path)
throws ThingsException
cutting in interface ThingsPropertyViewpath - the property path (relative to the view root)
ThingsException
public void graft(ThingsPropertyView sourceView)
throws ThingsException
SLOWWWW since it takes too passes. Yuck! We'll let the NVImmutable take care of the "copies so the original tree will be left unaltered).
graft in interface ThingsPropertyViewsourceView - view to graft on.
ThingsException
public ThingsPropertyViewReader branch(java.lang.String path)
throws ThingsException
branch in interface ThingsPropertyViewReaderpath - the property path (relative to the view root)
ThingsException
public java.lang.String getProperty(java.lang.String path)
throws ThingsException
getProperty in interface ThingsPropertyViewReaderpath - the property name
ThingsException
public java.lang.String getProperty(java.lang.String... pathElements)
throws ThingsException
getProperty in interface ThingsPropertyViewReaderpathElements - a stitch-able path.
ThingsException
public java.lang.String[] getPropertyMultivalue(java.lang.String path)
throws ThingsException
getPropertyMultivalue in interface ThingsPropertyViewReaderpath - the property name
ThingsException
public NVImmutable getPropertyNV(java.lang.String path)
throws ThingsException
getPropertyNV in interface ThingsPropertyViewReaderpath - the property name
ThingsExceptionNVImmutable
public java.util.Collection<java.lang.String> sub(java.lang.String path)
throws ThingsException
sub in interface ThingsPropertyViewReaderpath - a offset path.
ThingsException
public java.util.Collection<java.lang.String> ply(java.lang.String path)
throws ThingsException
ply in interface ThingsPropertyViewReaderpath - a root path.
ThingsException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||