public class AlarmModelQuickFinder
extends java.lang.Object
AlarmModelQuickFinder
is designed for quick searching for
alarms object in alarm model.
Using code snippet:
TDataBox box = new TDataBox(); AlarmModel alarmModel = box.getAlarmModel(); AlarmModelQuickFinder finder = new AlarmModelQuickFinder(alarmModel, "key"); Alarm alarm = new Alarm(); alarm.putClientProperty("key", new Integer(20)); alarmModel.addAlarm(alarm); alarm = new Alarm(); alarm.putClientProperty("key", new Integer(30)); alarmModel.addAlarm(alarm); List resultList = finder.find(new Integer(20)); Alarm resultAlarm = finder.findFirst(new Integer(20));
Constructor and Description |
---|
AlarmModelQuickFinder(AlarmModel alarmModel,
java.lang.String propertyName)
Creates a AlarmModelQuickFinder instance with specified alarm model and alarm property name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addAlarm(Alarm alarm)
Add given alarm into internal cache.
|
protected void |
clear()
Clear all internal caches.
|
void |
dispose()
Dispose all related resources.
|
java.util.List |
find(java.lang.Object value)
Find all alarms whose bound property value equals to the
given value.
|
Alarm |
findFirst(java.lang.Object value)
Find the first alarm whose bound property value equals to the
given value.
|
protected java.lang.Object |
getKey(Alarm alarm)
Gets bind property's value of the given alarm.
|
boolean |
interested(Alarm alarm)
Determines whether or not this finder has interest on
this specified alarm.
|
protected void |
removeAlarm(Alarm alarm)
Remove the alarm from internal cache.
|
public AlarmModelQuickFinder(AlarmModel alarmModel, java.lang.String propertyName)
alarmModel
- the connected alarm model.propertyName
- the property name of alarm to be indexed on.protected void addAlarm(Alarm alarm)
alarm
- Alarm the alarm need to add.protected void removeAlarm(Alarm alarm)
alarm
- Alarm the alarm need to removeprotected void clear()
public java.util.List find(java.lang.Object value)
value
- Object the conditional value.public Alarm findFirst(java.lang.Object value)
value
- Object the conditional value.protected java.lang.Object getKey(Alarm alarm)
Alarm
- the alarm objectpublic boolean interested(Alarm alarm)
alarm
- public void dispose()
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.