input
stringlengths
10
828
output
stringlengths
5
107
public void add user principal user if users contains user users add element user
adds a user principal to the criterias user list
public void remove user principal user users remove element user
removes a user principal from the criterias user list
public enumeration get users return users elements
returns an enumeration of the current user list
public void set object source object source source this source source
this method will be called before any object test requests are
public void set object source object source source
this method will be called before any object test requests are
public boolean include object object id id return true
this method should return true if the object with the given id
protected object source get object source return source
returns the object source
protected principal get user return user
returns the users principal
public void add object object object id id storage put id object
add a shared object to registry
public void write object object obj output stream out throws ioexception object output stream oos new object output stream out oos write object obj oos flush
writes the object to the given stream
public object read object input stream in throws ioexception object input stream ois new object input stream in try return ois read object catch class not found exception cnfe throw new ioexception couldn t read object cnfe get message
reads the object from the given stream
public void remove object object object id id get id object storage remove id
remove a shared object from the registry
public void remove by id object id id storage remove id
remove a shared object from the registry
public object get object object id id return storage get id
returns a reference to a object for the given id
public object id get id object object object id id null for enumeration e storage keys e has more elements id null object id tmp object id e next element if storage get tmp equals object id tmp return id
returns the id for the given object
public date get date from string string s date d null try d date format parse s catch parse exception pe pe print stack trace return d
extracts a date from a string genereated by write date string item
public storage handler get storage handler class cl storage handler sh storage handler cache get cl if sh null see if we can find a handler by appending storage handler to the end of the class name try class handler class class for name cl get name storage handler sh storage handler handler class new instance catch exception e if that fails use the default handler sh default handler make sure we only have to figure this out once cache put cl sh return sh
returns the storage handler for writing instances of the given class
public storage handler get storage handler string class name try class cl class for name class name return get storage handler cl catch exception e return default handler
returns the storage handler for writing instances of the class with
public object put object id key object value object result super put key value try file file new file get directory key get filename get depth file dir new file file get parent file new file dir classfilename if file exists print writer out new print writer new file writer file out println key get classname out flush out close catch ioexception ioe ioe print stack trace return result
writes the object to the store
public storage handler get storage handler object obj return get storage handler obj get class
returns the storage handler capable of writing the given object
public void add storage handler storage handler handler class cl cache put cl handler
registers a storage handler to be used for reading and writing objects
public void visit directory visitor v file directory string contents directory list for int i 0 i contents length i v visit directory contents i
visit everything in a directory
public int get active object count return actives size
returns the number of active unflushed objects
public void visit all files final visitor v file directory visit directory new visitor public void visit file dir string name file f new file dir name if f is file v visit dir name else visit all files v f directory
recursively visit all files in a directory
public void component resized component event evt if out get bounds height 0 to end run out remove component listener listener this
scroll to the end on the first resize
public int get modified object count return modified size
returns the number of modified but unwritten objects
public int size check object ids return ids size
returns the number of elements contained within the storage object
public boolean is empty check object ids return size 0
returns true if the storage object contains no elements
public void property change property change event evt string prop evt get property name if prop equals cleared out set text else if prop equals last utterance chat utterance cu chat utterance evt get new value replicated object client client context get replicated object client ignore our own utterances if cu user equals client get user get name string user cu user int last idx user last index of if last idx 1 user user substring last idx 1 typing set text user is typing typing set tool tip text cu text
listen for list clearing events
public void add object object object id id object record rec new object record object id actives put id rec modified add element rec storage put id object
add a shared object to registry
public enumeration keys check object ids return ids elements
returns an enumeration of the storage objects keys
public void remove object object object id id get id object remove by id id
remove a shared object from the registry
public enumeration elements if we start caching keys this can be optimized a bit for now we have to visit every file anyway so we may as well do it in one pass system err println ser stor elements called final vector v new vector visit all files new visitor public void visit file directory string name v add element get object id from string name dir return v elements
returns an enumeration of the elements
public void add permissions permissions perms object id id active perms put id perms permissions put id perms
add a permissions object to the registry
public permissions get permissions object id id permissions p permissions active perms get id if p null p permissions permissions get id if p null active perms put id p return p
return the permissions object for the object with the given id
public void add meta data object meta data object id id active meta put id meta data meta put id meta data
add a meta data object to the registry
public object get meta data object id id object meta data active meta get id if meta data null meta data meta get id if meta data null active meta put id meta data return meta data
return the meta data object for the object with the given id
public object remove object id key if ids null ids remove element key file file new file dir key get filename depth if file exists file delete file bak new file dir key get filename depth bak if bak exists bak delete return null
removes the element corresponding to the key
public void set name filter chat view name filter filter this name filter filter
sets a filter for names
public void stop sound capture on false
function called to stop the capturing the sound and transmission to the server
public chat view name filter get name filter return name filter
returns the name filter
public void start string s1 string s2 thread new thread this thread set name interact login thread start user name s1 password s2
this function starts the thread
public void send message string message pr println message pr flush
this function sends the specified message to the server
public void start err str null thread new thread this thread set name capture thread start end start
this function starts the thread which captures audio sends it on the network
public void start thread new thread this thread set name interact thread start
this method starts the thread
private void exit form java awt event window event evt gen first event exit form hide gen last event exit form
this closes the window
public void shut down system exit 1
this function closes the application
public void send yes read thread send message sayyes user name
this function send sayyes message to the server
public void my text area
constructor of the class
public void set content display content display cd this cd cd
this function sets the content display object
public void draw circle int x int y editor pane set pointer x y out set pointer x y
draws a circle at the specified location
public void mouse clicked mouse event e insets insets this get insets if session is not on if in session draw the circle circle set bounds e get x e get y 10 10 cd on clicker e get x e get y
this function is called when mouse has been clicked on a component
public void send no read thread send message sayno user name
this function send sayno message to the server
add window listener new window adapter public void window closing window event e system exit 0
handle the window closing event
public void my editor pane
constructor of the class
public void start session read thread send message startsession in session true
this function starts the session by sending the startsession to the server
public void send raise hand read thread send message raisehand user name
this function sends raisehand message to the server
public void paint graphics g g fill oval 0 0 size width size height
this function draws the circle
public void set center int x int y move x size width 2 y size height 2
this function sets the center of the circle to be drawn
public void end session read thread send message endsession in session false
this function starts the session by sending the endsession to the server
public void value changed tree selection event e fire a property change event with the message to be sent here we send the name of the selected node property support fire property change change e get new lead selection path get last path component to string tree get selection rows 0
this function is invoked everytime the value of the selection changes
public void send upload string s1 string s2 read thread send message upload s1 read thread send file s2
this function uploads the file to the server
private void output indentation for int i 0 i indent i out append basic indent
indent to the current level in multiples of basic indent
public void send message string s read thread send message s
this function sends the specified message to the server
public void up selection if the number of nodes is greater than zero i e if there atleast one node if nodes size 0 if the current node is not the first one then decrease the node selected by one i e of 2 was currently selected select 1 now if tree get selection rows 0 0 tree set selection row tree get selection rows 0 1
this function selects the node which is just above the currently selected node
public void reset pac comp int cnt for cnt 0 cnt pacing length cnt pacing cnt 0 for cnt 0 cnt comprehension length cnt comprehension cnt 0
resets the count for pacing and comprehension options
public void start content display cd thread new thread this thread set name interact files thread start content display cd add a listener to the contentdisplay component listener listnr new listener content display add property change listener listnr
this function starts the thread
public string get selected user if users size 0 selected user string label element at selected user no system out println ea selected user selected user substring 0 8 system out println eb return selected user else return
gets the user currently selected by the presenter
public void enable mic string user read thread send message enablemic user
sends the enablemic message to the server
protected shared list get new shared list return new audio session
overriding to return a new instance of audio session instead of
public void send file string message file reader file buffered reader buff try file new file reader message buff new buffered reader file string file data send the file to the client while file data buff read line null pr println file data pr flush system out println end pr println eof pr flush catch exception ex system out println file problem
sends the specified file to the server
public void disable mic string user read thread send message disablemic user
sends the disablemic message to the server
public void window closing window event e if transmission on as set speaker system exit 0
whenever the window closes the program is terminated
private void remove participant string id audio session participant asp audio session get participant with connection id id if audio session remove item asp system out println asp get name removed
temporary method to remove audio session participant
public void start thread new thread this thread set name capture thread start end start
this function starts the thread which captures audio sends it on the network
private void set connection id string id int i 0 boolean done false browse through the online users to locate the current user while i output streams size done out object output stream object output streams element at i if found set the id if out object client id client no out object connection id id connection id id done true output streams set element at out object i i
temporary method to set the connection id
public string to external form int name len name length string client idstring long to string client id int client idlen client idstring length string buffer buf new string buffer buf append name len buf append buf append client idlen buf append buf append name buf append client idstring buf append connection id return buf to string
writes the objects state as a string
public void from external form string str string tokenizer st new string tokenizer str string name len str st next token int name len integer parse int name len str string client len str st next token int client idlen integer parse int client len str int pos name len str length client len str length 2 name str substring pos pos name len pos name len client id long parse long str substring pos pos client idlen pos client idlen connection id str substring pos
parses a string generated by to external form to initialize an
private void set connection id string id int i 0 boolean done false browse through the online users to locate the current user while i output streams size done out object output stream object output streams element at i if found set the id if out object client id client no out object connection id id done true i
temporary method to set the connection id
public void stop sharing object shared object replicated object client client query list list query list shared object for int i 0 i list get size i query item list get item at i remove property change listener query item replicator list remove list listener listener super stop sharing shared object client
detach any listeners attached in code start sharing code
public string get current query return current query
returns the current query
public void set current query string query object old this current query this current query query fire property change current query old current query
sets the current query
protected void init throws sqlexception system out println connecting to database con driver manager get connection database
initializes or re initializes the connection
public int get row count return results size
returns the number of rows in the result
public void set user string user object old this user this user user listeners fire property change user old user
sets the user who entered this query
public void property change property change event pce if somebody marks the item as not executed add it to our queue of queries to process and wake up our thread if pce get property name equals executed query item item query item pce get source if queue contains item queue add element item synchronized lock lock notify all
detect changes to the executed property of query items on the list
public string get column name int col return cols col
returns the name of the column
public void set query string query object old this query this query query listeners fire property change query old query
sets the query string
protected shared list get new shared list return new query list
subclasses should override this to return an empty instance of
public object get value at int row int col return object results element at row col
returns the data value at the given row and column
public class get column class int col default to object if we can t find anything more specific class cl object class for int i 0 i results size cl object class i object obj object results element at i col if obj null cl obj get class return cl
returns the class for the given column
public void set timestamp string timestamp object old this timestamp this timestamp timestamp listeners fire property change timestamp old timestamp
sets the timestamp string
public result data get result return result
returns the result from the last execution
public string to string if error null return get class get name err error else return get class get name results size x cols length
returns a string describing this instance
public void set result result data result object old this result this result result listeners fire property change result old result
sets the result data for this query
protected void update results int idx list get selected index if idx 1 idx queries get size query item item query item queries get item at idx result data result item get result if result null if current get text index of item get query 1 results set text query is being executed else results set text result not available n double click to re execute else results set text result get results as string else results set text
updates the results panel with the current results of the selected item
public string get results as string string as string error if as string null string buffer buf new string buffer for int i 0 i results size i buf append row buf append i 1 buf append n object vals object results element at i for int j 0 j cols length j buf append buf append cols j buf append if vals j null buf append null else buf append vals j buf append n if buf length 0 as string no results else as string buf to string return as string
returns a possibly very large string describing the contents of
public void set executed boolean executed trying to avoid some object creation overhead here if executed this executed object old boolean true object ex boolean false if this executed old boolean false ex boolean true this executed executed listeners fire property change executed old ex
sets the executed state of this query
public string to external form string buffer buf new string buffer user replace n replace r buf append n buf append query replace n replace r buf append n buf append timestamp buf append n buf append executed return buf to string
returns a string that can be parsed by code from external form code
public void from external form string external form string tokenizer st new string tokenizer external form n if st has more tokens user st next token if st has more tokens query st next token if st has more tokens timestamp st next token if st has more tokens executed boolean value of st next token boolean value
parses the string to initialize the item