File: Scope.java

package info (click to toggle)
liblessen-java 1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 276 kB
  • sloc: java: 2,981; xml: 31; makefile: 5
file content (25 lines) | stat: -rw-r--r-- 550 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.metaweb.lessen;

import java.util.Properties;


public class Scope {
    final protected Scope _parent;
    final protected Properties _properties = new Properties();
    
    public Scope(Scope parent) {
        _parent = parent;
    }
    
    public void put(String name, Object obj) {
        _properties.put(name, obj);
    }
    
    public Object get(String name) {
        Object obj = _properties.get(name);
        if (obj == null && _parent != null) {
            obj = _parent.get(name);
        }
        return obj;
    }
}