资源简介
基于事件的软件体系结构分格实现KWIC系统

代码片段和文件信息
// -*- Java -*-
/*
*
*
* Copyright (c) 2002
* Institute for Information Processing and Computer Supported New Media (IICM)
* Graz University of Technology Austria.
*
*
*
*
*
* Name: Alphabetizer.java
*
* Purpose: Sorts circular shifts alphabetically
*
* Created: 05 Nov 2002
*
* $Id$
*
* Description:
* Sorts circular shifts alphabetically
*
*/
package kwic.es;
/*
* $Log$
*/
import java.util.Observable;
import java.util.Observer;
/**
* Similarly to CircularShifter class Alphabetizer class implemets the “Observer“
* part of the standard “Observable“-“Observer“ mechanism. However an object
* of Alphabetizer class “observes“ a LineStorageWrapper object which keeps
* circular shifts whereas an object of CircularShifter class “observes“ a LineStorageWrapper
* object which keeps original lines from a KWIC input file. Any event produced and sent
* by the observed LineStorageWrapper object (e.g. whenever a new circular shift
* has been added) is catched by Alphabetizer object. In turn this leads to
* sorting the circular shifts alphabetically.
* @author dhelic
* @version $Id$
*/
public class Alphabetizer implements Observer{
//----------------------------------------------------------------------
/**
* Fields
*
*/
//----------------------------------------------------------------------
//----------------------------------------------------------------------
/**
* Constructors
*
*/
//----------------------------------------------------------------------
//----------------------------------------------------------------------
/**
* Methods
*
*/
//----------------------------------------------------------------------
//----------------------------------------------------------------------
/**
*/
public void update(Observable observable object arg){
LineStorageWrapper shifts = (LineStorageWrapper) observable;
LineStorageChangeEvent event = (LineStorageChangeEvent) arg;
switch(event.getType()){
case LineStorageChangeEvent.ADD:
int count = shifts.getLineCount();
String shift = shifts.getLineAsString(count - 1);
for(int i = 0; i < (count - 1); i++){
if(shift.compareTo(shifts.getLineAsString(i)) <= 0){
shifts.insertLine(shifts.getLine(count - 1) i);
shifts.deleteLine(count);
break;
}
}
break;
default:
break;
}
}
//----------------------------------------------------------------------
/**
* Inner classes
*
*/
//----------------------------------------------------------------------
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 15166 2009-12-01 21:21 LineStorage.java
文件 3847 2009-12-01 21:21 LineStorageChangeEvent.java
文件 5215 2009-12-01 21:21 LineStorageWrapper.java
文件 1723 2009-12-01 21:21 Output.java
文件 2784 2009-12-01 21:21 Alphabetizer.java
文件 3266 2009-12-01 21:21 CircularShifter.java
文件 3869 2009-12-01 21:21 Input.java
文件 8922 2009-12-01 21:45 KWIC.java
----------- --------- ---------- ----- ----
44792 8
相关资源
- Xamarin forms 手势事件
- 重建希格斯产生的共振tau对中的半不
- 在两个具有相同符号的轻子,缺少横
- 在13 TeV质子-质子碰撞中发生高动量希
- 在s = 13TeV的质子-质子碰撞中的同征双
- 在8 TeV的pp碰撞中,在具有射流无论是
- 在13 TeV pp碰撞中具有光子和缺少横向
- 在s = 13 $$ \\ sqrt {s} = 13 $$ TeV的质子-质
- 在s = 13 $$ \\ sqrt {s} = 13 $$ TeV的质子-质
- 使用ATLAS检测器,在s = 7 TeV的pp碰撞中
- 在与ATLAS探测器发生s = 8 TeV pp碰撞的
- 使用ATLAS探测器在s = 8 TeV的质子-质子
- 使用ATLAS探测器在s = 13 $$ \\ sqrt {s} =
- delphi 中鼠标移动事件
- 易语言截获鼠标单击事件用于屏幕取
- CMD批处理模拟鼠标按键事件
- 在s = 13 $$ \\ sqrt {s} = 13 $$ TeV的质子-质
- 用于罕见事件搜索的柔性闪烁灯设备
- 使用基于Neganov–Luke效应的光探测
- Kinect手势代替鼠标控制PC
- 基于视觉刺激的事件相关脑电信号处
- 矿井水处理鲁棒H_∞事件触发控制
- 加拿大卡尔加里市的城市水质特征与
- 在CRESST-II第二阶段中运行的具有高效
- 论文研究 - 尼日利亚河流州油气生产
- 井中微震监测数据处理方法研究与应
- ITIL项目实施- 事件管理流程设计说明
- GB∕T 38645-2020 信息安全技术 网络安全
- 实验六 事件处理,触摸屏幕显示触摸
- 离散事件系统仿真建模
评论
共有 条评论