ubc.cs.JLog.Parser
Class pTermToPacketHashtable
java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable
ubc.cs.JLog.Parser.pTermToPacketHashtable
- All Implemented Interfaces:
- Serializable, Cloneable, Map
public class pTermToPacketHashtable
- extends Hashtable
Keeps track of jTerms and their associated pPackets.
The packets contain parsing relevant information, which my be needed generate
error messages if the term proves to be invalid.
- Version:
- %I%, %G%
- Author:
- Glendon Holst
- See Also:
- Serialized Form
|
Method Summary |
ubc.cs.JLog.Parser.pPacket |
getPacket(jTerm t)
Finds the packet associated with the given term key. |
ubc.cs.JLog.Parser.pToken |
getToken(jTerm t,
ubc.cs.JLog.Parser.pPacket pp)
Looks up packet in the hash given a term key, and returns the packets token. |
ubc.cs.JLog.Parser.pPacket |
putPacket(jTerm t,
ubc.cs.JLog.Parser.pPacket pp)
Associates a term with a packet. |
| Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
pTermToPacketHashtable
public pTermToPacketHashtable()
getPacket
public ubc.cs.JLog.Parser.pPacket getPacket(jTerm t)
- Finds the packet associated with the given term key.
- Parameters:
t - The term key.
- Returns:
- The associated packet if there was a match.
putPacket
public ubc.cs.JLog.Parser.pPacket putPacket(jTerm t,
ubc.cs.JLog.Parser.pPacket pp)
- Associates a term with a packet.
- Parameters:
t - The term key.pp - The packet to associate with term t.
- Returns:
- Either null if the term can't have a packet, or the packet
returned by the
Hashtable.
getToken
public ubc.cs.JLog.Parser.pToken getToken(jTerm t,
ubc.cs.JLog.Parser.pPacket pp)
- Looks up packet in the hash given a term key, and returns the packets token.
This just encapsulates a common use of this hashtable.
- Parameters:
t - The term key.pp - The packet associated with term t. Used if there is no packet
associated in this hashtable.
- Returns:
- The resulting packet's token if there was a match, otherwise
returning the packet
pp's token.
Copyright © 2011. All Rights Reserved.